Base CS from zero
The processor: multiple-choice review
Six questions that cut across the whole unit. None is a definition to recite — each makes you connect the instruction, the loop, the registers, and the bytes in memory into one working machine.
Confirm you can connect the pieces the lessons built separately: an instruction is an operation plus operands, the CPU runs them in the fetch-decode-execute loop driven by the program counter, registers hold the working values, and the whole program is just machine-code bytes in memory.
A program adds one million numbers in a loop. Why does the CPU keep the running total in a register instead of in main memory?
The CPU just finished executing a normal ADD instruction (not a jump). What happens to the program counter, and why?
A junior says: 'My code is written in Python, so the CPU runs Python directly.' What is wrong with this?
During the Decode step of the cycle, which part of the CPU does the work, and what is it producing?
Two memory cells at addresses 100 and 101 hold the bytes that encode an instruction. The same byte values also appear at addresses 200 and 201, where the program stores data. What makes one pair an instruction and the other pair data?
A program compiled for an Apple Silicon (ARM) Mac will not run as-is on an Intel (x86-64) laptop, even though both are 64-bit CPUs. Why?
The through-line of the unit is one machine. An instruction is an operation plus its operands; the CPU runs instructions in the fetch-decode-execute loop, with the program counter naming the next one and advancing by the instruction’s size unless a jump overrides it. Registers hold the working values at CPU speed because RAM is 100-300x slower. Decode is the control unit turning an opcode into control signals. And the whole program is just machine-code bytes in shared memory — instructions only because the program counter walks through them. The instruction set is the contract that decides which chip can run which bytes.