How a CPU Works

preview_player
Показать описание
Learn how the most important component in your device works, right here!

(As of 2024-01-15, all videos on this channel are under the CC0 license (very similar to Public Domain). Feel free to download and repost without compensation, attribution, or notice.)

The CPU design used in the video is copyrighted by John Scott, author of the book But How Do It Know?.

There are a few small differences between the CPU in the video and the one used in the book. Those differences are listed below but they should not detract from your understanding of either.

CONTROL UNIT - This component is called the Control Section in the book. It is called Control Unit here simply because that is a more common name for it that you might see used elsewhere.

LOAD INSTRUCTION - In this video, what's called a LOAD instruction is actually called a DATA instruction in the book. The Scott CPU uses two different instructions to move data from RAM into the CPU. One loads the very next piece of data (called a DATA instruction in the book) and the other uses another register to tell it which address to pull that data from (called a LOAD instruction in the book). The instruction was renamed in the video for two reasons: 1) It might be confusing to hear that the first type of data we encounter in RAM is itself also called DATA. 2) Since the LOAD instruction from the book is a more complex concept, it was easier to use the DATA instruction in the video to introduce the concept of moving data from RAM to the CPU .

IN and OUT INSTRUCTIONS - In the Scott CPU, there is more involved in moving data between the CPU and external devices than just an IN or an OUT instruction. That process was simplified in the video to make the introduction of the concept easier.

ACCUMULATOR - The register that holds the output of the ALU is called the Accumulator in the book. That is the name typically used for this register, although it was simply called a register in the video.

MEMORY ADDRESS REGISTER - The Memory Address Register is a part of RAM in the book, but it is a part of the CPU in the video. It was placed in the CPU in the video as this is generally where this register resides in real CPUs.

JUMP INSTRUCTIONS - In the book there are two types of unconditional JUMP instructions. One jumps to the address stored at the next address in RAM (this is the one used in the video) and the other jumps to an address that has already been stored in a register. These are called JMP and JMPR instructions in the book respectively.

MISSING COMPONENT - There is an additional component missing from the CPU in the video that is used to add 1 to the number stored in a register. This component is called "bus 1" in the book and it simply overrides the temporary register and sends the number 1 to the ALU as input B instead.

REVERSED COMPONENTS - The Instruction Register and the Instruction Address Register are in opposite positions in the diagrams used in the book. They are reversed in the video because the internal wiring of the control unit will be introduced in a subsequent video and keeping these registers in their original positions made that design process more difficult.

OP CODE WIRING - The wires used by the control unit to tell the ALU what type of operation to perform appear near the bottom of the ALU in the video, but near the top of the ALU in the book. They were reversed for a similar reason as the one listed above. The wiring of the ALU will be introduced in a subsequent video and keeping these wires at the top of the ALU made the design process more difficult.
Рекомендации по теме
Комментарии
Автор

Thanks! I still don't understand it, but now I know what exactly I don't understand

yenchey
Автор

A 20 minute video explained a semester worth of lectures perfectly. Please be my professor

JousterMoha
Автор

We should award noble prizes to those who come up with a CPU design... they were true masterminds!

ruigomes
Автор

I'm a software engineer with several years experience. I've always had a vague idea of what these components do, but I've never been able to wrap my head around how they do it. Your explanation was so eloquent yet concise that these concepts that have always escaped me suddenly clicked and made perfect sense. Great video!

jeffh
Автор

My little brother once asked me how does a computer work. So I showed him this video. He never asked me anymore.

pumbo_nv
Автор

Think about this, your CPU is actually doing all the things described in this video, as you are watching the video, and reading this comment.

BangMaster
Автор

So... basically we tricked rocks into thinking? got it

grantj
Автор

50 years ago I was writing assembler language programs using all the move (MVC), branch and load instructions necessary to create a program. This video sure would have been helpful to me for understanding how the hardware responded to my wishes. It was a bonus to see the scripture at the end - what a wonderful surprise! Blessings to you!

mrCetus
Автор

All this so I can throw turtles into the ocean in Crysis.

mcgibs
Автор

I was so fascinated by this explanation. It just had dozens of little lights turning on in my head. Really really helpful! Thank you so much!

Thandidladla
Автор

8 years ago an awesome guy made this masterpiece and disappeared
where are you man? the world needs more of this.

niceguy
Автор

After reading the book, I rewatched this video, and finally, I understood the whole process. It's mindblowing!

andreranulfo-dev
Автор

it's truly amazing how some guys spent hours scratching their heads coming up with this stuff.

Jeebuus
Автор

Right off the get go my mind froze. When he made the statement about the clock turning on and off two times per second on the 6502 chip, I was okay. Then when he said that modern CPU's turn off and on billions of times per second...that is when I lost it. I cannot envision a second divided into a billion parts. That fact in and of itself is damn near magic to me. Oh, I can understand it at an academic level. A chip running at 5 Ghz is 5 billion times per second. Okay, moving on...It's the visualization of that process that really ties up my noodle in knots. Almost magic to me!

charliefoxtrottherd
Автор

I love how you explained this. It makes perfect sense. I had no idea that the processor processes one instruction at a time at that rate of speed.

cameron
Автор

This is so fascinating and complex, we take this for granted so often. Excellent video!

commanderbly
Автор

This video made it very clear to me from a distant observing point. I studied electrical engineering and I was introduced to digital systems, transistors, logic gates, registers, etc .. also I have a programming background but I couldn't fit all of these information in a proper way that allows me to understand how a CPU might work. Now I can say I could make it to the first 1% of computer engineering and I'm depressed.. note that the video talked about building blocks like (ALU, CONTROL UNIT etc) there is more hell inside!

mostafakhadr
Автор

The most comprehensive and exciting 20 minutes to learn such a great technology.
Thank you 😊

edwinjoy
Автор

My computer architecture teacher should show this presentation in class. We student literally don't have any idea what's going on inside it. I always thought it's beyond my comprehension to understand how CPU works only scientists can exactly know. That person should be called talent who explain better than other. You are one of them 👌

RoohaAli
Автор

"I think I have some idea of how this works, but I want to know more." 20 minutes later, "Holy crap it's witchcraft."

andytheobliviator