An overview of the computer architecture from a high-level to understand how the parts work with each other to execute the code that write. (from a software perspective).’

Disk
- This component stores all our data persistently, what that means is even if our computer restarts or crashes while we are executing some code, or while it’s running some program, the data in our disk will be persisted.
-
How much information can it store? It is usually measured in 100s of GBs. or commonly in terms of TBs.
A byte is nothing more than 8 bits. Each bit can store either a 0 or a 1. We can use these ‘bits’ and ‘bytes’ to represent information we refer to as ‘data’.
-
So when we say if a disk has 10TB of storage, that disk actually has $10^{12}$ bytes. 1GB is $10^{9}$.
Memory
- This is our memory a.k.a. RAM (Random Access Memory). This is also used to store information, and is typically a lot lot smaller than our disk.
- So for example our RAM might contain something like 2GB, 4GB, 8GB, 16GB, etc. This is because RAM is typically more expensive (in terms of money), but the benefit is it is a lot cheaper (in terms of resources/speed).
- If we were to write for example 1MB of data into our RAM, the amount of time it would take would be measured in terms of $\mu\ seconds$ (micro seconds). $\mu\ = \frac{1}{10^6}$.
- It is a lot faster than disk. Reading and writing from disk is typically measured in milliseconds. $\text{1ms} = \frac{1}{10^3}\ seconds$
CPU
- The main things tat the CPU is capable of is writing information to RAM or to Disk. It can also read from RAM or disk.
- What does CPU do after reading/writing data from these components? Well it executes code. We can assume that the code we wrote is in memory. The CPU is going to read our code and separate data / in-mem data (array, etc.), from the RAM.
- All computations are done in the CPU.
- A CPU has something called a ‘cache’. This is faster than memory speeds. It is a part of the CPU. It is measured in terms of MBs.
- This cache is used to speed up read/write operations from the RAM. Because reading and writing from the cache is in terms of $\text{nano } \text{seconds}$ which is $\text{1ns = } \frac{1}{10^9}$
- The downside it is that it stores a lot less data and is mainly used for substuition for the RAM.
Moore’s Law
This is less of a law, more of an observation that states: “Overtime, the number of transistors inside of a CPU doubles every two years, and the cost is cut in half every two years.”
Well in the past few years we have seen a decline in this trend because we cannot infinitely scale up these transistors.