The worksheetDownload the PDF
Answers

A9.1 Hardware, software and the stored program

Computer architecture · A level · OCR H446 1.1.1, AQA 7517 4.6.1.1, Eduqas A500QS 2.1 · about 20 min

BugBotLab

What this lesson is about

Internal components, the three buses and their widths, I/O controllers, the stored program concept, and von Neumann against Harvard.

Questions 6 marks in all

  1. [1 mark]Which bus is unidirectional, carrying signals only from the processor?

    1. AAddress bus
    2. BData bus
    3. CControl bus
    4. DAll three
    Answer: A. The processor puts addresses on the address bus; data and control lines carry signals both ways.
  2. [1 mark]A processor has a 20-bit address bus. How many different memory addresses can it use?

    Answer: 1048576. 2 to the power 20 is 1,048,576.
  3. [1 mark]Which statement is the stored program concept?

    1. AMachine code instructions are stored in main memory and fetched and executed serially by the processor
    2. BPrograms are stored on secondary storage so they survive power loss
    3. CInstructions and data are kept in separate memories
    4. DA program is set up by wiring the processor for each job
    Answer: A. The program sits in main memory with its data and is fetched and executed one instruction at a time.
  4. [1 mark]Where is the Harvard architecture typically used?

    1. AEmbedded systems and digital signal processors
    2. BDesktop PCs running many applications
    3. CWeb servers
    4. DSpreadsheet software
    Answer: A. Separate instruction and data memories suit fixed programs in flash and fast, predictable timing.
  5. [1 mark]What is the job of an I/O controller?

    1. ATo connect a device to the buses and translate between the processor's signals and the device's
    2. BTo store the program while it runs
    3. CTo decode instructions
    4. DTo add numbers for the processor
    Answer: A. The processor reads and writes the controller like memory; the controller handles the device.
  6. [1 mark]How does hardware relate to software?

    1. ASoftware is instructions that only do something when run on hardware, and hardware needs software to tell it what to do
    2. BSoftware is the physical parts and hardware is the programs
    3. CHardware can do useful work without any software
    4. DSoftware is only the operating system
    Answer: A. Each is useless without the other; software is ultimately machine code for the hardware's instruction set.

The task: bus widths

Work out what a bus of a given width can carry. - For each address bus width in [12, 16, 24, 32] bits, print how many different addresses it can make, as a whole number with no commas, in the form address bus 16 bits: 65536 addresses. - For each data bus width in [8, 16, 32] bits, print the smallest and largest unsigned whole number it can carry, in the form data bus 8 bits: 0 to 255. Print the seven lines in that order. The robot does not move.

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

address_widths = [12, 16, 24, 32]
data_widths = [8, 16, 32]

The hint students can ask for: Each wire carries one bit, so ask how many different patterns a given number of bits can make. The smallest unsigned value is all zeros; the largest is all ones, which is one less than the number of patterns.

A solution

from bugbot import *
connect()
address_widths = [12, 16, 24, 32]
data_widths = [8, 16, 32]
for n in address_widths:
    print(f"address bus {n} bits: {2 ** n} addresses")
for w in data_widths:
    print(f"data bus {w} bits: 0 to {2 ** w - 1}")

Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.