Skip to content
Tactiverge
  1. Stage 1
  2. Stage 2
  3. Stage 3
  4. Stage 4
  5. Stage 5
  6. Stage 6
  7. Stage 7
  8. Stage 8
  9. Stage 9
  10. Stage 10
  11. Stage 11
  12. Stage 12
  13. Stage 13 (this one)
  14. Stage 14
  15. Stage 15

Explanation

RAM is an array of registers. An address picks one cell: a decoder raises exactly one select line. Reading puts that cell's value on the data bus; writing, when write-enable is 1, stores the bus value into the selected cell on the clock edge.

With n address bits you can reach 2ⁿ cells. Bench-8 has 8-bit addresses, so 256 bytes, holding both the program and its data. A design like that, with one memory for both, is called a von Neumann machine.

A 16-byte RAM

Address = 3

Data in = 42

write-enable

Data out (read) = 99

Cells; the decoder selects exactly one
addrselectvalue
0 (0000)○ 012
1 (0001)○ 07
2 (0010)○ 00
3 (0011)● 199
4 (0100)○ 05
5 (0101)○ 00
6 (0110)○ 00
7 (0111)○ 00
8 (1000)○ 00
9 (1001)○ 00
10 (1010)○ 00
11 (1011)○ 00
12 (1100)○ 00
13 (1101)○ 00
14 (1110)○ 00
15 (1111)○ 00

Check yourself

Marked instantly in your browser. Use the interactive above to work it out.

  1. 1. How many cells can a 10-bit address reach?
  2. 2. Write-enable is 0 and the clock ticks. What happens to the selected cell?