The answersDownload the PDF
Worksheet

F9.3 Hardware, software and von Neumann

Logic and computer systems · GCSE · OCR J277 1.1.1, AQA 8525 3.4.1, Edexcel 1CP2 3.1.1 · about 15 min

BugBotLab
NameClassDate

What this lesson is about

Hardware and software, and the stored program concept in a tiny computer.

Questions 5 marks in all

  1. [1 mark]Which of these is software?

    1. AThe robot's firmware
    2. BThe camera
    3. CThe battery
    4. DThe processor
  2. [1 mark]What is the stored program concept?

    1. AProgram instructions and data are held together in the same memory
    2. BPrograms are stored on a separate disk from data
    3. CPrograms are wired into the processor
    4. DEvery program is saved before it runs
  3. [1 mark]Which is system software?

    1. AAn operating system
    2. BA web browser
    3. CA game
    4. DA word processor
  4. [1 mark]What does this program print?

    memory = ["LOAD 3", "ADD 4", "HALT", 30, 12]
    acc = memory[int(memory[0].split()[1])]
    acc = acc + memory[int(memory[1].split()[1])]
    print(acc)
  5. [1 mark]How does the processor know which address holds the next instruction?

    1. AThe program counter holds its address
    2. BInstructions are marked differently from data
    3. CIt reads every address in order until it finds one
    4. DThe user types it in

The task: a stored program

Add a SUB instruction to the tiny computer, which subtracts the value at an address from the accumulator. Then put a program in memory that loads 50 from address 6, subtracts 8 from address 7, stores the answer at address 8 and outputs it, so the program prints output: 42. The robot should then drive forward the answer in centimetres, divided by 2, read from memory address 8.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

memory = ["LOAD 6", "ADD 7", "STORE 8", "OUT 8", "HALT", "", 50, 8, 0]

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/f9-3-hardware-software-and-von-neumann/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Add a JUMP a instruction that sets the program counter to a, and use it to make a program that outputs forever. Then stop it.
  2. What happens if the program counter reaches address 6? Try removing the HALT.
  3. List five pieces of software BugBot uses, and say whether each is system or application software.