Memory Organisation
Algorithms, Programming, and Data Representation · Module 92313 · Chapter 5
This chapter explains how computers organise memory, identify locations, lay out multi-byte values, assemble memory modules, and distribute addresses across modules.
Start from memory
Try each question first. Mark it sure, unsure, or guessed.
- Which is faster: CPU registers, RAM, or a hard disk?
- What does a byte address select?
- Which byte goes first in little-endian order?
- How many bits select one of four memory modules?
- What is the difference between high-order and low-order interleaving?
Check the short answers
- Registers are fastest, followed by RAM, then storage. §5.1
- One byte. §5.2
- The least significant byte. §5.3
- Two bits, because 22=4. §5.5
- High-order groups contiguous address ranges by module; low-order distributes adjacent addresses across modules. §5.5
How to use this guide
Study a section, hide it, then rebuild its rules and examples from memory. Attempt mixed practice before opening answers.
- Day 0: Try the cold start and study §5.1–5.2; solve practice 1, 4, 6, 21.
- Day 1: Reconstruct byte-order rules in §5.3; solve practice 2, 7, 12, 19.
- Day 3: Work through chip sizing in §5.4; solve practice 3, 8, 11, 13, 17.
- About day 7: Rebuild both interleaving schemes in §5.5; solve practice 5, 10, 14, 18.
- About day 14: Complete both exam problems without notes; explain each answer aloud.
- Before the exam: Tick only skills you can demonstrate cold; revisit sections named in missed answers.
When stuck: write the address width, addressable unit, row width, and byte order before calculating. Check units at the end.
How the chapter fits together
Memory properties motivate a hierarchy. Addresses select locations, byte order explains multi-byte layout, chips build capacity and width, and interleaving distributes requests.
Measure · capacity and access
Memory hierarchy §5.1
speed · cost · capacity · volatility
Rests on: identifying what each memory level trades away.
Addressing and capacity §5.2
locations = 2address bits
Rests on: the addressable unit and memory row width.
Define · interpret layout
Byte ordering §5.3
MSB first / LSB first
Rests on: addresses identifying successive bytes of one value.
Chips and modules §5.4
rows × width
Rests on: multiplying row count by bits per row.
Derive · select and distribute
Interleaving §5.5
address = module bits + row bits
Rests on: separating module selection from row selection.
| Question | Method |
|---|---|
| How much memory? | Count addresses or multiply rows by width. |
| What byte appears first? | Identify endian convention, then order bytes. |
| Where does this address go? | Split module-selection and row bits. |
5.1 Memory hierarchy and properties
Hierarchy balances speed, capacity, cost, volatility, and flexibility. Registers are fastest and smallest; storage devices are largest and slowest.
In plain words: memory is a ladder of trade-offs: the faster a memory is, the smaller and more expensive it is. Registers inside the processor are fastest; RAM is larger and slower; disks and SSDs are largest and slowest but keep their contents without power. SRAM and DRAM are two ways to build RAM: SRAM is faster, DRAM denser and cheaper.
Memory holds data, instructions, and addresses as binary values. Contents change only when overwritten. Registers are fixed in the CPU; RAM is expandable main memory; disks and other devices provide expandable storage. The lecture’s comparison is qualitative: registers are expensive, small, fast, volatile; RAM is intermediate; disks are cheap, large, slower, and non-volatile.
SRAM and DRAM
Static RAM (SRAM) is fast, less dense because each bit needs more transistors, and used mainly for cache; the slides also say it consumes less power. Dynamic RAM (DRAM) stores a bit in a transistor and capacitor. The capacitor leaks its charge, so DRAM must be refreshed periodically. It is cheaper but slower than SRAM and is used mainly for main memory.
| Type | Cell and behaviour | Main use in the lecture |
|---|---|---|
| SRAM | More transistors per bit; faster, less dense, lower power | Cache |
| DRAM | Transistor and capacitor; needs periodic refresh | Main memory |
Worked example
A program, its data, and pointers to both can all be represented as binary values.
- CPU instructions, data values, and addresses all use binary storage. §5.1
Trap: state the addressable unit, width, and byte order before calculating. Do not treat a qualitative lecture comparison as a fixed hardware specification.
Compare the memory hierarchy in the lab
Near miss: DRAM holds data for as long as the computer runs, so it can seem permanent, but it is volatile: it needs power and constant refreshing, and switching off loses its contents, unlike flash storage.
Explore SRAM and DRAM in the lab
Recall check · answer without looking
- Why can a computer use a small amount of fast memory together with much larger, slower storage?
- Name three things memory can store.
- Which RAM type is used mainly for cache, and which for main memory?
- Why does DRAM need refreshing, and how does its speed compare with SRAM?
Check these answers
- Fast memory serves immediate work while larger, slower devices retain more data at lower cost. The hierarchy balances competing properties.
- Data, CPU instructions, and memory addresses.
- SRAM is used mainly for cache; DRAM is used mainly for main memory.
- The DRAM capacitor leaks charge, so it must be refreshed. DRAM is cheaper but slower than SRAM.
5.2 RAM cells, addressing, and capacity
A memory needs a way to identify locations and a unit that each address selects.
In plain words: think of memory as a table of numbered rows. The address is the row number, and each row holds a fixed number of bits, the addressable unit (often one byte). With k address bits you can number 2k rows, so the capacity is the number of rows times the bits per row.
RAM can be modelled as R rows of W bits: total capacity is R×W bits. Byte-addressable memory assigns one address to each byte; word-addressable memory assigns one address to each processor word. For n address bits there are 2n distinct addresses. If each address selects one byte, capacity is 2n bytes. The slides use binary capacity units: 1 KB=210 bytes, 1 MB=220, 1 GB=230, 1 TB=240.
Worked example
The lecture’s 1GB example has 256M rows × 32 bits = 8,192M bits = 1,024M bytes = 1 GiB (binary units).
- 256M rows times 4 bytes per row equals 1,024M bytes. §5.2
Trap: state the addressable unit, width, and byte order before calculating. Do not treat a qualitative lecture comparison as a fixed hardware specification.
Near miss: a 16-bit address looks as if it should give 16 rows, but it gives 216 = 65 536 rows: each extra address bit doubles the count.
Count addresses and capacity in the lab
Recall check · answer without looking
- Why does byte addressing make the address increment by one byte?
- A RAM has 256M rows, 32 bits per row. How many bytes is this?
Check these answers
- Each distinct address selects one byte, so consecutive addresses select consecutive bytes. A word may span several byte addresses.
- 256M×32 bits = 256M×4 bytes = 1,024M bytes = 1 GiB using binary M.
5.3 Endianness and aligned access
When a value spans multiple bytes, the byte order determines what appears at increasing addresses.
In plain words: a number wider than one byte is spread over several addresses, so the order of its bytes needs a rule. Big-endian puts the most significant byte first, at the lowest address, the way we write numbers; little-endian puts the least significant byte first.
Big-endian stores the most significant byte first; little-endian stores the least significant byte first. Endianness changes the order of bytes in one multi-byte item, not the bit order inside each byte. A character string treated as individual ASCII bytes therefore retains its character order. Some architectures prohibit unaligned multi-byte accesses; the lecture identifies this as architecture-dependent.
Worked example
A 16-bit value A9A1 beginning at byte address 2 is aligned in the slide’s example; F021 beginning at address 7 is unaligned.
- Determine alignment from the access width and starting address; the lecture’s examples contrast 2 with 7. §5.3
Trap: state the addressable unit, width, and byte order before calculating. Do not treat a qualitative lecture comparison as a fixed hardware specification.
Near miss: 0x12345678 stored little-endian from address 100 puts 0x78 at 100 and 0x12 at 103, so the bytes in address order read 78 56 34 12. That looks backwards, but it is the same value read with the other rule.
Recall check · answer without looking
- How would the bytes of 0x54BCFE30 appear from low to high addresses in each format?
- Store the 16-bit value 0x0005 at address 24. What is at address 25 in each format?
Check these answers
- Big-endian: 54 BC FE 30. Little-endian: 30 FE BC 54.
- Big-endian: 05. Little-endian: 00.
5.4 Memory chips and modules
Chip organisation connects a chip’s row count and data width to the capacity and width of a module.
In plain words: a memory chip is a grid of rows, each a few bits wide. Larger memories combine chips: side by side to widen the data path, or added rows to hold more. A module’s capacity is simply the total of its chips’ bits.
A chip described as 128M×8 stores 128M rows of 8 bits, or 128 MB using the lecture’s binary convention. Chips can be combined in parallel to widen a module, and multiple banks/modules can build larger capacity. The slides show a 1GB (256M×32-bit) memory assembled from alternative combinations of chips and modules.
| Modules | Chips in each module | Module capacity | Total |
|---|---|---|---|
| 2 | 2 × 128M×16 | 512 MiB | 1 GiB |
| 2 | 4 × 128M×8 | 512 MiB | 1 GiB |
| 4 | 2 × 64M×16 | 256 MiB | 1 GiB |
| 4 | 4 × 64M×8 | 256 MiB | 1 GiB |
Worked example
Four 128M×8 chips provide 128M rows of 32 bits, or 512 MiB. Two such modules provide 1 GiB.
- Width combines in parallel; module capacity is rows times total width. §5.4
Trap: state the addressable unit, width, and byte order before calculating. Do not treat a qualitative lecture comparison as a fixed hardware specification.
Near miss: a 1M × 4 chip looks like 4 MB, but it holds 1M rows of 4 bits, which is 4 Mbit = 512 KB, because a byte is 8 bits. Divide by 8 before writing bytes.
Build a memory module in the lab
Recall check · answer without looking
- How can four 128M×8 chips provide a 128M×32-bit module?
- How many 64M×16 chips provide 256 MiB?
Check these answers
- Place the four chips in parallel: their row addresses align and their widths add to 32 bits. Capacity is 128M×32 bits = 512 MiB.
- Two chips make 64M×32 bits = 256 MiB.
5.5 Memory interleaving
Interleaving assigns addresses across modules so independent modules can serve requests in parallel.
In plain words: interleaving divides the addresses between several memory modules, and which address bits choose the module decides how. Take the module bits from the low end of the address (low-order interleaving) and consecutive addresses are dealt round the modules like cards round a table: while one module is still busy, the next address is already in another that can start straight away. Take them from the high end and each module holds one large block of consecutive addresses.
The lecture’s example has 4M words, each 32 bits, built from four 1M×32 modules. A 22-bit word address splits into 2 module bits and 20 row bits. High-order interleaving places module bits at the high end: consecutive addresses stay in one module for a large region. Low-order interleaving places module bits at the low end: consecutive addresses cycle across modules, supporting parallel access to adjacent data.
Worked example
Low-order interleaving sends adjacent addresses to different modules; high-order interleaving groups a large contiguous range in one module.
- The address-bit positions determine whether nearby addresses are distributed or grouped. §5.5
Trap: state the addressable unit, width, and byte order before calculating. Do not treat a qualitative lecture comparison as a fixed hardware specification.
Near miss: high-order interleaving also splits memory across four modules, but with the module bits at the top of the address, a run of consecutive addresses stays inside one module, so reading them gets no parallel speed-up. For that, the module bits must come from the low end: low-order interleaving.
Map interleaved addresses in the lab
Recall check · answer without looking
- For low-order interleaving over four modules, where do addresses 8, 9, 10, and 11 go?
- For high-order interleaving, which module contains addresses 0–3?
Check these answers
- Modules 0, 1, 2, and 3 respectively; each selects row 2.
- Module 0, with rows 0–3.
Formula map and units
| Relation | Unit / meaning |
|---|---|
| Capacity = rows × bits per row | bits; divide by 8 for bytes |
| n address bits → 2n addresses | locations |
| Byte-addressable capacity = 2n bytes | bytes |
| Address bits = module bits + row bits | bits |
| 1 KB=210 bytes; 1 MB=220; 1 GB=230; 1 TB=240 | binary units used in the lecture |
Check every answer: distinguish bits from bytes; state the addressable unit; confirm the number of module and row bits sums to the address width.
Derive it cold
- Derive the byte capacity of an R×W-bit memory. §5.2
- Derive the maximum capacity of n-bit byte addressing. §5.2
- Derive module and row bit counts for four 1M×32 modules. §5.5
- Derive the capacity of four parallel 128M×8 chips. §5.4
Explain it
- Why are several memory types used instead of only the fastest one?
- When does endianness affect the representation of a value?
- Why do four 8-bit chips combine to make a 32-bit data path?
- Why can low-order interleaving improve sequential access?
- When does high-order interleaving fit the lecture’s use case?
- Why must a capacity calculation state whether it counts bits or bytes?
Show model answers
- Fast memory is costly and limited in capacity, while slower storage is larger and cheaper. A hierarchy balances these properties. §5.1
- When a value spans multiple bytes; the convention determines which byte is at the lowest address. §5.3
- All chips use the same row address while each supplies a different 8-bit slice, giving 32 bits total. §5.4
- Adjacent words map to different modules, which may serve their requests in parallel. §5.5
- When independent units access different modules, so requests can proceed in parallel. §5.5
- A bit count is eight times a byte count; omitting the unit can create an eightfold error. §5.2
Mixed practice
Try all 21 problems before showing the answers. The order mixes hierarchy, addressing, byte layout, chip sizing, and interleaving; choose the method yourself.
- A four-bit address selects how many locations?
- A 32-bit value is 54 BC FE 30. Give its byte order at increasing addresses in little-endian memory.
- A 16M×8 chip stores how many bytes?
- Name two volatile memories from the lecture’s hierarchy.
- For low-order interleaving across four modules, which module receives word address 15?
- A 64-bit byte-addressed machine has how many byte addresses and what capacity do they represent?
- Write the bytes of 0x0005 at addresses 24 and 25 in big-endian order.
- How many 128M×8 chips are needed for a 128M×32 module?
- Which is generally faster in the lecture’s hierarchy: registers or a hard disk?
- For high-order interleaving with four modules, give module and row for address 220.
- A memory has 2K rows of 16 bits. What is its capacity in bytes?
- In big-endian storage, which byte is at the lowest address: MSB or LSB?
- What is the capacity of a 64M×8 chip?
- Why can neighbouring instruction fetches benefit from low-order interleaving?
- Does removing power preserve RAM contents according to the slides?
- What capacity is represented by 230 bytes using the lecture’s units?
- What does 256M×32 mean in the 1GB memory example?
- For low-order interleaving, where do addresses 0, 1, 2, 3 go?
- Does an ASCII string’s character order reverse in little-endian memory in the lecture example? Explain.
- Which is larger: 1 TB or 1 GB, and by what factor under the lecture’s definitions?
- Which statements distinguish SRAM from DRAM in the lecture?
Show worked answers
- 24 = 16 locations. §5.2
- 30 FE BC 54. The least significant byte is stored first. §5.3
- 16M bytes (binary convention). §5.4
- CPU registers and RAM. §5.1
- Module 3, because the low two address bits select the module (15 mod 4 = 3). §5.5
- 264 byte addresses, corresponding to 264 bytes = 16 EiB. This extrapolates the lecture’s 32-bit example using the same rule. §5.2
- Address 24: 00; address 25: 05. §5.3
- Four chips in parallel; each contributes 8 of the 32 bits. §5.4
- Registers; the slide gives under 1 ns for registers and 5–10 ms for a hard disk. These are illustrative lecture ranges. §5.1
- Module 1, row 0: the top two of the 22 bits select module 1 and the remaining 20 bits are zero. §5.5
- 2K×16÷8 = 4K bytes = 4 KiB. §5.2
- The most significant byte (MSB). §5.3
- 64M×8÷8 = 64 MiB. §5.4
- Consecutive addresses map to different modules, allowing parallel service if the memory system supports it. §5.5
- No. RAM contents are volatile and are lost when power is removed. §5.1
- 1 GB (binary: 1 GiB). §5.2
- 256M rows, each 32 bits wide; total 1,024M bytes = 1 GiB. §5.4
- Modules 0, 1, 2, 3, each at row 0. §5.5
- No. Each character is one byte, so the byte sequence remains the same; endianness affects byte order within multi-byte values. §5.3
- 1 TB is larger by 210 = 1,024, since 240/230 = 210. §5.2
- SRAM is faster, less dense, lower power, and used mainly for cache. DRAM is cheaper, slower, uses a transistor-capacitor cell that needs refresh, and is used mainly for main memory. §5.1
Exam-style problems
1 · Build and read a memory module · 20 minutes
A system has 4M words of 32 bits, built from four 1M×32 modules. It is byte-addressable and uses low-order interleaving.
- How many address bits are needed for all words?
- How many module bits and row bits are used?
- Which module and row receive word addresses 0 through 7?
- Explain why sequential access may benefit.
Show the worked answer
- 4M=222 words, so 22 word-address bits are needed. Each word is 4 bytes, so byte addresses would require 24 bits if byte-addressing the entire space. §5.2
- For the lecture’s word-addressed interleave example, 2 bits select one of four modules and 20 bits select the row. §5.5
- Using word addresses 0–7: modules cycle 0,1,2,3,0,1,2,3, with row 0 for the first four and row 1 for the next four. §5.5
- Adjacent words are in different modules, so a capable memory system may overlap accesses. §5.5
2 · Endian bytes and capacity · 20 minutes
The 32-bit value 0x54BCFE30 begins at byte address 24 in a byte-addressable memory.
- List the four bytes at addresses 24–27 in big-endian order.
- List them in little-endian order.
- How many bits are needed to address 4 GiB of byte-addressable memory?
- State the capacity of a 256M×32-bit memory.
Show the worked answer
- 54, BC, FE, 30. The most significant byte is first. §5.3
- 30, FE, BC, 54. The least significant byte is first. §5.3
- 4 GiB=232 bytes, so 32 address bits are required. §5.2
- 256M×32÷8=1,024M bytes=1 GiB. §5.4
Self-check
Tick a skill only in a later session, at least one day after studying, when you can demonstrate it without notes.
Personal study guide based on the supplied “05_memory_organisation.pdf” (42 slides, lecture dated 29 April 2024), written in my own words; no lecture pages or figures are reproduced. Not an official FAU publication; check course details against the current notes. Made by Thanate Amornjiraporn (Focus).