How a CPU Works
Why Stack Overflow recommends it
Stack Overflow users link it when beginners ask how hardware actually executes instructions, computes arithmetic, or how assembly maps to binary.
Recommended by 3 people across 3 different months, 2013 to 2016.
What it is
A 20-minute animated explainer from the In One Lesson channel that walks through how a simple CPU works, building up from basic components like registers, the ALU, RAM and the control unit. It is based on the CPU design in John Scott's book But How Do It Know?.
What people said
Recommends hexicle · 2013-06 · Stack Overflow · on “How is the modulo operator (%) actually computed?”
@pNok You seem to be wondering about how a modulo is actually computed in the level of hardware. That short answer is that it's complicated. The long answer is that you need to learn about abstraction layers. [LINK] . For a friendly introduction, watch 'How the CPU Works' [this video]
Recommends Justin Workman · 2014-08 · Stack Overflow · on “General questions about and to better understand programming”
I would first start with a good Youtube video that I saw the other day about how to build your own CPU. Its a very basic CPU that doesn't have much processing power but it gives you a good idea of how the CPU in a computer operates. [this video] Then with that knowledge I would learn assembly (Opcodes) to see how the CPU computes & moves ones and zeros around the bus system. [LINK] After you learn assembly you can start to see the bigger picture of how a language compiler works such as (gcc & g++). Basically an OS (such as Linux) uses 99% C as it's primary language. Linux is a very complex system made up of many different server processes. Terminal is the name Mac OS uses and Bash is the name tha
Recommends Harshit Panchal · 2016-06 · Stack Overflow · on “How do assembly languages work?”
first thing every instruction like mov ,add etc have its own meaning in binary form like 10101010, 00110000, 10100 some of these also be, which cpu always understands. but human cant remember all of them. so... for programming purpose that used in english language. which will ultimately come to its own place(binary). second thing conversion from english(mov, add etc.) to binary occurs at, when assembling or compiling those codes. after that- binary instructions(instruction sets) stored or loaded into ram and ready for execution. but it may be not your answer i know. if you want know and imagine perfectly- how does cpu exucute instructions and work on them. You can learn it with graphics here
Cites eagertoLearn · 2014-01 · Stack Overflow · on “How does an Arithmetic Logic Unit do comparisons?”
I am taking a course of system tools and architecture in my University and the first class is about how CPU and RAM talks and how CPU process the data. As explained by the Prof, CPU has an ALU (Arithmetic Logic unit) [LINK] which performs arithmetic such as additions and comparisons. But he did not explain how it does it. I did some searching and found this link [LINK] which directs to a youtube video that explains how addition is performed - well explained for beginners. Even this link [this video] explains that CPU directs arithmetic processing to ALU but does not deal with how ALU performs it. My question is about how an ALU does comparison . As humans, we know 5 is less than 7. But how does a