How Computers Work
Where did computers come from?
See Turing Machines
Overview
Let’s breakdown how a computer actually works when running and compiling a program. I want to learn all the levels of abstraction that are involved in running a single computer operation.
Similar to the OSI model concept for networking applications. What’s a similar thought model for the CPU?
Software | Software | Application |
Algorithm | ||
Programming Language | ||
Assembly | ||
Machine Code | ||
ISA (Instruction Set Architecture) | ||
Hardware | Digital | Micro Architecture |
Gates/Registers | ||
Analog | Devices (Transistors) | |
Physics |
ISA (Instruction Set Architectures)
Is ISA the same as Assembly?
No, Assembly is a higher level abstraction on top of the ISA. The ISA defines what operations are avialable on the hardware. Assembly operations will be converted to compatible ISA operations for the given architecture.
Is there a compiler for mapping assembly to valid ISA instructions?
Yes, this is known as the assembler.
Machine Code/Microcode/Architecture
What’s the difference between machine code and microcode?
Fetch Decode Exec Write Cycle
Physical Transistor Switching
Transistors (specifically MOSFETS?) are wired together to create small circuits or gates. As an example you can create an AND gate and now that’s your next level of abstraction.
Resources
- http://visual6502.org
- https://electronics.stackexchange.com/questions/465530/what-is-the-process-of-going-from-machine-code-to-electrically-controlling-indiv
- https://www.techspot.com/article/1821-how-cpus-are-designed-and-built/
- No Starch - Introduction to Computer Organization - (2022) https://learning.oreilly.com/library/view/introduction-to-computer/9781098130183/
- Youtube: Intel: Architecture All Access Series: https://www.youtube.com/watch?v=vgPFzblBh7w This is an EXCELLENT 2 part series that explains the abstraction levels in a CPU.
- How Computers Work - Sebastian Lague - https://www.youtube.com/playlist?list=PLFt_AvWsXl0dPhqVsKt1Ni_46ARyiCGSq
- https://www.nand2tetris.org/
- https://bjc.edc.org/bjc-r/cur/programming/6-computers/1-abstraction/01-abstraction.html?topic=nyc_bjc%2F6-how-computers-work.topic&course=bjc4nyc.html&novideo&noassignment
- From Transistors to Functions - https://www.cs.bu.edu/~best/courses/modules/Transistors2Gates/