Computer architecture - Memory - lecture 8a - Charles Fox - University of Lincoln
Overview
Charles Fox explains computer memory as a hierarchy that trades access speed for capacity, from CPU registers and primary memory to secondary, tertiary, and offline storage. He connects address spaces and RAM technologies to concrete architectures, distinguishing fast, costly SRAM from denser, capacitor-based DRAM, then covers memory controllers, ECC, low-power memory, and the changing meaning and forms of ROM.
Key takeaways
- Memory hierarchy is a capacity-speed tradeoff: registers and primary memory are fast but limited, while secondary, tertiary, and offline storage offer more capacity with slower access.
- An 8-bit address bus provides 256 locations, and a 16-bit address space has 65,536 locations; address maps can assign those locations to RAM, ROM, or memory-mapped I/O.
- SRAM stores bits in flip-flops and is fast but expensive, while DRAM stores bits as capacitor charge and is cheaper but must be refreshed as charge leaks.
- A memory controller maps CPU addresses onto the smaller address spaces of individual memory chips, allowing multiple modules to form one larger address space.
- ECC RAM uses added redundancy and hardware logic to protect against bit errors, making it useful in critical systems but more costly than ordinary RAM.
- Modern ROM is generally readable, non-volatile firmware storage rather than strictly unwritable memory; its technologies progressed from mask ROM and PROM through EPROM and EEPROM to flash.
Chapters
- The lawyer’s desk analogy illustrates the tradeoff: documents within reach are faster to access, while distant shelves and archives hold more.
- Computer memory is organized as a hierarchy: capacity grows and access speed falls farther down the pyramid.
- Primary memory is directly loadable and storable by the CPU; secondary storage such as a hard disk uses an I/O module.
- A Blu-ray disc in a drive is secondary storage, while a disc on a shelf is offline storage; robotic disc libraries are tertiary storage.
- SI prefixes increase by powers of 1,000, while binary prefixes such as mebibytes and gibibytes use powers of two.
- An address bus with 8 wires represents 2^8, or 256, possible addresses, making powers of two useful for describing address spaces.
- Lowercase b denotes bits and uppercase B denotes bytes; networking rates commonly use bits per second, while memory capacities usually use bytes.
- A 16-bit address bus with 8-bit locations can address 64 KiB, as in the Commodore 64; modern machines retain byte-based conventions despite commonly using 64-bit words.
- Fox illustrates decimal data scales with cubes: a 1-kilometer cube contains a billion 1-meter cubes, so one byte per cube represents roughly a gigabyte.
- The examples scale from a gigacube across Central Park to a teracube over Manhattan and a petacube spanning a large part of New York State.
- An exacube is about 1,000 kilometers on each side, roughly matching the volume of Earth’s atmosphere; climate science therefore works with exascale data.
- The scale examples encourage evaluating whether a smaller data sample could produce nearly the same research result while reducing storage and cloud costs.
- Primary memory consists of locations the CPU can access directly with load and store instructions over a bus.
- Address maps partition a computer’s address space among RAM, ROM, and memory-mapped I/O; the BBC Micro’s 16-bit space runs from 0 to FFFF.
- Compilers commonly allocate user memory into a stack for function calls and a heap for dynamically requested data; in the example, the stack grows down and the heap grows up.
- When stack and heap collide, the available memory is exhausted, a condition associated with a stack overflow.
- Fox uses RAM to mean primary, writable, volatile memory: the CPU can address it, store to it, and its contents disappear when power is off.
- The older expansion, random access memory, describes equal-time access to locations, not the modern three-property usage.
- Historical RAM implementations include mechanical gear state, the Manchester Baby’s Williams tube CRT, and acoustic mercury delay lines.
- Williams tube storage required refreshing its visible charge pattern, an approach that foreshadows refresh in modern DRAM.
- Static RAM uses transistor logic and flip-flops, the same basic storage technology used for CPU registers.
- SRAM is relatively fast and expensive, so it is used for registers and dedicated cache chips rather than most bulk memory.
- In Fox’s example circuit, two address bits select one of four words, each two bits wide, through a decoder.
- Control lines determine whether the selected word is written into or read out to the data bus.
- Dynamic RAM uses a capacitor and transistor for each stored bit instead of an SRAM flip-flop, making it simpler and cheaper for bulk memory.
- A charged capacitor represents stored state, but its charge leaks over time, so DRAM must periodically read and rewrite its contents.
- DRAM retains the same general address-and-word organization as SRAM, even though each bit uses a different electrical storage mechanism.
- The refresh requirement explains part of DRAM’s power use and distinguishes it from the flip-flop-based SRAM described earlier.
- A memory controller translates CPU-visible addresses into selections of individual memory chips and locations within those chips.
- ECC RAM adds redundancy and hardware coding logic to detect and correct memory errors, including bit flips caused by cosmic rays.
- ECC is valuable in high-consequence settings such as spacecraft, banking, government systems, and large data centers, but costs more than ordinary RAM.
- Low-power DDR in phones can avoid refreshing unused memory regions, reducing battery use; closing apps can let the operating system release those allocations.
- Fox characterizes modern ROM as primary, readable, and usually non-volatile, retaining its contents when power is off.
- Unlike RAM, ROM generally cannot be written directly by the CPU; changing it typically requires a separate, slower process involving the I/O system.
- Modern ROM often stores firmware, including a PC’s BIOS, which starts before the main operating system.
- Phone firmware is another example: installing a different Android-based system, such as LineageOS, changes the software stored in ROM.
- Mask ROM is fixed during chip fabrication, while PROM can be programmed once and then behaves as read-only storage.
- EPROM can be erased using strong ultraviolet light, traditionally after physically removing the chip from the computer.
- EEPROM introduced electrical erasure without removing the chip, and flash memory extended this approach to selectively erasable regions.
- Flash appears in SD cards and drives and can store firmware as well as serve in storage roles similar to hard disks.
Transcript excerpt
0:01 Today we're going to look at memory. We have been building up all the components of a modern electronic computer. This is the last of those components. We've been putting a CPU together. Last week we were putting IO together. We have referred to memory along the way here and there. We've often just seen it as a big box labeled RAM connected to the CPU via a bus. Here we're going to study memory in more detail. So the concept of memory is based around a hierarchy. Imagine going to visit a old-fashioned lawyer. Is there such a thing as a non-old-fashioned lawyer? Um
0:48 >> No. >> Old-fashioned lawyers don't don't like to use computers. They like to use a traditional office space and a desk and pens and and paper. Um and the lawyer will sit in this big chair in the center of the office and you will see different pieces of data are arranged differently around them according to how the data is being used. Right in front of the lawyer is the stuff they're actually working on right now. So this this can be instantly manipulated. It can be read. It can be written using a pen. It's right there. It's interactive. A little bit further away from where the lawyer is sitting are some documents that are kind of in use, but they're not immediately being written or read. They're
1:36 they're held within arms reach so you can quickly bring them into this area. You could swap them over for the document that you're currently working on and be able to to work with them quite quickly. A little bit further away from that, for example, there there are piles of books here. So you have to put in a bit more effort. It's going to take
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Charles Fox.