NOTE
Memory
Memory stores instructions and data used by running programs. It can be viewed as a continuous byte-addressed space in which each byte has an address.
This is a historical learning note and may contain outdated or incomplete understanding.
1. What Is Memory?
Memory is a computer’s primary storage device. It stores data and instructions while programs are running.
2. Memory Structure
Memory can be abstracted as a contiguous, byte-addressable address space in which each byte has a corresponding address.
3. Memory and Variables
When program data needs to reside in memory, it is stored as a byte sequence. Multi-byte data is generally stored in one of two byte orders: big-endian or little-endian:
- Big-endian: the most significant byte is stored at the lower memory address, and the least significant byte at the higher address.
- Little-endian: the least significant byte is stored at the lower memory address, and the most significant byte at the higher address.
Whether a variable is actually held in a register or memory depends on the compiler, runtime, and the details of execution.
4. Why Is Memory Needed?
CPU registers have very limited capacity and cannot hold all instructions and data required while a program runs.
5. Cache
6. References
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub