🔑Final Test — Answer Key
🛑
Stop here until you have finished the 90-minute final test.
Answer Vault
Try the questions first. Open when you are ready to check.
Q1 Answer: (B)1 mark
Separate instruction and data memories.
- (A) is wrong: One shared memory.
- (C) is wrong: Refers to operand style.
- (D) is wrong: Refers to operand style.
Re-read: Lesson 0.1.1 — What a computer is: CPU, memory, I/O, buses; the stored-program idea; fetch–decode–execute
Q2 Answer: 271 mark
2⁷ × 2²⁰.
Re-read: Lesson 0.2.1 — Binary and hex, powers of two, size units, log₂: n bits name 2ⁿ things
Q3 Answer: (C)1 mark
Big-endian: 100 A1, 101 B2, 102 C3, 103 D4.
- (A) is wrong: Address 103.
- (B) is wrong: Address 100.
- (D) is wrong: Address 101.
Re-read: Lesson 0.2.4 — Memory as an array: address, word, byte vs word addressing, endianness, alignment
Q4 Answer: 101 mark
Opcode 7, registers 15: 32 − 22.
Re-read: Lesson 1.1.1 — Instruction = opcode + operands; instruction formats; the instruction cycle
Q5 Answer: (B)1 mark
The operand's address is itself in memory.
- (A) is wrong: That needs p in a register.
- (C) is wrong: For code-relative addresses.
- (D) is wrong: Not a constant.
Re-read: Lesson 1.2.3 — Choosing modes: arrays, pointers, constants, relocatable code; memory references per mode
Q6 Answer: 41 mark
⌈log₂ 14⌉.
Re-read: Lesson 2.1.1 — Building an ALU: 1-bit slice, n-bit ALU, subtraction, flags Z N C V
Q7 Answer: (D)1 mark
MAR drives the address bus.
- (A) is wrong: Its value is copied into MAR.
- (B) is wrong: Holds the instruction.
- (C) is wrong: Holds data.
Re-read: Lesson 2.2.1 — CPU registers and register transfer notation: PC, IR, MAR, MDR, GPRs, flags, SP
Q8 Answer: (B)1 mark
A control-memory read per step; changes are microcode edits.
- (A) is wrong: That describes hardwired.
- (C) is wrong: Easier to modify.
- (D) is wrong: Not faster.
Re-read: Lesson 3.2.3 — Microprogram sequencing: next-address field, conditional branches; hardwired vs microprogrammed
Q9 Answer: 0.971 mark
9700 / 10000.
Re-read: Lesson 4.1.1 — Why a hierarchy: speed, cost, size; locality; hit, miss, hit ratio
Q10 Answer: (B)1 mark
One transistor and a capacitor per bit.
- (A) is wrong: SRAM is faster.
- (C) is wrong: Both are volatile.
- (D) is wrong: DRAM needs refresh.
Re-read: Lesson 4.1.3 — Memory chips: SRAM vs DRAM, ROM types, DRAM refresh; chip organisation 2ᵏ × n
Q11 Answer: 31 mark
Offset 5 bits, line 4 bits: (0x5A7C >> 5) mod 16 = 723 mod 16 = 3.
Re-read: Lesson 4.2.1 — Cache lines and blocks; direct mapping: tag, line, offset
Q12 Answer: (B) (C) (D)1 mark
Write-through writes memory on every hit.
- (A) is wrong: That is write-through.
Re-read: Lesson 4.3.1 — Write policies: write-through vs write-back, dirty bit, write-allocate
Q13 Answer: 1051 mark
6 + 99.
Re-read: Lesson 5.1.1 — The pipeline idea: stages, latches, cycle time, k + n − 1 cycles
Q14 Answer: (B) (D)1 mark
I2 reads R1 (RAW) and writes R1 (WAW).
- (A) is wrong: I1 does not read R1.
- (C) is wrong: I2 does not read R2.
Re-read: Lesson 5.2.2 — Data dependences: RAW, WAR, WAW; finding them in code
Q15 Answer: (C)1 mark
One bus cycle stolen per word.
- (A) is wrong: Transparent mode.
- (B) is wrong: Programmed I/O.
- (D) is wrong: Burst mode.
Re-read: Lesson 6.2.3 — DMA: the controller, burst mode, cycle stealing, transparent mode; CPU time lost
Q16 Answer: 32 marks
CPI = 0.5 + 0.9 + 0.4 = 1.8; 2×10⁹ × 1.8 / 1.2×10⁹ = 3.
Re-read: Lesson 0.1.2 — Performance: clock, cycle time, CPI, execution time, MIPS, speedup, Amdahl's law
Q17 Answer: 2242 marks
65,536 − 49,152 − 12,800 = 3,584; ÷ 16 = 224.
Re-read: Lesson 1.1.4 — Instruction encoding: opcode space, register fields, expanding opcodes
Q18 Answer: 1232 marks
2 + 30 × 4 + 1.
Re-read: Lesson 1.3.1 — Tracing programs: registers, memory and flags; counting memory references and cycles
Q19 Answer: 52 marks
Append 0: 1001 1001 0. Pairs from the right: 10 (−1), 01 (+1), 00, 10 (−1), 11, 01 (+1), 00, 10 (−1). Recoded −1 0 +1 0 −1 0 +1 −1 = −128 + 32 − 8 + 2 − 1 = −103 ✓: 2 additions + 3 subtractions = 5.
Re-read: Lesson 2.1.3 — Multiplication: shift-and-add, Booth's algorithm; restoring division
Q20 Answer: 172 marks
7 + 6 + 4.
Re-read: Lesson 2.2.2 — Single-bus datapath: control signals and micro-operation steps for fetch and execute
Q21 Answer: 262 marks
3 + 4 + 4 + 2 = 13; + 3 + 10.
Re-read: Lesson 3.2.3 — Microprogram sequencing: next-address field, conditional branches; hardwired vs microprogrammed
Q22 Answer: 4.452 marks
1 + 0.1 × (12 + 0.15 × 150) = 1 + 0.1 × 34.5.
Re-read: Lesson 4.1.2 — Average memory access time: hierarchical vs simultaneous access; multi-level formulas
Q23 Answer: 162 marks
(1M/128K) × (8/4) = 8 × 2.
Re-read: Lesson 4.1.4 — Memory interfacing: building larger memories from chips, address decoding, chip counts
Q24 Answer: 819202 marks
Lines 4,096; sets 1,024 → 10; offset 6; tag 16; per line 20.
Re-read: Lesson 4.2.3 — Tag directory size and cache hardware: valid, dirty and replacement bits
Q25 Answer: 42 marks
2 sets; all odd → set 1 (4 ways): 1, 5, 9 M; 1 H; 5 H; 13 M; 1 H; 9 H.
Re-read: Lesson 4.2.4 — Tracing references: hits and misses; compulsory, capacity and conflict misses
Q26 Answer: 6.32 marks
Penalty 80 ns = 160 cycles; 1.1 + 1.3 × 0.025 × 160 = 1.1 + 5.2.
Re-read: Lesson 4.3.2 — Miss penalty and block transfer; memory-stall cycles; CPI with cache misses
Q27 Answer: 102 marks
One load-use stall (ADD R5 after LOAD R4): 9 + 1.
Re-read: Lesson 5.2.3 — Handling data hazards: stalling, operand forwarding, the load-use hazard
Q28 Answer: 842 marks
τ = 7; executed I1, I2, I3, I7, I8, I9: 12 cycles × 7.
Re-read: Lesson 5.2.4 — Control hazards: branch penalty, flushing, prediction, delayed branch
Q29 Answer: 163842 marks
Rows 512 B = 16 blocks apart; 512 lines → a column uses only 32 lines; blocks are evicted before reuse.
Re-read: Lesson 4.3.4 — Programs and caches: array layout, loop order, counting misses
Q30 Answer: 0.22 marks
Block time 4 ms; CPU 8 µs.
Re-read: Lesson 6.2.3 — DMA: the controller, burst mode, cycle stealing, transparent mode; CPU time lost