Session 2: Inside Computers

Discover the amazing technology inside computers

Session Overview

Welcome to Session 2!

In this session, we'll explore what makes computers work - from the physical parts (hardware) to the programs that run on them (software). We'll also learn about operating systems and how to create simple programs!

Learning Objectives

  • Identify the key components of a computer
  • Understand the difference between hardware and software
  • Learn about different operating systems
  • Discover how data is stored using binary
  • Write simple math programs in Python

Introduction (10 minutes)

Review from Session 1 and introduce today's topics

Computer Hardware (35 minutes)

Learn about CPU, memory, storage, and other components

Break (10 minutes)

Time to stretch and ask questions

Operating Systems & Software (25 minutes)

Explore different operating systems and how software works

Simple Math Programs (30 minutes)

Create Python programs for basic calculations

Wrap-up and Preview (10 minutes)

Review what we've learned and preview Session 3

Activities

Computer Hardware

Computer parts with labels showing CPU, RAM, hard drive, motherboard, etc.

The Main Parts of a Computer

Computers have several important parts that work together:

  • CPU (Central Processing Unit) - The "brain" that performs calculations and executes instructions
  • RAM (Random Access Memory) - Temporarily stores data that programs are currently using
  • Storage - Hard drives or SSDs that permanently store your files and programs
  • Motherboard - The main circuit board that connects all parts together
  • Input Devices - Keyboards, mice, touchscreens, etc.
  • Output Devices - Monitors, speakers, printers, etc.

The Hardware Component Gallery

Activity: Label the Computer Parts

Can you identify all the main components inside a computer?

Start Computer Parts Activity

Operating Systems & Software

What is an Operating System?

An operating system (OS) is the main software that manages your computer. It controls the hardware, runs other software, and provides a user interface.

The operating system is like a translator between you, your apps, and the computer hardware. Without it, your computer would just be a collection of parts that can't do anything!

Common Operating Systems

Windows Logo

Windows

Made by Microsoft

Used on most PCs

Great for gaming and business

macOS Logo

macOS

Made by Apple

Used on Mac computers

Popular for creative work

Linux Logo

Linux

Open source (free)

Many different versions

Used by programmers and servers

Software vs. Hardware

Hardware Software
Physical parts you can touch Programs and code you can't touch
Examples: CPU, keyboard, screen Examples: Games, web browsers, word processors
Wears out over time Can be updated and improved
Usually expensive to replace Can be installed multiple times

Activity: Operating System Explorer

Let's explore features of different operating systems!

Explore All Activities

Binary Numbers

How Computers Store Data

Computers don't understand letters, numbers, or pictures the way we do. At their most basic level, computers only understand two states: ON or OFF, also represented as 1 or 0.

These 1s and 0s are called binary digits or bits. They're the building blocks of all computer data.

With enough bits put together, computers can represent anything - text, images, videos, sounds, and more!

Binary Counting

We count using 10 digits (0-9), called the decimal system. But computers count using just 2 digits (0-1), called the binary system.

Decimal (Base 10) Binary (Base 2)
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000

Activity: Binary Challenge

Click the binary digits (0 or 1) to create different numbers. Can you make the binary number for 15?

0
0
0
0
0
0
0
0

Decimal value: 0

Binary Fun Facts:

  • A single binary digit (0 or 1) is called a "bit"
  • Eight bits together make a "byte"
  • A byte can represent numbers from 0 to 255
  • Text, images, videos, and all computer data are stored as binary
  • A kilobyte (KB) is about 1,000 bytes
  • A megabyte (MB) is about 1,000,000 bytes
  • A gigabyte (GB) is about 1,000,000,000 bytes
Try the Code Puzzle Game

Math Programs with Python

Programming with Python

Python is a popular programming language that's easy to read and write. It's a great first language for beginners!

In Python, you can write instructions for the computer to follow. These instructions can do many things, like perform calculations, create games, or analyze data.

Today, we'll use Python to create simple math programs.

Your First Python Program

# This is a simple Python program that adds two numbers
a = 5
b = 3
sum = a + b
print("The sum of", a, "and", b, "is", sum)
The sum of 5 and 3 is 8

Let's Try More Math Operations

# Python can do all kinds of math operations
a = 10
b = 2

# Addition
print(a, "+", b, "=", a + b)

# Subtraction
print(a, "-", b, "=", a - b)

# Multiplication
print(a, "*", b, "=", a * b)

# Division
print(a, "/", b, "=", a / b)

# Exponentiation (a to the power of b)
print(a, "^", b, "=", a ** b)
10 + 2 = 12 10 - 2 = 8 10 * 2 = 20 10 / 2 = 5.0 10 ^ 2 = 100

Making an Interactive Calculator

# This program asks the user for input
print("Welcome to the Simple Calculator!")

# Get input from the user
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))

# Perform calculations
sum = num1 + num2
difference = num1 - num2
product = num1 * num2
quotient = num1 / num2

# Show results
print("Sum:", sum)
print("Difference:", difference)
print("Product:", product)
print("Quotient:", quotient)
Welcome to the Simple Calculator! Enter the first number: 8 Enter the second number: 2 Sum: 10 Difference: 6 Product: 16 Quotient: 4.0

Activity: Create Your Own Math Program

Now it's your turn to write a Python program that can:

  1. Ask the user for their age
  2. Calculate how old they'll be in 10 years
  3. Calculate how many days old they are (approximately)
  4. Display the results
Try the Code Playground

Resources

Coming Up Next

Session 3: Coding Adventures

In our next session, we'll dive deeper into coding and learn about GitHub, programming languages, and create some exciting projects!

  • Learn about GitHub and version control
  • Explore different programming languages
  • Create interactive web pages with HTML and CSS
  • Build a simple game or animation
GitHub Spark logo
Preview Session 3