> See also:
> - [[Binary]]
# Computer Memory
![[Pasted image 20231203175417.png|500]]
In a perfect world, computers would have unlimited access to fast memory so that it can quickly read and store information after performing its operations. *Unfortunately fast memory is expensive*, so alternatives need to be used.
A **memory heirarchy** can be implemented to give the illusion of large amounts of fast memory by
> [!info]+ Principles of Locality
> Contents
## Units of Measurement
GiB = 1024 ($2^{10}$)
GB = 1000
one uses the traditional metric values while the other represents the true nature of binary
https://massive.io/file-transfer/gb-vs-gib-whats-the-difference/#:~:text=20%20GB%20Free-,GB%20vs%20GiB%3A%20So%20What%20is%20the%20Difference%3F,Seems%20straightforward%2C%20right%3F
## Registers
Processor registers are small high-speed storage locations built directly into the CPU infastructure.
This allows them to be used for the rapid retrieval and manipulation of data that the CPU needs for its operations.
## Memory Caches
Permanent storage on disk
### Cache Hits & Misses
- Compulsory (Cold Start)
- Capacity
- Conflict
## Main Memory
### Random Access Memory (RAM)
## Permanent Storage
### Hard Disk Drives (HDD)
> “Hard Drive” is short for “Hard Disk Drive”
Similarly to CDs and vinyl records, a disk drive relies on a *rotating disk* and an arm that comes into contact with it.
- For disk drives, this arm is called the **actuator arm** and allows for the reading and writing of data onto the drive.
Typically the *inner tracks* of the disk contain a *file allocation table* (metadate) that contain:
- What files are on the disk
- Where the files are located
The *outer tracks* then contain the *data* itself.
### Solid State Drive (SSD)
Stores data in transistor circuits on chips