1. Home
  2. Explore
  3. Computer Science
  4. Computer Memory and Storage

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Computer Memory and Storage

Speaker 1Speaker 2

Computer Memory and Storage

19:03
0:00-19:03
  1. Anna

    A desktop computer has more than a dozen places where data can be stored. Your games and files live on an SSD or hard drive, but when you open a game, large amounts of data move into DRAM, graphics-card memory, and smaller, faster locations inside the CPU and GPU. Those layers are what let the computer respond quickly and render complex worlds.

  2. Hope

    So why not just use the fastest kind of memory everywhere? It sounds like that would eliminate all the moving around.

  3. Anna

    Because every kind of memory involves trade-offs. SSDs and hard drives hold lots of data relatively cheaply, but they take much longer to access it. CPU cache is extremely fast and has high bandwidth, but it is expensive and stores comparatively little. No single location is best at capacity, access time, bandwidth, and cost all at once.

  4. Hope

    The solution is to combine them, then. Memory controllers and algorithms move data among the different layers so the computer can get a balance of strengths.

  5. Anna

    Exactly. Let’s picture the scale of those differences with a library analogy. In this visualization, one megabyte of data is represented by a 400-page book. That’s a reasonable comparison if each letter, punctuation mark, and space is represented by an 8-bit ASCII character.

  6. Hope

    And access time becomes distance in the library?

  7. Anna

    Right. We’ll use 20 centimeters to represent one nanosecond—the time between requesting data and getting it back. It’s an analogy for comparing delays, not a claim that electricity literally has to travel that distance.

  8. Hope

    Let’s start with the CPU. What does it look like in this library?

  9. Anna

    Imagine the CPU as a table. Its registers and three levels of cache are places on or near that table where books and individual pages can be kept. Registers, L1 cache, and L2 cache are divided among the cores; L3 cache is shared. In the example, the CPU has eight performance cores and sixteen efficient cores.

  10. Hope

    Those memory locations take up only part of the chip, right?

  11. Anna

    About 30 percent of the CPU die is used by the registers and caches in this example, with roughly 68 megabytes of storage overall, plus smaller amounts in registers and L1 caches. The remaining area goes to core logic, controllers, and many other parts. If we put the execution units and arithmetic logic unit—the ALU—on one side of the table, registers are about a third of a nanosecond away, while the shared 36-megabyte L3 cache is about 7.5 nanoseconds away.

  12. Hope

    So even within the CPU, not all data is equally close to the work being done. What’s the next layer out?

  13. Anna

    Main memory: DRAM. Picture two library carts beside the CPU table. Two 16-gigabyte DRAM sticks hold the equivalent of about 32,000 books—roughly 470 times the CPU’s capacity in this comparison. But access takes around 45 nanoseconds, so the carts are placed about nine meters away.

  14. Hope

    And the graphics card has its own version of this arrangement?

  15. Anna

    Yes. The GPU has registers and L1 and L2 caches, totaling about 37 megabytes in the example and occupying roughly a third of the GPU die. The GPU’s many thousands of cores make its memory distribution different from the CPU’s. Nearby VRAM carts hold 24 gigabytes, but access takes around 250 nanoseconds.

  16. Hope

    That seems slower than DRAM even though the VRAM is right next to the GPU in our picture.

  17. Anna

    That’s the point of the analogy: physical placement alone doesn’t determine access time. VRAM is designed to deliver high bandwidth using wide buses and deep pipelines, rather than optimizing for the fastest response to a single request. The CPU and GPU are also about 300 nanoseconds apart in this model, equivalent to 60 meters.

  18. Hope

    Now let’s compare those with long-term storage.

  19. Anna

    The example includes a 2-terabyte NVMe SSD, a 4-terabyte SATA SSD, and an 8-terabyte hard drive. In book terms, they hold about two million, four million, and eight million books. Their capacities dwarf the CPU’s, but their access times are much longer.

  20. Hope

    How much longer?

  21. Anna

    The NVMe SSD is around 80 microseconds away in the analogy—about 16 kilometers. The SATA SSD is around 120 microseconds, or 24 kilometers. The hard drive’s access time is around 10 milliseconds, which would put it 2,000 kilometers away.

  22. Hope

    That really shows why the computer can’t treat storage like working memory. What about the internet and cloud storage?

  23. Anna

    The internet contains an enormous amount of data—about 500 exabytes in the estimate given here. Latency depends on how far the request and response travel: getting data from a nearby city might take around 12 milliseconds, while a trip to the other side of Earth averages about a quarter of a second. That round trip is about twice as long as light would take to cover the same distance.

  24. Hope

    So the library picture captures a memory hierarchy: tiny, fast storage near the processors, larger and slower memory farther away, then storage and networked data beyond that.

  25. Anna

    Exactly. Computer architecture courses often draw this as a pyramid, with registers and cache at the top, DRAM in the middle, and SSDs and hard drives below. The internet and other devices form another layer at the bottom. The pyramid makes the trade-offs easier to see.

  26. Hope

    Let’s open up the devices themselves. Starting with the NVMe SSD, what’s inside?

  27. Anna

    A 2-terabyte NVMe SSD has a circuit board with a memory controller, DRAM, and 3D NAND flash packages where the files are stored. A package contains a stack of eight dies connected by wires to a substrate. Each die has multiple planes, and each plane contains a vast array of memory cells.

  28. Hope

    How dense is that array?

  29. Anna

    The example estimates around 40,000 strings across, 60,000 rows deep, and roughly 200 layers tall. That can add up to more than 100 gigabytes in a volume smaller than a grain of rice, at a cost of about seven cents per gigabyte. Those figures illustrate the scale; they aren’t an exact blueprint for every SSD.

  30. Hope

    And each cell stores the data by holding electrons?

  31. Anna

    In this example, the cell is charge-trap flash, or CTF. It traps one of eight distinct amounts of charge, representing three bits. An insulating dielectric surrounds the charge trap, so the data can remain stored for years without external power.

  32. Hope

    If it holds data so well, why is it slow compared with cache or DRAM?

  33. Anna

    The charge trap has no direct electrical connection, so reading or changing its stored charge takes a carefully controlled sequence of voltage steps. That process takes dozens of microseconds: about 80 microseconds to read and closer to 500 microseconds to write in this example. Bandwidth is around five gigabytes per second.

  34. Hope

    So even if a CPU were placed right beside the flash cells, it wouldn’t make the cells themselves respond like DRAM.

  35. Anna

    Correct. The access delay is determined largely by the storage medium’s limits, not by the distance electricity travels. Think of a book high on a tall shelf: standing beside the shelf doesn’t make retrieving that book instantaneous.

  36. Hope

    And SATA SSDs use similar flash?

  37. Anna

    They use a similar set of chips, including 3D NAND, so their costs can be comparable. But the older SATA transfer protocol limits their bandwidth, and their access times are longer than NVMe drives. The storage medium is similar, but the interface affects performance.

  38. Hope

    How does a hard drive store its data?

  39. Anna

    Inside are four platters in this example, with eight read-write heads controlled by a voice-coil motor. Data is arranged in about half a million concentric tracks. Each track is divided into sectors, which include a synchronization area, an address, four kilobytes of data, error-correcting information, and gaps.

  40. Hope

    And the bits are magnetic?

  41. Anna

    Yes. The write head uses focused magnetic fields to change magnetic domains in a tiny volume of the platter. The read head detects changes in the magnetic field between domains as a one, and no change as a zero. That lets trillions of bits fit across the platters, adding up to terabytes in one drive.

  42. Hope

    That explains the capacity and low price, but what creates the delay?

  43. Anna

    The platters are relatively simple layers of material, so hard drives can cost only a cent or two per gigabyte. The specialized read-write heads are costly to engineer, though: they must fly just nanometers above a spinning surface. To find data, the head has to seek the right track while the platter rotates at 7,200 revolutions per minute. One rotation takes about 8.3 milliseconds, contributing to long access times and low bandwidth.

  44. Hope

    Now for DRAM—the sticks of main memory. How are those connected?

  45. Anna

    Each stick in the example contains eight DRAM chips, connected to the CPU through memory channels on the motherboard. The CPU’s memory controller manages them. Inside a chip are layers of interconnections and an integrated circuit with 32 banks; each bank contains an array of approximately 65,000 by 8,000 memory cells.

  46. Hope

    What does a single DRAM cell look like?

  47. Anna

    It uses one transistor and one capacitor, so it’s called a 1T1C cell. The capacitor holds one bit as an electric charge, while the transistor provides access to it. To read or write, the CPU specifies a bank and row, turning on the transistors in that row and connecting the capacitors to sense amplifiers.

  48. Hope

    Then the sense amplifiers determine what was stored?

  49. Anna

    Right. They measure the voltage in the capacitors. Groups of sense amplifiers connect to read or write drivers, which carry data to and from the CPU. In the example, the process takes around 45 nanoseconds, and DRAM bandwidth is typically around 48 gigabytes per second.

  50. Hope

    That high bandwidth helps the operating system switch between processes quickly. What’s the cost of using capacitors?

  51. Anna

    The cells take up enough physical space that DRAM’s 1T1C array is typically arranged in a two-dimensional plane, limiting bit density and increasing cost per bit compared with very dense flash. Also, each capacitor loses charge, so DRAM must be refreshed frequently. Without power, it loses its data in about a tenth of a second.

  52. Hope

    The fastest layers are cache and registers, and both are built from transistors. How does cache work?

  53. Anna

    Cache uses six transistors for each bit in an SRAM cell. Six may sound modest, but multiply that by 36 megabytes of L3 cache and you get about 1.8 billion transistors. Add the other cache levels and the circuitry for addresses, and around a third of a CPU’s 26 billion transistors may be devoted to cache.

  54. Hope

    So making cache much larger would take an enormous amount of chip area and cost.

  55. Anna

    Exactly. If you extrapolate the cost of a CPU to a gigabyte of cache, the result is extremely expensive, with a huge transistor count. That’s why cache stays small even though it is fast and has high bandwidth.

  56. Hope

    And registers are even closer to the calculations?

  57. Anna

    Yes. Registers store bits in D flip-flops, using around 16 transistors per bit. A register is typically 64 bits wide, and a core’s register file commonly has 32 entries. Registers sit directly beside the execution units and ALU, where calculations and logic operations happen.

  58. Hope

    Why not add more register entries if they’re so useful?

  59. Anna

    There are two constraints. Registers are designed to be accessed in a single clock cycle—about a third of a nanosecond in this example—and adding entries means larger decoder circuitry and more access ports, which can force the clock to run more slowly. Also, 32 registers can be identified using five bits in an instruction; more registers would require longer instructions.

  60. Hope

    So the execution units can only work on data once it reaches the registers. If it isn’t there, it has to be fetched from cache, DRAM, or even storage and moved inward.

  61. Anna

    That’s the key idea behind the hierarchy. Frequently needed data can be kept close and accessed quickly, while larger amounts of less immediately needed data remain farther out. The system’s performance depends not just on where data is stored, but also on how effectively it moves through those layers.

  62. Hope

    How exact are all the capacities and timings we’ve been using?

  63. Anna

    They’re approximate. Manufacturers don’t publish every internal detail, and the SSD cell counts, for example, are meant to be realistic in scale rather than an exact diagram of a particular product. There are hundreds of designs and architectures, and the technology keeps changing.

  64. Hope

    There are also technologies beyond the ones we’ve discussed?

  65. Anna

    Yes, including magnetic RAM, phase-change memory, and emerging variations at different levels of the hierarchy. The important point is that memory design continues to evolve; devices in a decade may offer much greater capacity, faster access, and higher bandwidth.

  66. Hope

    Let’s scale up from a desktop to an AI server. Why does AI need so much memory and storage?

  67. Anna

    AI processors can perform petaflops of calculations, and a single AI server can contain terabytes of memory and hundreds of terabytes of storage—far more than a typical desktop. The reason isn’t that ordinary text takes up much space as binary. It’s that AI represents and processes text using many numerical values.

  68. Hope

    What does that representation look like?

  69. Anna

    As a simplified example, imagine each word—or token—being represented by about 8,000 dimensions or values, each one byte in size. A real token can be only part of a word, but treating one word as one token keeps the example simple. The values help represent features and relationships the model has learned; they are not literally just labels like 'hot' or 'large.'

  70. Hope

    So one token takes around eight kilobytes in this simplified picture. A whole conversation could become enormous.

  71. Anna

    Exactly. The maximum number of tokens a model can handle is called its context window. Cutting-edge models may have context windows from around 100,000 to a couple of million tokens. The context includes the input, earlier conversation, the model’s output, reference material, and more. At a million tokens and 8,000 one-byte values per token, the representation comes to about eight gigabytes.

  72. Hope

    And the model has to do more than store that context. It has to process it.

  73. Anna

    Right. To generate a response, the context passes through hundreds of transformer blocks. Those blocks include attention sublayers, feed-forward or multilayer perceptron blocks, and sometimes mixture-of-experts components, among other parts. Each block has many learned parameters, and state-of-the-art models can have hundreds of billions of parameters.

  74. Hope

    All those parameters and the context have to be stored and repeatedly moved to and from the AI processors. That makes memory bandwidth and capacity central to the system, not just an accessory.

  75. Anna

    Exactly. AI uses a memory hierarchy too, but on a much larger scale. Closest to the AI processor is high-bandwidth memory, or HBM. Below that, systems can use DDR5 server RDIMMs, and they can add expansion memory through the CXL, or Compute Express Link, protocol.

  76. Hope

    What makes HBM so close to the processor and so fast?

  77. Anna

    In the example, HBM3E is built as a 12-layer stack of DRAM dies. Through-silicon vias, or TSVs, connect the layers vertically, creating a compact, dense memory package. Six packages sit beside the AI processor on a thin silicon interposer.

  78. Hope

    The interposer is like a tiny motherboard underneath the processor and HBM?

  79. Anna

    That’s a good way to picture it. It provides very dense wiring between the processor and the surrounding HBM. Short, extremely wide connections provide about 141 gigabytes of HBM in the example, with bandwidth of roughly 1.2 terabytes per second and low latency.

  80. Hope

    What comes after HBM in the server hierarchy?

  81. Anna

    DDR5 RDIMM sticks provide another layer. The example uses 32 sticks of 128 gigabytes each, for four terabytes total. Some AI systems use LPDDR, similar to the memory in phones, to provide higher bandwidth with low-power, efficient performance.

  82. Hope

    And the storage layer has to handle enormous datasets as well as the AI workload.

  83. Anna

    Yes. Inside an AI chassis, the example describes Micron 9650-series SSDs with capacities from eight to 30 terabytes. They use PCIe Gen6 and are designed for the high throughput demands of training and inference pipelines.

  84. Hope

    Then there are separate racks for even larger pools of data?

  85. Anna

    Right. Networked data lakes can use Micron 6600 ION NVMe SSDs, with modules holding up to 122 terabytes and other form factors reaching 246 terabytes. Depending on the chassis and SSD density, a full rack can store dozens to hundreds of petabytes—enough for training datasets containing billions of examples.

  86. Hope

    So AI data centers combine specialized memory close to the processor with larger memory and huge storage pools farther away. The design has to keep the data flowing across all those layers.

  87. Anna

    That’s the overall lesson. Modern computers—and especially AI systems—need many kinds of memory because capacity, access time, bandwidth, and cost pull in different directions. A carefully connected hierarchy lets each technology contribute what it does best, while the system manages the movement of data between them.

  88. Hope

    And the hardware is still evolving: new memory technologies, denser flash, faster connections, and more specialized systems will keep reshaping that hierarchy. Understanding how data is stored and moved is a way to understand a huge part of modern computing.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent