01How Computers Work (online)

Fully solved problem book

RAM addressing

Set 6 of 6 · 20 worked questions. Predict your result before expanding the solution.

These worked traces are meant to build fluency through controlled variation. If several answers feel identical, try the next difficult value and look for the point where a carry, sign, branch, or selected memory address changes the outcome.

State and memory · Problem 0161

RAM[3] initially stores 32. Write 51 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[3] contains 00100000 (32 unsigned).
  4. The CPU puts the four-bit address 0011 on the address lines.
  5. The decoder selects row 3, not row 8.
  6. Write-enable becomes active and the incoming data lines carry 00110011.
  7. The selected stored byte is replaced with 00110011.
  8. The write does not inherently change RAM[8].
  9. A later read of row 3 selects the new contents.
  10. The output data is 00110011, which equals 51 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 51

State and memory · Problem 0162

RAM[10] initially stores 45. Write 88 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[10] contains 00101101 (45 unsigned).
  4. The CPU puts the four-bit address 1010 on the address lines.
  5. The decoder selects row 10, not row 15.
  6. Write-enable becomes active and the incoming data lines carry 01011000.
  7. The selected stored byte is replaced with 01011000.
  8. The write does not inherently change RAM[15].
  9. A later read of row 10 selects the new contents.
  10. The output data is 01011000, which equals 88 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 88

State and memory · Problem 0163

RAM[1] initially stores 58. Write 125 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[1] contains 00111010 (58 unsigned).
  4. The CPU puts the four-bit address 0001 on the address lines.
  5. The decoder selects row 1, not row 6.
  6. Write-enable becomes active and the incoming data lines carry 01111101.
  7. The selected stored byte is replaced with 01111101.
  8. The write does not inherently change RAM[6].
  9. A later read of row 1 selects the new contents.
  10. The output data is 01111101, which equals 125 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 125

State and memory · Problem 0164

RAM[8] initially stores 71. Write 162 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[8] contains 01000111 (71 unsigned).
  4. The CPU puts the four-bit address 1000 on the address lines.
  5. The decoder selects row 8, not row 13.
  6. Write-enable becomes active and the incoming data lines carry 10100010.
  7. The selected stored byte is replaced with 10100010.
  8. The write does not inherently change RAM[13].
  9. A later read of row 8 selects the new contents.
  10. The output data is 10100010, which equals 162 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 162

State and memory · Problem 0165

RAM[15] initially stores 84. Write 199 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[15] contains 01010100 (84 unsigned).
  4. The CPU puts the four-bit address 1111 on the address lines.
  5. The decoder selects row 15, not row 4.
  6. Write-enable becomes active and the incoming data lines carry 11000111.
  7. The selected stored byte is replaced with 11000111.
  8. The write does not inherently change RAM[4].
  9. A later read of row 15 selects the new contents.
  10. The output data is 11000111, which equals 199 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 199

State and memory · Problem 0166

RAM[6] initially stores 97. Write 236 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[6] contains 01100001 (97 unsigned).
  4. The CPU puts the four-bit address 0110 on the address lines.
  5. The decoder selects row 6, not row 11.
  6. Write-enable becomes active and the incoming data lines carry 11101100.
  7. The selected stored byte is replaced with 11101100.
  8. The write does not inherently change RAM[11].
  9. A later read of row 6 selects the new contents.
  10. The output data is 11101100, which equals 236 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 236

State and memory · Problem 0167

RAM[13] initially stores 110. Write 17 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[13] contains 01101110 (110 unsigned).
  4. The CPU puts the four-bit address 1101 on the address lines.
  5. The decoder selects row 13, not row 2.
  6. Write-enable becomes active and the incoming data lines carry 00010001.
  7. The selected stored byte is replaced with 00010001.
  8. The write does not inherently change RAM[2].
  9. A later read of row 13 selects the new contents.
  10. The output data is 00010001, which equals 17 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 17

State and memory · Problem 0168

RAM[4] initially stores 123. Write 54 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[4] contains 01111011 (123 unsigned).
  4. The CPU puts the four-bit address 0100 on the address lines.
  5. The decoder selects row 4, not row 9.
  6. Write-enable becomes active and the incoming data lines carry 00110110.
  7. The selected stored byte is replaced with 00110110.
  8. The write does not inherently change RAM[9].
  9. A later read of row 4 selects the new contents.
  10. The output data is 00110110, which equals 54 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 54

State and memory · Problem 0169

RAM[11] initially stores 136. Write 91 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[11] contains 10001000 (136 unsigned).
  4. The CPU puts the four-bit address 1011 on the address lines.
  5. The decoder selects row 11, not row 0.
  6. Write-enable becomes active and the incoming data lines carry 01011011.
  7. The selected stored byte is replaced with 01011011.
  8. The write does not inherently change RAM[0].
  9. A later read of row 11 selects the new contents.
  10. The output data is 01011011, which equals 91 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 91

State and memory · Problem 0170

RAM[2] initially stores 149. Write 128 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[2] contains 10010101 (149 unsigned).
  4. The CPU puts the four-bit address 0010 on the address lines.
  5. The decoder selects row 2, not row 7.
  6. Write-enable becomes active and the incoming data lines carry 10000000.
  7. The selected stored byte is replaced with 10000000.
  8. The write does not inherently change RAM[7].
  9. A later read of row 2 selects the new contents.
  10. The output data is 10000000, which equals 128 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 128

State and memory · Problem 0171

RAM[9] initially stores 162. Write 165 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[9] contains 10100010 (162 unsigned).
  4. The CPU puts the four-bit address 1001 on the address lines.
  5. The decoder selects row 9, not row 14.
  6. Write-enable becomes active and the incoming data lines carry 10100101.
  7. The selected stored byte is replaced with 10100101.
  8. The write does not inherently change RAM[14].
  9. A later read of row 9 selects the new contents.
  10. The output data is 10100101, which equals 165 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 165

State and memory · Problem 0172

RAM[0] initially stores 175. Write 202 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[0] contains 10101111 (175 unsigned).
  4. The CPU puts the four-bit address 0000 on the address lines.
  5. The decoder selects row 0, not row 5.
  6. Write-enable becomes active and the incoming data lines carry 11001010.
  7. The selected stored byte is replaced with 11001010.
  8. The write does not inherently change RAM[5].
  9. A later read of row 0 selects the new contents.
  10. The output data is 11001010, which equals 202 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 202

State and memory · Problem 0173

RAM[7] initially stores 188. Write 239 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[7] contains 10111100 (188 unsigned).
  4. The CPU puts the four-bit address 0111 on the address lines.
  5. The decoder selects row 7, not row 12.
  6. Write-enable becomes active and the incoming data lines carry 11101111.
  7. The selected stored byte is replaced with 11101111.
  8. The write does not inherently change RAM[12].
  9. A later read of row 7 selects the new contents.
  10. The output data is 11101111, which equals 239 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 239

State and memory · Problem 0174

RAM[14] initially stores 201. Write 20 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[14] contains 11001001 (201 unsigned).
  4. The CPU puts the four-bit address 1110 on the address lines.
  5. The decoder selects row 14, not row 3.
  6. Write-enable becomes active and the incoming data lines carry 00010100.
  7. The selected stored byte is replaced with 00010100.
  8. The write does not inherently change RAM[3].
  9. A later read of row 14 selects the new contents.
  10. The output data is 00010100, which equals 20 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 20

State and memory · Problem 0175

RAM[5] initially stores 214. Write 57 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[5] contains 11010110 (214 unsigned).
  4. The CPU puts the four-bit address 0101 on the address lines.
  5. The decoder selects row 5, not row 10.
  6. Write-enable becomes active and the incoming data lines carry 00111001.
  7. The selected stored byte is replaced with 00111001.
  8. The write does not inherently change RAM[10].
  9. A later read of row 5 selects the new contents.
  10. The output data is 00111001, which equals 57 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 57

State and memory · Problem 0176

RAM[12] initially stores 227. Write 94 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[12] contains 11100011 (227 unsigned).
  4. The CPU puts the four-bit address 1100 on the address lines.
  5. The decoder selects row 12, not row 1.
  6. Write-enable becomes active and the incoming data lines carry 01011110.
  7. The selected stored byte is replaced with 01011110.
  8. The write does not inherently change RAM[1].
  9. A later read of row 12 selects the new contents.
  10. The output data is 01011110, which equals 94 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 94

State and memory · Problem 0177

RAM[3] initially stores 240. Write 131 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[3] contains 11110000 (240 unsigned).
  4. The CPU puts the four-bit address 0011 on the address lines.
  5. The decoder selects row 3, not row 8.
  6. Write-enable becomes active and the incoming data lines carry 10000011.
  7. The selected stored byte is replaced with 10000011.
  8. The write does not inherently change RAM[8].
  9. A later read of row 3 selects the new contents.
  10. The output data is 10000011, which equals 131 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 131

State and memory · Problem 0178

RAM[10] initially stores 253. Write 168 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[10] contains 11111101 (253 unsigned).
  4. The CPU puts the four-bit address 1010 on the address lines.
  5. The decoder selects row 10, not row 15.
  6. Write-enable becomes active and the incoming data lines carry 10101000.
  7. The selected stored byte is replaced with 10101000.
  8. The write does not inherently change RAM[15].
  9. A later read of row 10 selects the new contents.
  10. The output data is 10101000, which equals 168 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 168

State and memory · Problem 0179

RAM[1] initially stores 10. Write 205 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[1] contains 00001010 (10 unsigned).
  4. The CPU puts the four-bit address 0001 on the address lines.
  5. The decoder selects row 1, not row 6.
  6. Write-enable becomes active and the incoming data lines carry 11001101.
  7. The selected stored byte is replaced with 11001101.
  8. The write does not inherently change RAM[6].
  9. A later read of row 1 selects the new contents.
  10. The output data is 11001101, which equals 205 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 205

State and memory · Problem 0180

RAM[8] initially stores 23. Write 242 there, then read the same location. What returns?

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. The machine models 16 byte-wide addresses: 0–15.
  2. Each location stores an eight-bit data word.
  3. At the start, RAM[8] contains 00010111 (23 unsigned).
  4. The CPU puts the four-bit address 1000 on the address lines.
  5. The decoder selects row 8, not row 13.
  6. Write-enable becomes active and the incoming data lines carry 11110010.
  7. The selected stored byte is replaced with 11110010.
  8. The write does not inherently change RAM[13].
  9. A later read of row 8 selects the new contents.
  10. The output data is 11110010, which equals 242 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 242