Today was a very long day and I didn’t have time to study, still managed to pull through and learned some interesting things.
- Programs are also “data” stored on RAM addresses like anything else. They are a series of instructions, numbers, addresses… RAM btw, is just a series of slots where 1 and 0 are stored :), and a link to the CPU.
- Now there is a game happening between CPU and RAM, and info is exchanged constantly between these twp. CPU accesses RAM constantly and executes intructions etc.
- Inside the CPU itslef, the game happens between the Control Unit and the ALU.
- The CPU at the end of the day are wires carrying info, on/off, high/low voltage, which represent the 0’s and 1’s.
- There is always one wire that turns on and off at a given rate, the clock, and how many times per second this happens (HZ) is basically what we hear of 2Ghz processor… this means the clock switches on and off 2 Billion times per second! That is one of the things that allows so many computations to happen so quickly.
- How does a CPU work? Well, it seems pretty damn hard to fully understand, but this video is really awesome in breaking it down. Although I don’t fully get it (Will re-watch another day again slowly), at the end of the day there seems to be a game between the Control Unit and the ALU, helped by “flags” (don’t understand yet) and “registers” basically a component used to “store” a value for some time. These are like a little RAM inside the CPU itslef.
- In terms of possible CPU instructions in RAM, there seem to be different depend on CPU. But in the video it explains the following: LOAD (Fetches value from RAM), ADD (Adds two values together), STORE (Saves result in RAM), COMPARE (Compares 2 numbers together to see which one is larger, or if they are the same), JUMPIF (If certain condition is met, go fetch a specific variable from an out of order RAM address), JUMP (Jumps without condition), OUT (Output data to external device like a monitor), or IN (Fetches data from external device like keyboard).
As a pending task I need to re-watch the video again and try my best to fully understand the example little program it puts. I feel it is super important to understand this well to get the essence of every computation later on.
I need to also clarify what is the essential differences between the ALU and the Control Unit.
If ever want to go deep into this they reccomend a book in the video “But How do It Know“? I might read it in the future, or might not. Not sure.