How CPUs Work
- 35Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is the role of a CPU in a device?
It acts as the brain of the device, processing instructions and performing calculations.
Or swipe the card
35 cards
What is the role of a CPU in a device?
It acts as the brain of the device, processing instructions and performing calculations.
How many transistors and calculations per second did the 6502 chip have?
4528 transistors, performing about 430,000 calculations per second.
How many transistors and calculations per second does the M1 chip have?
16 billion transistors, performing about 3 trillion calculations per second.
What is the 'technological DNA' common to all processors?
The architectural design and basic operational principle, specifically the Fetch-Decode-Execute cycle.
In the CPU analogy, what do the bookshelves, cart, table, open book, paper, and pencil represent?
Bookshelves = SSD (long-term storage), cart = DRAM (working memory), table = CPU, open book = cache, paper = registers, pencil = ALU.
What operations can the ALU perform?
Add, subtract, multiply, increment, decrement, bit shifts, logical AND, OR, XOR, and comparisons.
What is a bit shift in binary equivalent to?
Multiplying by 2 (shifting left) or dividing by 2 (shifting right).
What is the accumulator?
The display/output of the ALU that holds the result of an operation.
What are registers and what is the Program Counter?
Registers are small, fast storage locations inside the CPU. The Program Counter (PC) keeps track of the address of the next instruction to execute.
What are the three common instruction types and their functions?
Load (copy data from memory to a register), Store (copy register data to memory), Increment (add 1 to a register value).
How do jump and conditional branch instructions work?
Jump sets the Program Counter to a specific address unconditionally. Conditional branch changes the PC only if a condition (e.g., equality) is met.
How many instructions did the 6502 and M1 chips have?
The 6502 had 56 instructions; the M1 (ArmV8.4) has 354 instructions.
What are the three steps of the Fetch-Decode-Execute cycle?
Fetch: retrieve instruction from memory using PC and increment PC. Decode: interpret instruction and generate control signals. Execute: carry out the operation.
What is the role of the instruction decoder?
It interprets the binary instruction and produces control signals to execute it.
What is pipelining in modern CPUs?
Multiple instructions are queued so that fetch, decode, and execute steps overlap for different instructions.
What are the Memory and Writeback steps?
Memory step moves data between CPU and main memory (DRAM/cache). Writeback saves results back to memory or registers.
How does the clock regulate the Fetch-Decode-Execute cycle?
Each step takes one or more clock cycles. The clock speed determines the pace (e.g., 1 MHz for 6502, 3.2 GHz for M1).
What is the memory hierarchy from slowest to fastest?
SSD (long-term) -> DRAM (short-term) -> Cache (on CPU) -> Registers (inside CPU).
Why did the 6502 not have cache memory?
Because DRAM in the 1980s was as fast as the CPU instructions, making cache unnecessary.
What does RISC stand for and what are its characteristics?
Reduced Instruction Set Computer: simple instructions, fixed length, executed in one clock cycle, energy efficient.
What does CISC stand for and what are its characteristics?
Complex Instruction Set Computer: many complex instructions, variable execution cycles, more complicated decoder.
Which architecture does the M1 use and how many instructions?
RISC (ArmV8.4) with 354 instructions.
How does a compiler relate high-level code to machine code?
It translates source code (e.g., C++) into assembly or machine code instructions specific to the CPU architecture.
What is an ASIC and how does it differ from a CPU?
Application-Specific Integrated Circuit: designed for a specific task, no fetch-decode steps, highly optimized but inflexible.
What is an FPGA and where is it used?
Field-Programmable Gate Array: reconfigurable logic, no fetch-decode cycle, used in automotive and cameras.
What is a System on a Chip (SoC)?
An integrated circuit that includes CPU, GPU, memory, and other components on a single die.
What features does a modern CPU core have beyond basic fetch-decode-execute?
Pipelining, branch predictor, separate data/instruction caches, multiple ALU units, many general-purpose registers.
How does a GPU differ from a CPU in architecture?
Thousands of simple cores (similar to 6502) performing SIMT (Single Instruction Multiple Thread) calculations.
What is the difference in bit-width between 6502 and M1?
6502 is 8-bit; M1 is 64-bit.
What are the three main parts inside a CPU package?
Protective heat spreader, interposer with connections, and the integrated circuit (die).
What is the role of the control unit in the CPU analogy?
It fetches instructions, moves data between components, and controls the calculator (ALU).
What does the Current Instruction Register (CIR) hold?
The instruction that is currently being decoded or executed.
What does the Memory Address Register (MAR) store?
The address of a memory location to be read or written.
What are comparison flags in the ALU?
Output flags that indicate whether two numbers are equal, less than, or greater than.
How many instructions did the Snake game example compile to for RISC vs CISC?
676 RISC instructions (ARM) vs 560 CISC instructions (x86-64).

Ask anything
We've read this whole study set, so questions about it get the best answers.