Lesson plan

Build a home computer lesson plan

From a CPU of NAND gates to a machine with a keyboard, a screen, a hex monitor and a BASIC that saves your programs.

3 chapters, 6 lessons, about 7 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • A CPU, a keyboard decoded by hand, and a screen driven a byte at a time.
  • A machine code monitor, then a BASIC with an interpreter you can read.
  • Type in a program, play it, change it and save it.

Materials for the whole unit

  • Arduino Uno R3
  • Bit switch
  • chip:c26
  • Program ROM
  • PS/2 keyboard
  • Step clock
  • Terminal

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 3 h 25 min

The hardware

A CPU, a keyboard decoded by hand, and a screen driven a byte at a time.

LessonTimeWhat students do
The Kestrel CPURun a CPU of four thousand NAND gates, step it one instruction at a time, write it a loop in machine code, and find what it would need to be a home computer.65 min
  1. A CPU you can see inside
  2. One instruction a tick
  3. Machine code: write a loop
  4. Where it stops
  5. What a home computer needs
A keyboardDecode a PS/2 keyboard by hand: an interrupt on the clock, eleven bits a frame, odd parity, and set 2 make and break codes turned into letters.65 min
  1. The keyboard tests itself
  2. Eleven bits on two wires
  3. Letting go
  4. Shift is just a key
  5. The keys that came later
A text terminalDrive a screen one byte at a time with eight data lines, a write enable and a clock, and make Enter, Backspace and Escape do what a terminal does.75 min
  1. Hello, screen
  2. One byte, one clock edge
  3. Type on it
  4. Enter and Backspace
  5. Clear the screen
  6. A second keyboard

Materials

  • Arduino Uno R3
  • Bit switch
  • chip:c26
  • Program ROM
  • PS/2 keyboard
  • Step clock
  • Terminal

Check for understanding

Each student finishes "A text terminal" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A second keyboard".

Chapter 2. About 2 h 20 min

The software

A machine code monitor, then a BASIC with an interpreter you can read.

LessonTimeWhat students do
A monitor programLook at memory, change it a byte at a time, and run it: a 1976-style hex monitor that loads Kestrel machine code you assemble by hand.65 min
  1. Switch it on
  2. Examine memory
  3. Run it
  4. Change a byte
  5. Assemble by hand
BASIC-liteProgram the machine in a small BASIC: a calculator at the prompt, variables, numbered lines, FOR loops, IF and GOTO, and the errors that tell you what went wrong.75 min
  1. Boot to BASIC
  2. A calculator
  3. Variables
  4. A program
  5. When it goes wrong
  6. Decisions and jumps

Materials

  • Arduino Uno R3
  • PS/2 keyboard
  • Terminal

Check for understanding

Each student finishes "BASIC-lite" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Decisions and jumps".

Chapter 3. About 1 h 15 min

Your computer

Type in a program, play it, change it and save it.

LessonTimeWhat students do
Project: type and run a programType in a game the way magazines printed them in 1980, play it, make it harder, save it to EEPROM and load it back after wiping the machine.75 min
  1. Type it in
  2. Play it
  3. Make it yours
  4. Save it
  5. Wipe it and load it
  6. Share your program

Materials

  • Arduino Uno R3
  • PS/2 keyboard
  • Terminal

Check for understanding

Each student finishes "Project: type and run a program" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Share your program".

Your class

Teach this unit as a class

Start a class from this course and its 6 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.