Exercise 1: Why Exactly 8 General-Purpose Registers — Possible Solution ==================================================================== THE BIT-BUDGET REASONING ------------------------------ Per the chapter's own explanation, a register operand field needs enough bits to uniquely select one register out of however many exist. The number of registers selectable by an N-bit field is 2^N: 2 bits -> 4 registers 3 bits -> 8 registers 4 bits -> 16 registers LC-3 uses a 3-bit register field, which selects exactly one of 8 registers (2^3 = 8) -- that's precisely where R0 through R7 comes from. WHY NOT 16 REGISTERS ------------------------------ 16 registers would require a 4-bit field instead of 3. Per assembly1-3's own bit-budget reasoning, LC-3's 16-bit instructions are already tight on space -- many instructions need room for an opcode PLUS multiple register fields (e.g. ADD needs a destination register and up to two source registers). Widening every register field by just one extra bit would eat into the space already needed for opcodes and offsets, without a strong enough benefit given LC-3's load/store design (this chapter's own point that a handful of registers is genuinely sufficient once ALU ops never touch memory directly). WHY NOT 4 REGISTERS ------------------------------ 4 registers would only need a 2-bit field, saving a bit -- but per this chapter's own load/store-architecture reasoning, a CPU still needs enough active registers to hold everything a real calculation is actively working with at once (e.g. a loop counter, an accumulating sum, and a pointer, all live simultaneously). 8 was chosen as a practical middle ground: enough registers to comfortably hold a real program's active working values, without spending more instruction bits than a load/store design actually needs. WHY THIS WORKS AS AN ANSWER ------------------------------ It ties the count of 8 directly to the chapter's own 3-bit field math (2^3 = 8), and explains both directions of the trade-off (why not more, why not fewer) using the chapter's own stated instruction bit-budget and load/store reasoning, rather than treating 8 as an arbitrary given number.