Skip to content

← Grade 9 Computing

Exam practice

Every question from the end of every unit, with hints and answers to open. After you check an answer, mark how you did, and come back to the ones you didn’t get.

14 questions

Unit 1 · How a Computer Really Works

a.

Draw a half adder with its gates, and write its truth table. Why is it called a half adder?

Answer

Inputs A and B both go into an XOR gate, whose output is the sum (S), and into an AND gate, whose output is the carry (C).

A B carry sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0

It is a half adder because it adds only two bits. In a sum of binary numbers every column except the first must also add the carry from the column on its right: three bits. That needs a full adder, which can be made of two half adders and an OR gate.

b.

Add 0110 and 0111 with a 4-bit ripple-carry adder. Write the sum bit and the carry out of each full adder, from the 1s column to the 8s column. What is the answer, and does it overflow 4 bits?

Answer
Column A B carry in sum carry out
1s 0 1 0 1 0
2s 1 1 0 0 1
4s 1 1 1 1 1
8s 0 0 1 1 0

The answer is 1101, which is 13 (6 + 7 = 13). The last carry out is 0, so it fits in 4 bits: no overflow.

c.

Name the three main parts of a CPU, and say what each one does.

Answer
  • The control unit (CU) fetches each instruction from memory, decodes it, and sends signals to the other parts so that it is carried out. It controls the movement of data inside the processor and between the processor, memory and devices.
  • The arithmetic logic unit (ALU) does the arithmetic (add, subtract) and the logic (AND, OR, NOT, comparing numbers).
  • The registers (sometimes called the memory unit) are small, very fast memories inside the processor that hold the instruction, the data and the results it is working on: for example the program counter, the instruction register and the accumulator.
d.

Describe the fetch–decode–execute cycle. Say what happens to the program counter, and which buses are used.

Answer
  1. Fetch: the address in the program counter is sent along the address bus, with a “read” signal on the control bus. Memory sends the instruction at that address along the data bus into the instruction register. The program counter goes up by one, so it points to the next instruction.
  2. Decode: the control unit works out what the instruction means: the operation and the address or register it uses.
  3. Execute: the instruction is carried out: the ALU calculates, data is copied between memory and registers (using the buses again), or, for a jump, a new address is put in the program counter.

Then the cycle starts again with the next fetch, billions of times a second. Between instructions the processor checks for interrupts.

e.

For the model processor, trace this program. Cell 14 holds 9 and cell 15 holds 4. Write the ACC after each instruction and the output.
0: LOAD 14, 1: SUB 15, 2: STORE 13, 3: ADD 13, 4: OUT, 5: HALT

Answer
Instruction ACC after Notes
LOAD 14 9
SUB 15 5 9 − 4
STORE 13 5 cell 13 is now 5
ADD 13 10 5 + 5
OUT 10 shows 10
HALT 10 stops

The output is 10: the program works out (a − b) × 2.

f.

What is the difference between machine code and assembly language? What does an assembler do? How is a compiler different from an interpreter?

Answer

Machine code is a program as the bits a processor reads and carries out directly, such as 0001 1110. Assembly language writes each machine instruction as a short word with its address, such as LOAD 14, so people can read and write it. An assembler translates assembly language into machine code, one instruction for one.
A compiler translates a whole high-level program into machine code before it runs; the machine code can then be run many times without translating again. An interpreter translates and runs the program a line (or statement) at a time, each time it runs; it is easier for testing, but the program runs more slowly.

g.

The program that multiplied by adding again and again gave 50 × 7 = 94. Explain why. Give two other limits that a real computer or phone has.

Answer

50 × 7 = 350, which needs 9 bits (256 + 64 + 16 + 8 + 4 + 2 = 350). The ACC holds only 8 bits, so the 9th bit, worth 256, was lost: 350 − 256 = 94. This is an overflow, and the processor carried on as if nothing were wrong.
Other limits (any two): the amount of RAM and storage; how fast it works (some jobs need too many steps); numbers with a decimal point are kept to about 16 digits, so tiny errors creep in (0.1 + 0.2); its battery; heat, which makes it slow down; it does only exactly what the program says, even when the program is wrong.

h.

What is cache memory? Explain how it makes a computer faster, using the words hit and miss.

Answer

Cache is a small, very fast memory (SRAM) on the processor chip, between the registers and RAM. It keeps copies of the instructions and data the processor has used most recently.
When the processor needs something, it looks in the cache first. If it is there (a cache hit), it gets it in a few nanoseconds. If not (a cache miss), it must wait for RAM, many times slower, and a copy is put in the cache in place of what was used longest ago. Programs use the same instructions and data again and again (loops, totals), so most reads are hits, and the processor waits far less.

i.

Give four differences between primary memory and secondary memory, with two examples of each.

Answer
Primary memory Secondary memory
reached directly by the processor, by address not reached by address: copied into RAM first, in blocks
much faster much slower
smaller (megabytes to gigabytes) bigger (gigabytes to terabytes)
costs more for each byte costs less for each byte
holds the programs and data in use now keeps programs and files for later
mostly volatile (RAM, cache), but ROM keeps its data non-volatile: keeps data with no power
e.g. RAM, ROM, cache e.g. SSD, hard disk, pen drive, memory card, DVD
j.

Compare SRAM and DRAM. Where is each used, and why?

Answer
SRAM DRAM
each bit kept in a latch of about six transistors each bit kept as charge in a capacitor, with one transistor
needs no refreshing must be refreshed many times a second, as the charge leaks
faster slower
fewer bits in a chip, costs more many more bits in a chip, costs less

SRAM is used for cache, where a small amount must be as fast as possible. DRAM is used for main memory (RAM), where gigabytes are needed at a price people can pay. Both are volatile.

k.

Write the full forms: CPU, ALU, CU, MU, PC, RAM, ROM, SRAM, DRAM, PROM, EPROM, EEPROM, BIOS, OS.

Answer

CPU: central processing unit. ALU: arithmetic logic unit. CU: control unit. MU: memory unit. PC: program counter (also personal computer). RAM: random-access memory. ROM: read-only memory. SRAM: static random-access memory. DRAM: dynamic random-access memory. PROM: programmable read-only memory. EPROM: erasable programmable read-only memory. EEPROM: electrically erasable programmable read-only memory. BIOS: basic input/output system. OS: operating system.

l.

Why is the operating system called a special kind of software? Explain how it manages memory and devices, with an example of each from a phone.

Answer

It is special because it runs first, when the computer starts, and keeps running until it is shut down; its kernel runs in kernel mode, with full control of the hardware, while every app runs in user mode and must ask it for anything with a system call; and it manages the other programs: which run, when, and with how much memory.
Memory: it gives each running app (process) its own part of RAM and, with the processor’s help, stops one app reading or changing another’s. When RAM is full it moves pages not used lately to storage (virtual memory) or closes an app. Example: a game you left an hour ago is closed so that the camera has room.
Devices: it works each device through its driver, and devices tell it when they need attention with interrupts. It queues requests, such as documents for a printer. Example: when a message arrives, the network chip sends an interrupt, and the operating system takes the data and wakes the messaging app; when you plug in earphones, it notices and sends the sound to them.

m.

Differentiate between system software and application software, with two examples of each.

Answer
System software Application software
runs and manages the computer itself, so that other programs can run does a particular job for the user
the operating system starts with the computer and runs until it is shut down runs when the user opens it and stops when it is closed
can run without application software needs system software (the operating system) to run
e.g. an operating system, a printer driver, an antivirus, a compiler e.g. a web browser, a word processor, a game, a shop’s billing program
n.

Describe what happens when a computer boots, from pressing the power button to the sign-in screen.

Answer
  1. The processor starts running the firmware (BIOS or UEFI) kept in ROM or flash on the motherboard; RAM is empty.
  2. The firmware checks the hardware (the power-on self test), finds the storage, and loads the boot loader from it into RAM.
  3. The boot loader loads the operating system’s kernel from storage into RAM and starts it.
  4. The kernel sets up memory, starts the device drivers and the file system, and starts the first programs, ending with the sign-in screen.