NOTE

Memory

Basic study notes on memory, byte order, and CPU cache.

Computer Architecture & AssemblyCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What Is Memory?

A primary storage device of a computer. Used to store data and instructions while programs are running.

2. Memory Structure

Memory can be abstracted as a continuous, 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. The byte order of multi-byte data is mainly divided into big-endian and 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 concrete 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

Cache

6. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub