1. Home
  2. Explore
  3. Computer Science
  4. How CPUs Work

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

How CPUs Work

  • 29Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: CPU Fundamentals

What is a CPU and what is it built from?

29 questions

  1. 1

    What is a CPU and what is it built from?

    Model answer

    A CPU (Central Processing Unit) is the brain of a computer, built from billions of nanoscopic transistors connected by layers of wires.

    Explanation

    The CPU executes instructions. Modern CPUs contain billions of transistors (e.g., M1 has 16 billion).

  2. 2

    Compare the number of transistors and calculations per second of the Apple 2e's 6502 processor and the MacBook Pro's M1 processor.

    Model answer

    The 6502 has 4,528 transistors and ~430,000 calculations/second; the M1 has 16 billion transistors and ~3 trillion calculations/second.

    Explanation

    This shows the massive increase in complexity and performance over 45 years.

  3. 3

    What is the 'technological DNA' shared by all processors mentioned in the video?

    Model answer

    The shared technological DNA is the Fetch-Decode-Execute cycle, not transistors or logic gates.

    Explanation

    All processors, from the 6502 to modern M1, operate using the same fundamental cycle.

  4. 4

    List the components of the CPU analogy and their real hardware counterparts.

    Model answer

    Bookshelves = SSD (long-term storage); cart = DRAM (working memory); table = CPU; open book = cache memory; paper = registers; pencil = read/write ability; calculator = ALU; robot = control unit.

    Explanation

    The analogy illustrates how data moves between storage, memory, and the CPU during processing.

  5. 5

    What is the accumulator in the ALU?

    Model answer

    The accumulator is the ALU's display that outputs the result of a calculation.

    Explanation

    It holds the result temporarily, similar to a calculator display.

  6. 6

    What are the two types of pages in a program (book) and what do they represent?

    Model answer

    Instructions (the recipe steps) and data (addresses and values). Instructions tell the CPU what to do; data provides the values to operate on.

    Explanation

    Programs consist of machine code instructions and data that the CPU processes.

  7. 7

    What does a 'load' instruction do?

    Model answer

    It copies a value from a specific memory address into a general-purpose register.

    Explanation

    Load is a common instruction that brings data into the CPU for processing.

  8. 8

    What does a 'store' instruction do?

    Model answer

    It saves the value from the accumulator (or a register) back into a memory address.

    Explanation

    Store writes results back to memory.

  9. 9

    What is the Program Counter (PC) and how is it used?

    Model answer

    The Program Counter (also called Instruction Address Register or Instruction Pointer) keeps track of the next instruction to execute. It is incremented after each fetch, and can be modified by jump or branch instructions.

    Explanation

    The PC controls the sequential flow of execution.

  10. 10

    How does a conditional branch instruction work?

    Model answer

    A conditional branch checks flags (e.g., equal, greater than) from a comparison and sets the Program Counter to a new address if the condition is true, enabling loops and IF statements.

    Explanation

    This allows decision-making in programs.

  11. 11

    Name the three steps of the Fetch-Decode-Execute cycle.

    Model answer

    Fetch, Decode, and Execute.

    Explanation

    Every instruction goes through these three steps in order.

  12. 12

    What happens during the Fetch step?

    Model answer

    The controller uses the Program Counter to fetch the instruction from memory, copies it into the Current Instruction Register (CIR), and increments the PC.

    Explanation

    Fetch retrieves the next instruction.

  13. 13

    What is the role of the instruction decoder?

    Model answer

    It interprets the binary instruction in the CIR and generates the appropriate control signals to execute that instruction.

    Explanation

    The decoder is a complex logic circuit that translates machine code into actions.

  14. 14

    What happens during the Execute step for an ADD instruction?

    Model answer

    Control signals route values from registers to the ALU, the ALU adds them, and a timing signal saves the result into the accumulator.

    Explanation

    The ALU performs the operation and stores the result.

  15. 15

    What regulates the pace of the Fetch-Decode-Execute cycle?

    Model answer

    The computer's clock.

    Explanation

    Each step takes one or more clock cycles, determined by the clock speed.

  16. 16

    What is the clock speed of the 6502 processor and the M1 chip?

    Model answer

    The 6502 had a 1 MHz clock (1 million ticks/second); the M1 has a 3.2 GHz clock (3.2 billion ticks/second).

    Explanation

    Higher clock speed means more instructions per second.

  17. 17

    What does it mean for a processor to be 8-bit or 64-bit?

    Model answer

    It refers to the width of the registers and the ALU's input/output, determining the size of numbers the CPU can handle natively.

    Explanation

    The 6502 is 8-bit; the M1 is 64-bit, allowing larger numbers and more memory addressing.

  18. 18

    What is pipelining?

    Model answer

    Pipelining queues multiple instructions so that fetch, decode, and execute stages overlap for different instructions, improving throughput.

    Explanation

    Modern CPUs like the M1 use pipelining to process more than one instruction per clock cycle.

  19. 19

    What are the three levels of memory hierarchy mentioned in the analogy?

    Model answer

    SSD (bookshelves) for long-term storage, DRAM (cart) for working memory, and cache (table/open book) for temporary, fast access within the CPU.

    Explanation

    Data moves from slower/larger storage to faster/smaller memory as needed.

  20. 20

    What are the two additional steps sometimes included in the instruction cycle, and what do they do?

    Model answer

    Memory and Writeback. Memory moves data between cache, DRAM, and SSD; Writeback writes data back to memory.

    Explanation

    These steps handle data transfers that are slower than the fetch-decode-execute steps.

  21. 21

    What does RISC stand for and what is a key characteristic?

    Model answer

    Reduced Instruction Set Computer. It has a small, simple set of instructions that execute at a consistently fast rate, often in one clock cycle.

    Explanation

    RISC architectures like ARM v8.4 are energy-efficient, used in smartphones.

  22. 22

    What does CISC stand for and what is a key characteristic?

    Model answer

    Complex Instruction Set Computer. It has a large set of instructions, many of which are complex and may take multiple clock cycles, with a more complicated decoder.

    Explanation

    CISC architectures like x86 are used in Intel/AMD processors.

  23. 23

    How do the instruction counts compare between the 6502 and the M1?

    Model answer

    The 6502 has 56 instructions; the M1 has 354 instructions (ArmV8.4).

    Explanation

    Modern processors have more instructions but still relatively simple ones.

  24. 24

    What is the purpose of a compiler in relation to CPU instructions?

    Model answer

    A compiler translates high-level code (e.g., C++) into machine code instructions (assembly) specific to the CPU's instruction set.

    Explanation

    It converts human-readable programs into binary instructions the CPU can execute.

  25. 25

    What is a System on a Chip (SoC)?

    Model answer

    An SoC integrates multiple processors (CPU cores, GPU, neural engine) and other components onto a single chip, as in the M1.

    Explanation

    Modern chips like the M1 are closer to SoCs than traditional CPUs.

  26. 26

    How does a GPU's architecture differ from a CPU, according to the video?

    Model answer

    A GPU contains thousands of simpler cores (CUDA cores) and uses SIMT (Single Instruction Multiple Thread) processing: one instruction is fetched and decoded, then executed on many cores with different data.

    Explanation

    GPUs are optimized for parallel tasks like graphics rendering.

  27. 27

    What are ASICs and FPGAs, and how do they differ from CPUs?

    Model answer

    ASICs (Application Specific Integrated Circuits) are custom chips for a specific task (e.g., Bitcoin mining); FPGAs (Field Programmable Gate Arrays) can be reconfigured. Neither uses the fetch-decode-execute cycle; they flow data through fixed logic gates.

    Explanation

    These are inflexible but highly optimized for specific workloads.

  28. 28

    What enhancement does the M1's performance core have to handle conditional branching efficiently?

    Model answer

    A branch predictor that reduces pipeline stalls caused by conditional branches.

    Explanation

    Branch prediction helps keep the pipeline full.

  29. 29

    In the M1 core, how many general-purpose registers are available?

    Model answer

    32 general-purpose registers.

    Explanation

    More registers than the 6502's few registers, enabling more efficient processing.

1 of 29
Question 1 of 29

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent