r/computerscience • u/Lopsided_Regular233 • Dec 23 '25
General what happens behind the scene of Computer ?
Hi everyone,
I would like to understand how data is read from and written to RAM, ROM, and secondary memory, and who write or read that data, and how data travels between these stages. I am also interested in learning what fetching, decoding, and executing really mean and how they work in practice.
I want to understand how software and hardware work together to execute instructions correctly what an instruction actually means to the CPU or computer, and how everything related to memory functions as a whole.
If anyone can recommend a good book or a video playlist on this topic, I would be very thankful.
8
u/P-Jean Dec 23 '25
Operating systems fundamentals is a good book. It has a dinosaur on it
6
u/ron_young Dec 23 '25
Take a look at the nand2tetris book and related materials...
https://www.nand2tetris.org/
4
u/Yoghurt42 Dec 23 '25
Ben Eater's Building an 8-bit breadboard computer is a great series that tackles most of the stuff you mentioned.
15
u/wolfakix Dec 23 '25
Learn more about Computer Architecture and Operating Systems. Pick some book or course and have fun
If you want to go deeper you can also watch nand2tetris, iirc it shows everything from logic gates to the higher level, i just dont remember where it stops.
2
u/CadenVanV Dec 23 '25
CS:APP is a good textbook for it, and if you just look up “CS:APP” one of the top results will be a pdf.
2
u/MasterGeekMX Bachelors in CS Dec 23 '25
An excellent option is these series of videos by the YT channel Core Dumped, where he covers the basics of computer architecrure
https://youtube.com/playlist?list=PL9vTTBa7QaQOoMfpP3ztvgyQkPWDPfJez&si=xXyeFGdbNCJBoN0m
4
u/Big-Lawyer-3444 Dec 23 '25
Code by Charles Petzold.
3
u/ag-back Dec 23 '25
You could also look up computer architecture and Von Neumann architecture.
3
u/pete_68 Dec 24 '25
https://eater.net/8bit/
Step-by-step building an 8-bit computer on a breadboard. He starts by building the clock circuit. Then he builds a register. And then he builds another part, and another and eventually he hooks it all up and makes a working computer and you're there every step of the way getting walked through it. It's so simple, anyone can understand it.
2
u/JustinTime4763 Dec 23 '25
For computer architecture, read Inside the Machine by Jon Stokes
For operating systems, read Operating Systems: Three Easy Pieces (free at https://ostep.org)
Afterwards you could look at the 110 page paper on xv6 by it's developers. Xv6 is a rewrite of Unix 6 in ANSI C
For applications of this knowledge to programming, consider Computer Systems: a Programmer's Perspective (cs:app)
1
u/No-Impress-66 Jan 11 '26
This topic is called computer organization and architecture. Programs are stored on disk, loaded by the OS into RAM, and executed by the CPU using the fetch–decode–execute cycle, where instructions are read from memory, interpreted, and run. Data moves through the memory hierarchy (registers → cache → RAM → disk) for efficiency.
1
u/flash42 Dec 23 '25
Non-standard advice, but buy a cheap microcontroller like an esp32, download the ISA manual, and program a few small dumb things in assembly. Nothing like doing to make things click.
1
u/Positive_Wheel_7065 Dec 23 '25
This dude explains it super well!
https://www.youtube.com/watch?v=FU_YFpfDqqA&t=4s
0
u/p3r3lin Dec 23 '25
I think its really interesting that nobody in the thread so far recommended LLMs as tutors. I think they are doing a great job for especially this kind of non-debatable content. And its easy to adapt them to your own level of knowledge and learning.
I remember my university time (20 years ago) and how heavy and inaccessible Ive found the reading material and classical comp science books. Any modern LLM would have been a godsend (and would probably have improved my understanding and grades substantially).
So my 5 cents: use your exact post here and put it in any model from the last 18 months or so. Start there and tell it to go deeper or zoom out as needed.
0
u/WeirdInteriorGuy Dec 23 '25
So basically, think of it like a human with a piece of paper and a calculator.
Somewhere on the sheet is a segment where the human can write down information they need to remember. On another segment, you write down a list of step by step instructions for them to do to carry out the desired computation.
"Write down the number 1."
"Now add 3 to that number you just wrote down."
"Now divide whatever number you just got from that calculation by 2."
So the person follows each step, one by one.
That's what fetch-decode-execute is.
The only catch is that, because a computer isn't a human brain, it doesn't understand verbal instructions, so instead it's hardwired to interpret certain binary numbers in certain sequences as being those instructions.
"Write this number on your scratch paper:" might be the number 5 (in binary).
Then the desired number would probably just be encoded as that number.
Same thing for addition. That might be encoded as, say, the number 6.
Division might be represented by the number 7.
So a computer program might see these numbers:
"5, 1, 6, 3, 7, 2" And would read it as:
"Write: 1, Add: 3, Divide: 2"
0
u/Equal_Education2254 Dec 24 '25
Computer Organization and Design by Patterson & Hennessy was one of my favorites in undergrad. There are a million resources for you to find out all this information.
Below, I will provide you a quick "test" to know whether you have a decent understanding or not.
You will need to understand binary and how it is used. You should be able to explain Two's Complement, and Floating Point numbers. You should know how a bit shift left or right changes the value of a number. You should understand Little Endian.
Before you learn how a CPU works, you should also learn a bit about logical gates. I say you should know enough to be able to explain what a clock is and why it is relevant. You should also know what the various flip-flops are. You will probably run into MUXs most frequently, and should be familiar.
Since you asked about memory specifically, here is a quick rundown about memory. A brief breakdown is difficult since it is a bit complicated, but really theres a few main components to memory access :
Memory access happens in the following layers which are pretty standard now
Memory has 64 bit addresses (which is what it means when people are referring to when they say 32-bit and 64-bit computers).
There are a couple components that drastically affect performance when you are writing code. If you want APPLICATIONS-based knowledge, then the following architecture components are really important for high-performance software. You should read through as normal but keep the following list in mind as important things to pay attention to (with no particular order) :
42
u/[deleted] Dec 23 '25
[removed] — view removed comment
2
u/[deleted] Dec 23 '25
[removed] — view removed comment
0
u/[deleted] Dec 23 '25
[deleted] — view deleted comment