Exercise 2: Why NOT Doesn't Need a Mode Bit — Possible Solution ==================================================================== WHY ADD AND AND NEED A MODE BIT ------------------------------ ADD and AND per the chapter's own section are each capable of TWO distinct forms: register mode (both operands are registers) or immediate mode (one operand is a register, the other a literal constant baked into the instruction). Since the instruction's encoding has to tell the CPU which of those two interpretations applies to the bits that follow, a single bit (bit 5) is reserved specifically to record that choice -- 0 for register mode, 1 for immediate mode. WHY NOT DOESN'T NEED ONE ------------------------------ NOT is unary -- per the chapter's own wording, it has "one input, logically inverting every bit," meaning it only ever takes a single source register (SR) and never has a second operand at all. There is no register-vs-immediate CHOICE to be made for a second operand, because there is no second operand in the first place. A mode bit exists specifically to disambiguate between two possible interpretations of the remaining bits -- and NOT never has two possible interpretations to disambiguate between. WHAT OCCUPIES THOSE BIT POSITIONS INSTEAD ------------------------------ Per the chapter's own NOT bitfield diagram, the six bit positions that a mode bit plus a second operand (SR2 or imm5) would otherwise use are simply fixed to 111111 by the LC-3 specification -- a constant pattern, not meaningful data. Those bits aren't "unused" in the sense of being ignored; the specification defines them as always being 1s for a valid NOT instruction, occupying the same physical space in the encoding without carrying any operand information. WHY THIS WORKS AS AN ANSWER ------------------------------ It explains the actual REASON a mode bit exists (disambiguating between two possible forms of a second operand), shows why that reason doesn't apply to NOT (no second operand exists at all), and correctly identifies what fills the equivalent bit positions in NOT's own encoding (a fixed 111111 pattern) rather than just saying "nothing is there."