Back

Activity 1.1: Computer Architecture

divider

Activity 1.1

Computer Architecture

Key Concepts

How a Computer Works

Input, Processing, Output, and Memory

The Four Basic Functions

Every computer, from a laptop to a microwave, performs the same four basic functions.

The Four Basic Functions

Diagram showing Input flowing into Processing (CPU), Processing flowing into Output, and Memory connected to Processing

Input

Information a computer receives from the outside world.

  • Keyboard and mouse
  • Microphone and camera
  • Sensors (temperature, motion, light)

Output

Information a computer sends back out to the world.

  • Monitor and speakers
  • Printer
  • LEDs and motors

Processing

The CPU (Central Processing Unit) is the "brain" of the computer. It carries out instructions and makes decisions, one step at a time.

Memory

Computers need somewhere to hold data while they work, and somewhere to keep it long-term.

  • RAM — temporary, cleared when the power turns off
  • Storage (like a hard drive or SSD) — permanent, kept even after the power turns off

Binary

Underneath everything a computer does, it only understands two states: on and off.

We represent those two states as 1 and 0. Each one is called a bit.

Binary

Diagram showing eight bits, 01000001, grouped together as one byte representing the letter A

Eight bits grouped together make one byte.

Programming Languages

A programming language lets us write instructions in a form that's easier for humans to read and write, which then gets translated down into the binary a computer actually runs.

Programming Languages

There are many programming languages, each with its own rules:

  • Python
  • JavaScript
  • Java
  • C++

This course uses Python.

Code Editors

A code editor is a specialized text editor built for writing and running code — it can highlight syntax, catch errors, and run your programs, all in one place.

Code Editors

There are many. Your teacher will tell you which one this class uses — the ideas are the same in all of them.

Today's Objectives

  • Identifying input, processing, output, and memory
  • Understanding binary as a computer's "language"
  • Writing and running your first Python program

Key Terms

Input
Information a computer receives from the outside world.
Output
Information a computer sends back out to the world.
Processing (CPU)
The part of the computer that carries out instructions.
Memory
Where a computer holds data, either temporarily (RAM) or long-term (storage).

Key Terms

Binary
A system of representing information using only two states, on and off.
Bit
A single binary digit, either 0 or 1.
Byte
A group of eight bits.
Programming Language
A structured set of rules for writing instructions a computer can run.
Code Editor
A program built for writing, testing, and running code.

'F' → Fullscreen

divider

Build

Open your coding environment and write your very first Python program.


Task 1: Set Up Your Environment

  • Follow your teacher's setup guide to open your coding environment. Different setups work differently — the guide covers the one this class uses.

Task 2: Start Your First Program

  • Create a new Python program named 1-1-hello.

About naming. Every activity tells you what to name your work. Depending on your setup that might be a project, a workspace, or a file — the name is what matters, so your work can be found and graded.


Task 3: Write and Run Hello World

  • Type the following line of code into your file.
  • Run your program and check the terminal for the output.
Computer Architecture
print("Hello, world!")

Task 4: Plan a Program — No Code Yet

You just ran a one-line program. Real programs are longer, and the hardest part is usually not the typing — it is working out what the steps are and what order they go in.

Pseudocode is how programmers plan that out. You write the steps in plain language, in order, with no programming syntax at all. No quotes, no parentheses, nothing to get wrong. For this class, use these three words:

  • INPUT — something comes in from the user
  • SET — the computer works something out and remembers it
  • DISPLAY — something goes out to the screen

Here is a plan for a program that greets someone by name:

INPUT the person's name
SET greeting to "Hello, " joined with the name
DISPLAY greeting

Notice that those three words line up with three of the four basic functions from today: Input, Processing, and Output.

Your Turn

Below is the plan for one exchange in a game — a drone drops out of the ceiling and you fight it. Somebody already wrote the steps. Your job is to read them.

INPUT the player's choice: attack or dodge
SET damage to the player's weapon power
SET the drone's health to its health minus damage
DISPLAY the drone's remaining health
INPUT the player's next choice
SET the player's score to its score plus 100
#

Part A. Write the numbers 1 through 6 down your page. Next to each one, put Input, Processing, or Output.

Part B. This game has a problem — you can beat the drone and it never tells you. Write the one line that is missing, using one of the three words, and say where in the list it belongs.

There is no Python to write and nothing to run for this task. If you catch yourself typing a parenthesis, you have drifted into code — go back to plain words.

divider

Checkpoint

Verify your program works correctly.

Example Output
Hello, world!
divider

Reflection

Answer the following questions before submitting your work.

  1. Pick one of the four basic functions — input, processing, output, or memory — and name a part of the human body that does the same job. Explain the match in one sentence.
  2. A computer only understands 1s and 0s, but nobody writes programs that way. Why would a person rather write print("Hello") than a long row of 1s and 0s?
  3. In your own words, what is the difference between input and output? Give one example of each from a device you used today.
divider

Submit

Submit the required files to the appropriate dropbox.

Activity Complete