Memory and storage
With 32-bit addresses a processor can name 4,294,967,296 bytes, exactly 4 GiB. Switch the power off and RAM forgets all of it.
"My laptop has 16 GB of memory, so it can hold 16 GB of photos." That sentence mixes up two different parts, and the laptop advert itself shows why. It lists two sizes, for example 16 GB of memory and 512 GB of storage. Memory, or RAM, holds the programs and data the CPU is using right now. Storage, a solid-state drive (SSD) or an older hard disk, keeps your files when the power is off. The photos live on the 512 GB side. The 16 GB is the working space where a photo goes while you are editing it.
Why RAM forgets when the power goes
Most RAM stores each bit as a tiny charge that leaks away unless it is refreshed many times a second, so everything in it is lost when the power goes. That is what "volatile" means. Storage keeps data without power. An SSD traps charge in flash memory cells that hold it for years, and a hard disk records bits as magnetised spots on spinning platters. Storage is much bigger and cheaper per byte, but much slower to reach, so programs are copied from storage into RAM before they run. That copying is what is happening while an app says it is loading.
How the CPU finds one byte among billions
Memory is a long row of cells, each holding one byte, and each cell has a number called its address, starting from 0. To read or write, the CPU puts an address on a set of wires and gets back the byte stored there. The number of address bits sets how much memory can be reached. Four address bits, as in the toy computer, give 2 to the power 4 = 16 cells. Sixteen bits give 65,536. Thirty-two bits give 4,294,967,296 bytes, which is exactly 4 GiB, and that is why older 32-bit systems could not use more than 4 GiB of RAM. Today's 64-bit processors can name far more.
A cell has no idea what its bits mean. In the toy computer the 8 bits 00000100 in a data cell are the number 4, but read as an instruction the same bits mean HALT 4. Only the way the CPU reaches a cell decides which, as the next instruction or as data named by an instruction. That follows directly from von Neumann's idea of keeping both in one memory. It is also why a bug that writes to the wrong address can wreck a whole program.
Drag to turn. Scroll or pinch to zoom.
Each layer down is bigger and slower
Fast memory is expensive, so computers use layers. Closest to the circuits are the registers, a few dozen values the CPU works on directly, like the accumulator in the toy. Next come caches, small blocks of fast memory on the processor chip itself, usually named L1, L2 and L3, which keep copies of recently used parts of RAM. Then RAM, then the SSD or hard disk, and beyond that the network. Each layer down is bigger and slower. A program runs fast when most of what it needs is already in the top layers. That is why reading data in order is usually quicker than jumping around.
| RAM | Working memory; volatile |
| SSD | Flash storage; keeps data without power |
| Address | The number of a memory cell |
| Cache | Small fast memory on the CPU chip holding recent data |
| Register | A value inside the CPU itself |
| 32-bit address | 4,294,967,296 bytes = 4 GiB |
- "More RAM makes the CPU faster." RAM size changes neither the clock nor the work done per tick. It decides how much can be kept close at hand. If the programs and data you use already fit, more RAM changes little. If they don't fit, the computer keeps going back to much slower storage, and then more RAM helps.
- "16 GB of memory means room for 16 GB of files." Files are kept in storage, the 512 GB in the advert. RAM is the working space for whatever is open right now, and it empties when the power goes.
- "If it is on the screen, it is safely inside the computer." An open document sits in RAM. Until it is saved to storage, a power cut or a flat battery wipes it, because RAM is volatile.
- What does "volatile" mean for RAM?
- It loses its contents when the power is off
- It is very fast
- It can only be written once
- It is stored on a spinning disk
- How many bytes can 32-bit addresses name?
- How many GiB is that?
- How many memory cells can 16 address bits reach?
- The toy computer has 16 cells of 8 bits. How many bits of memory is that in total?
- Which keeps your files when the power is off?
- SSD
- RAM
- Cache
- Registers
- Order from fastest to slowest.
- After the 4 × 3 program halts, what number is in cell 13?
- In the toy, a data cell holds 00000100. Read as an instruction, what would it mean?
- HALT 4
- LOAD 4
- STORE 4
- ADD 4
- Why are programs copied from storage into RAM before they run?
- RAM is much faster for the CPU to reach
- Storage cannot hold programs
- RAM keeps data when the power is off
- The SSD would wear out at once
- Memory is numbered cells; n address bits reach 2ⁿ cells (32 bits = 4 GiB).
- The same bits can be an instruction or data; how the CPU reaches them decides.
- RAM is volatile working memory; SSDs and hard disks keep data without power.
- Registers, cache, RAM, storage: each layer down is bigger and slower.
Sources for this course (9)
- (checked 2026-10-17; reordered 2026-10-19: standards first, then official documentation, then the teaching model and calculations, history sources last)
- Standards: NIST, "Prefixes for binary multiples" (physics.nist.gov/cuu/Units/binary.html: IEC approved kibi, mebi, gibi in December 1998; 1 B = 8 bit; 1 MiB = 1 048 576 B; 1 MB = 1 000 000 B; 1 GiB = 1 073 741 824 B; historical note: memory makers usually mean 2²⁰ bytes by megabyte, storage makers 1 000 000, and the "1.44 MB" diskette uses a megabyte of 1 024 000 bytes)
- IETF RFC 20 "ASCII format for Network Interchange" (1969, 7-bit codes, A = 65, a = 97, 0 = 48)
- IETF RFC 3629 "UTF-8, a transformation format of ISO 10646" (2003: 1 to 4 octets per character, ASCII unchanged, code points up to U+10FFFF, U+0800 to U+FFFF take three octets, "the first octet of a multi-octet sequence indicates the number of octets", example U+D55C U+AD6D U+C5B4 = ED 95 9C EA B5 AD EC 96 B4)
- Official documentation: MDN Web Docs, "<color>" (hexadecimal colour notation #RRGGBB)
- Intel, "Intel Chips" timeline poster (2012: Intel 4004 of 1971 with 2,300 transistors; 2nd generation Core 2010 with 1.16 billion)
- Claude E. Shannon, "A Symbolic Analysis of Relay and Switching Circuits", Transactions of the AIEE vol. 57 (1938)
- abstract of his MIT master's thesis. Computer History Museum, The Silicon Engine, "1947: Invention of the Point-Contact Transistor" (Bardeen and Brattain, December 1947, germanium)
- John von Neumann, "First Draft of a Report on the EDVAC" (30 June 1945, Moore School, reprinted in IEEE Annals of the History of Computing 15:4, 1993).
Checked: 2026-10-17