Logic and computer systems · GCSE · OCR J277 1.1.1, AQA 8525 3.4.1, Edexcel 1CP2 3.1.1 · about 15 min
Hardware and software, and the stored program concept in a tiny computer.
[1 mark]Which of these is software?
[1 mark]What is the stored program concept?
[1 mark]Which is system software?
[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)
[1 mark]How does the processor know which address holds the next instruction?
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.
JUMP a instruction that sets the program counter to a, and use it to make a program that outputs forever. Then stop it.HALT.