CrashCourse · @crashcourse
The Central Processing Unit (CPU): Crash Course Computer Science #7
Uploaded June 8, 2017 · Length 11:38
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.
- 0:03
Hi, I’m Carrie Anne, this is Crash Course Computer Science, and today, we’re talking about processors.
- 0:07
Just a warning though - this is probably the most complicated episode in the series.
- 0:11
So once you get this, you’re golden.
- 0:12
We’ve already made a Arithmetic and Logic Unit, which takes in binary numbers and performs
- 0:16
calculations, and we’ve made two types of computer memory: Registers -- small, linear
- 0:21
chunks of memory, useful for storing a single value -- and then we scaled up, and made some
- 0:25
RAM, a larger bank of memory that can store a lot of numbers located at different addresses.
- 0:30
Now it’s time to put it all together and build ourselves the heart of any computer,
- 0:34
but without any of the emotional baggage that comes with human hearts.
- 0:37
For computers, this is the Central Processing Unit, most commonly called the CPU.
- 0:42
INTRO
- 0:51
A CPU’s job is to execute programs.
- 0:53
Programs, like Microsoft Office, Safari, or your beloved copy of Half Life: 2, are made
- 0:57
up of a series of individual operations, called instructions, because they “instruct”
- 1:02
the computer what to do.
- 1:03
If these are mathematical instructions, like add or subtract, the CPU will configure its
- 1:07
ALU to do the mathematical operation.
- 1:10
Or it might be a memory instruction, in which case the CPU will talk with memory
- 1:14
to read and write values.
- 1:15
There are a lot of parts in a CPU, so we’re going to lay it out piece by piece, building
- 1:19
up as we go.
- 1:20
We’ll focus on functional blocks, rather than showing every single wire.
- 1:23
When we do connect two components with a line, this is an abstraction for all of the necessary wires.
- 1:28
This high level view is called the microarchitecture.
- 1:30
OK, first, we’re going to need some memory.
- 1:32
Lets drop in the RAM module we created last episode.
- 1:35
To keep things simple, we’ll assume it only has 16 memory locations, each containing 8 bits.
- 1:40
Let’s also give our processor four, 8-bit memory registers, labeled A, B, C and D which
- 1:45
will be used to temporarily store and manipulate values.
- 1:48
We already know that data can be stored in memory as binary values
- 1:51
and programs can be stored in memory too.
- 1:52
We can assign an ID to each instruction supported by our CPU.
- 1:56
In our hypothetical example, we use the first four bits to store the “operation code”,


