CrashCourse · @crashcourse

The Central Processing Unit (CPU): Crash Course Computer Science #7

Uploaded June 8, 2017 · Length 11:38

The Central Processing Unit (CPU): Crash Course Computer Science #7

Summary

This video explains the Central Processing Unit (CPU), its components like registers, ALU, and control unit, and how it executes instructions through fetch, decode, and execute cycles.

  • cpu explained
  • computer processor
  • fetch decode execute
  • cpu architecture
  • how cpus work

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:03

    Hi, I’m Carrie Anne, this is Crash Course Computer Science, and today, we’re talking about processors.

  2. 0:07

    Just a warning though - this is probably the most complicated episode in the series.

  3. 0:11

    So once you get this, you’re golden.

  4. 0:12

    We’ve already made a Arithmetic and Logic Unit, which takes in binary numbers and performs

  5. 0:16

    calculations, and we’ve made two types of computer memory: Registers -- small, linear

  6. 0:21

    chunks of memory, useful for storing a single value -- and then we scaled up, and made some

  7. 0:25

    RAM, a larger bank of memory that can store a lot of numbers located at different addresses.

  8. 0:30

    Now it’s time to put it all together and build ourselves the heart of any computer,

  9. 0:34

    but without any of the emotional baggage that comes with human hearts.

  10. 0:37

    For computers, this is the Central Processing Unit, most commonly called the CPU.

  11. 0:42

    INTRO

  12. 0:51

    A CPU’s job is to execute programs.

  13. 0:53

    Programs, like Microsoft Office, Safari, or your beloved copy of Half Life: 2, are made

  14. 0:57

    up of a series of individual operations, called instructions, because they “instruct”

  15. 1:02

    the computer what to do.

  16. 1:03

    If these are mathematical instructions, like add or subtract, the CPU will configure its

  17. 1:07

    ALU to do the mathematical operation.

  18. 1:10

    Or it might be a memory instruction, in which case the CPU will talk with memory

  19. 1:14

    to read and write values.

  20. 1:15

    There are a lot of parts in a CPU, so we’re going to lay it out piece by piece, building

  21. 1:19

    up as we go.

  22. 1:20

    We’ll focus on functional blocks, rather than showing every single wire.

  23. 1:23

    When we do connect two components with a line, this is an abstraction for all of the necessary wires.

  24. 1:28

    This high level view is called the microarchitecture.

  25. 1:30

    OK, first, we’re going to need some memory.

  26. 1:32

    Lets drop in the RAM module we created last episode.

  27. 1:35

    To keep things simple, we’ll assume it only has 16 memory locations, each containing 8 bits.

  28. 1:40

    Let’s also give our processor four, 8-bit memory registers, labeled A, B, C and D which

  29. 1:45

    will be used to temporarily store and manipulate values.

  30. 1:48

    We already know that data can be stored in memory as binary values

  31. 1:51

    and programs can be stored in memory too.

  32. 1:52

    We can assign an ID to each instruction supported by our CPU.

  33. 1:56

    In our hypothetical example, we use the first four bits to store the “operation code”,