Back to the 2022 paper

Module 4: Memory Organization

202214m

(3). Consider a hypothetical 32-bit microprocessor having 32-bit instructions composed of two fields—the first byte contains the opcode and the remainder the immediate operand or an operand address.

(a) What is the maximum directly addressable memory capacity (in bytes)?

(b) Discuss the impact on the system speed if the microprocessor bus has—
    i) a 32-bit local address bus and a 16-bit local data bus, or
    ii) a 16-bit local address bus and a 16-bit local data bus.
(c) How many bits are needed for the program counter and the instruction register?

Worked SolutionAI Assisted

Hypothetical: Instruction = 32 bits = 8 bits opcode + 24 bits address/immediate.

(a) Maximum Directly Addressable Memory Capacity

Direct field = 32−8=2432-8 = 24 bits.

If byte-addressable: Capacity=224Capacity = 2^{24} bytes =16,777,216=16,777,216 B =16=16 MB.

If word-addressable (32-bit word =4B): 2242^{24} words =224×4=226= 2^{24}\times4 = 2^{26} B =64=64 MB, i.e. 4M4M words.

Note: If microprocessor internally has full 32-bit address bus, theoretical max = 2322^{32} B =4=4 GB, but with given format without indirect/indexing you can only encode 24-bit direct address ⇒\Rightarrow only 1616 MB directly without using indirect or paging.

(b) Impact of Bus Width on Speed

Assume memory and CPU are 32-bit, but buses narrower:

i) 32-bit address bus, 16-bit data bus

  • Address bus 32-bit ⇒\Rightarrow can address full 232=42^{32}=4 GB.
  • Data bus 16-bit ⇒\Rightarrow each 32-bit instruction or operand needs 2 bus cycles to fetch/transfer (16 bits per cycle).
    • e.g. Instruction fetch: Tfetch=2×TbusT_{fetch}=2\times T_{bus} vs 1×1\times with 32-bit data bus.
    • Data read/write of 32-bit word also 2 cycles. Bus bandwidth halved: BW=16BW = 16 bits/cycle vs 3232.
    • Needs two memory accesses, causes wait states, effective CPI increases.
    • Still functionally correct, but speed roughly ~50% for memory-intensive code + extra control logic (byte assembly, multiplexing).

ii) 16-bit address bus, 16-bit data bus

  • Address 16-bit ⇒\Rightarrow directly addressable = 216=642^{16}=64 KB only! Massive limitation.
    • To access beyond 64KB need banking, segment registers, page registers, or multiplexed address (like 8086 with 20-bit via segment:offset) – adds software/hardware overhead and slowdown.
    • Cannot use full 32-bit address field; higher bits must be latched in two cycles (address multiplexing) or ignored.
  • Data 16-bit ⇒\Rightarrow same 2-cycle fetch as case (i).
  • Overall: Much slower than (i) + severely limited memory. Requires extra bus cycles to send full 32-bit address (send low 16 then high 16) if attempting to address 4GB, effectively 2 address cycles + 2 data cycles per access. System speed degraded by >2×> 2\times and programmability restricted.

Summary: Widening address bus increases address space; widening data bus increases throughput. Halving data bus doubles memory cycles. Halving address bus collapses address space.

(c) Bits needed for PC and IR

  • Instruction Register (IR): Must hold full instruction =32=32 bits (8 opcode +24 operand). So IR=32IR=32 bits.
  • Program Counter (PC): Must hold address of next instruction.
    • If holding direct field only: 2424 bits (to address 1616 MB).
    • If holding full memory address (32-bit address bus): 3232 bits to address full 44 GB, even though instruction can only encode 24 bits directly (rest via indirect).
    • Practical design: PC=32PC=32 bits, IR=32IR=32 bits. For byte-addressable with word-aligned instructions (4B), PC increments by 4.

Exam answer: IR=32IR=32 bits, PC=24PC=24 bits minimum (3232 bits for full 4GB system).

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.