lainchan / Δ
I want to learn about how a CPU works
Otto Normalverbraucher · 2023-07-06 11:34
Can somebody please recommend me some good resources on how a CPU/computer actually works? I have no problem with dishing out a couple hundred dollars for a book or a course as long as it's good.
Elliot Alderson · 2023-07-06 11:59
>>10565
Johnathan Bartlett's Programming From The Ground Up has some beginner friendly info on how CPUs work in relation to low level assembly language programming.
The Phantom Phreak · 2023-07-06 13:16
work through nand2tetris
>>10565
>Programming From The Ground Up
also this!
Enchanter · 2023-07-06 13:30
That's a very deep topic, so it depends how deep do you want go venture.
You can start with high-level concepts like von Neumann and Harvard architectures.
Then you could familiarize yourself with the designs of 8- and 16bit CPUs like 6502, Z80, 8086, And early 32bit stuff like 68000 80386, Pentium.
All of those have a lot of resources online easily available. All of these will include block diagrams of major parts of the CPU and how they interact with each other. Like Arithmetic Logical Units, Control Units, Register Files, Buses between them. You can also check out RISC stuff for concepts like pipelining and hazards with them.
If you want to go more low-level, you can look up how those parts work. Like ALUs, barrel shifters, branch predictors, caches, decoding and instruction scheduling.
Even deeper there's much to learn about physics of it and of the lithography itself.
Sorry I don't have anything specific to give, perhaps if you'd expand on what level you want to focus on and what you already know?
P.S. this is my first post here after lurking for some time, so do tell me if I did something wrong.
Zhora · 2023-07-08 20:35
It's a rabbit hole, if you want to go from the ground up get a solid foundation in electricity, then electronics, transistors, FETs, simple ICs and so on, opcodes and assembler will start appearing as you go.
Most people go the opposite way which usually goes like python or something => shellcode => C => ASM flavor of your choice.
Sipho Nkosi · 2023-07-09 11:38
This is the most easy to grok book for understanding how computers work.
https://www.amazon.com/Digital-Computer-Electronics-Albert-Malvino/dp/0028005945
Just another Random Lainon · 2023-07-09 13:08
>>10565
What >>10570 said is the way to go but it can be pretty overwhelming.
For me learning boolean algebra first and then expanding to flipflops, registers and so on was good a way to learn.
Also dont underestimate the basics like conversion from hex to binary and so on you will need that quite often.
Hagbard Celine · 2023-07-14 16:56
This series was most enlightening to be honest https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU
Koos van der Merwe · 2023-07-19 01:37
>>10565
H&H Digital Design an Computer Architecture.
This book teach how processors(cpu in your computer) work from boolean algebra and transistors to microarchitecture and memory management. Easy to read, simple examples. Good book for newbies in this topic.
Available free, find it yourself on the net, lainon.
If lainon want to learn how computers, not processors work, ask other lainons.
Chani · 2023-08-17 11:29
>>10570
This is basically a good way to go. I would start with how binary numbers work, what two's complement is and then how to use and build an ALU.
Hitomi · 2023-08-21 10:41
Try doing Nand2Tetris, or find some vids about the 6502 or other simple 8 bit CPUs. That will help you understand.
Mentat · 2023-08-21 11:45
>>10565
I recall that CODE by Charles Petzold was a decent read.
>>10570
I suppose the von Neumann machine is a high-level concept, but no one should stop there, or believe it to be the only way. There exist better machine designs such as systolic array or data-flow machines and, to a lesser extent, vector machines, which can do more than one thing at a time or without being dependent on a large memory at all times.
>branch predictors, caches
It's irresponsible to learn of these things without also learning that they are used as crutches for the von Neumann machine design.
The Oracle · 2023-08-22 23:21
idk if this is good but here you go
Special Agent Bob · 2023-08-23 10:30
>>10708
Petzold book is excellent, i was ahead of the curve by the time I took my digital logic class because of it
Junichi Fujiwara · 2023-09-11 14:03
>>10565
When I was younger, I used to make calculators in Minecraft using redstone (it was basically an ALU). You could try making a CPU from scratch in minecraft, but that would take a particular brand of autism. Perhaps something like an LC-3 CPU would be simple enough to do.
Hiro Protagonist · 2023-09-12 00:36
Hard subject, long topic. If you're in uni, take a digital systems/design course. If you're not, follow along with this book and the attached lab doc. I'd recommend installing Intel's Quartus, which is probably your best bet at a free design suite, despite being a menace to work with. Good luck lainon, you have many trials and tribulations ahead of you.
Nobody · 2023-09-12 05:39
Same as well. I'm currently reading: The elements of computing systems. It shows how to build a computer from the ground up, starting from the most fundamental logic gate, Nand(Nor is also a fundamental gate but Nand is used more IRL). At the end you will have built a simple computer, with a simple OS to go with it. the price was around £31 for me. It has exercises as well so you can implement the knowledge that you have learnt. You learn how to make not only a CPU, but memory devices as well. Also another way to learn about CPU's is to get a digital design book:
https://www.amazon.co.uk/Digital-Design-Computer-Architecture-ARM/dp/0128000562
This one teaches basics, and then uses that knowledge to design ARM CPUs.
Hiro Protagonist · 2023-09-12 07:44
>>10868
good book, i'll have to check out the elements of computing systems, sounds fun + OS stuff is always a plus.
Aristóteles Amadópulus · 2023-09-12 14:32
ekeke no one took the class?
https://ocw.mit.edu/courses/6-828-operating-system-engineering-fall-2012/
Nobody · 2023-09-13 08:34
>>10870
Also, they have a website to go along with the book (https://www.nand2tetris.org/)
I'm currently on chapter 3
Yu-ichi · 2023-09-13 15:45
cpu.land
this is a good resource too
Mario Rossi · 2024-07-14 06:47
nandgame.com
yes probably its not you search but its a good hard logic game can help you how a computer works
and the riscv.org exitst and can you make a free isa and learn how works computer
theres logisim or logisim evolution for making electronics projects
I have no experience, but I hope it has helped you
Hagbard Celine · 2024-07-14 09:24
How to Build a Working Digital Computer 1968 Alcosser,Phillips,Wolk
You build everything from scratch, no ICs, etc. Despite being outdated, this book provides a clear understanding of hpw computers work at the most fundamental level.
https://download.library.lol/main/111000/393a5af87053a49f22f44ad6a3a43ce6/Edward%20Alcosser%2C%20etc.%20-%20How%20to%20Build%20a%20Working%20Digital%20Computer-Sams%20%281973%29.pdf