2024 U1 Q1

Introduction

This question tested the following topics/items:

  • Registers found in the CPU: Instruction Register (IR), Memory Address Register (MAR) and Memory Data Register (MDR)
  • Storage devices vs. memory: access method and access speed (hard disk vs. RAM)
  • Memory features: volatility; storage device features: portability (RAM vs. flash drive)
  • Instruction format (opcode and operand/address fields)
  • Addresses per instruction: one-address and two-address instructions

Part a) i)

The Instruction Register (IR) holds the instruction that has just been fetched from memory while it is being decoded and executed.

Part a) ii)

The Memory Address Register (MAR) holds the address of the memory location that is about to be read from or written to.

Part a) iii)

The Memory Data Register (MDR) temporarily holds the data (or instruction) that has just been read from memory, or the data that is about to be written to memory.

Further explanation

During the fetch stage, the address in the Program Counter (PC) is copied to the MAR, the instruction stored at that address is copied from memory into the MDR, and then from the MDR into the IR (also called the CIR, Current Instruction Register) so that it can be decoded.

See this note: 2009 U1 Q2 Part C

Part b) i)

Access method: A hard disk uses direct (semi-random) access. The read/write head must first move to the correct track (seek time) and then wait for the required sector to rotate under it (rotational delay) before the data can be read. RAM uses random access. Any memory location can be accessed directly, electronically, using its address, and it takes the same time no matter where the data is stored.

Access speed: Since the hard disk depends on moving mechanical parts, its access time is measured in milliseconds. RAM has no moving parts, so its access time is measured in nanoseconds. RAM is therefore many thousands of times faster than a hard disk.

See this note: Serial, Sequential, Direct (Random) Access

Part b) ii)

Volatility: RAM is volatile, i.e. its contents are lost when the power is switched off. A flash drive is non-volatile, i.e. it keeps its data when it is unplugged or the power is removed, since it uses flash memory (a type of EEPROM).

Portability: RAM is installed internally on the motherboard and is not designed to be removed and carried from one computer to another. A flash drive is small and light and connects to a USB port, so it is designed to be carried around and used to transfer data between computers.

Summary

FeatureHard diskRAMFlash drive
Access methodDirect (semi-random): head seeks the track, waits for the sectorRandom: any location accessed directly by its addressRandom (electronic, no moving parts)
Access speedSlow (milliseconds)Very fast (nanoseconds)Slower than RAM, faster than a hard disk
VolatilityNon-volatileVolatileNon-volatile
PortabilityInternal (portable only if external)Not portable (internal, on motherboard)Highly portable (USB)

See this note: Videos: The Major components of a computer system

Part c) i)

The instruction format is the layout of a machine code instruction, i.e. how the bits of the instruction are divided into fields. It is made up of an opcode field, which specifies the operation to be carried out, and one or more operand (address) fields, which specify the data, or the address of the data, to be used. The format also fixes how many bits are given to each field, how many addresses the instruction has, and whether instructions are of fixed or variable length.

OPCODEOperand 1Operand 2

See this note: 2009 U1 Q2 Part C

Part c) ii)

One-address

The instruction has an opcode and one address field. The second operand is implied: it is held in the accumulator (AC), and the result of the operation is also stored in the accumulator.

OPCODEAddress

e.g. ADD X means AC ← AC + [X]

Two-address

The instruction has an opcode and two address fields, so both operands are given explicitly. The result is usually stored in the location given by the first address, which overwrites its original value.

OPCODEAddress 1Address 2

e.g. ADD X, Y means X ← [X] + [Y]

Further explanation

The instructions needed to calculate X = A + B using each format:

One-address:

LOAD  A    ; AC ← [A]
ADD   B    ; AC ← AC + [B]
STORE X    ; X  ← AC

Two-address:

MOVE  X, A ; X ← [A]
ADD   X, B ; X ← [X] + [B]

One-address instructions are shorter, but more of them are needed. Two-address instructions are longer, but fewer instructions are needed.


© 2026 Vedesh Kungebeharry. All rights reserved.

Leave a Reply