01How Computers Work

Fully solved problem book

RAM addressing

Set 1 of 6 · 32 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 0001

RAM[3] initially stores 0. Write 19 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 00000000 (0 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 00010011.
  7. The selected stored byte is replaced with 00010011.
  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 00010011, which equals 19 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 19

State and memory · Problem 0002

RAM[10] initially stores 13. Write 56 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 00001101 (13 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 00111000.
  7. The selected stored byte is replaced with 00111000.
  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 00111000, which equals 56 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 56

State and memory · Problem 0003

RAM[1] initially stores 26. Write 93 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 00011010 (26 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 01011101.
  7. The selected stored byte is replaced with 01011101.
  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 01011101, which equals 93 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 93

State and memory · Problem 0004

RAM[8] initially stores 39. Write 130 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 00100111 (39 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 10000010.
  7. The selected stored byte is replaced with 10000010.
  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 10000010, which equals 130 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 130

State and memory · Problem 0005

RAM[15] initially stores 52. Write 167 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 00110100 (52 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 10100111.
  7. The selected stored byte is replaced with 10100111.
  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 10100111, which equals 167 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 167

State and memory · Problem 0006

RAM[6] initially stores 65. Write 204 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 01000001 (65 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 11001100.
  7. The selected stored byte is replaced with 11001100.
  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 11001100, which equals 204 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 204

State and memory · Problem 0007

RAM[13] initially stores 78. Write 241 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 01001110 (78 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 11110001.
  7. The selected stored byte is replaced with 11110001.
  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 11110001, which equals 241 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 241

State and memory · Problem 0008

RAM[4] initially stores 91. Write 22 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 01011011 (91 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 00010110.
  7. The selected stored byte is replaced with 00010110.
  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 00010110, which equals 22 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 22

State and memory · Problem 0009

RAM[11] initially stores 104. Write 59 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 01101000 (104 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 00111011.
  7. The selected stored byte is replaced with 00111011.
  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 00111011, which equals 59 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 59

State and memory · Problem 0010

RAM[2] initially stores 117. Write 96 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 01110101 (117 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 01100000.
  7. The selected stored byte is replaced with 01100000.
  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 01100000, which equals 96 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 96

State and memory · Problem 0011

RAM[9] initially stores 130. Write 133 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 10000010 (130 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 10000101.
  7. The selected stored byte is replaced with 10000101.
  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 10000101, which equals 133 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 133

State and memory · Problem 0012

RAM[0] initially stores 143. Write 170 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 10001111 (143 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 10101010.
  7. The selected stored byte is replaced with 10101010.
  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 10101010, which equals 170 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 170

State and memory · Problem 0013

RAM[7] initially stores 156. Write 207 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 10011100 (156 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 11001111.
  7. The selected stored byte is replaced with 11001111.
  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 11001111, which equals 207 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 207

State and memory · Problem 0014

RAM[14] initially stores 169. Write 244 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 10101001 (169 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 11110100.
  7. The selected stored byte is replaced with 11110100.
  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 11110100, which equals 244 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 244

State and memory · Problem 0015

RAM[5] initially stores 182. Write 25 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 10110110 (182 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 00011001.
  7. The selected stored byte is replaced with 00011001.
  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 00011001, which equals 25 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 25

State and memory · Problem 0016

RAM[12] initially stores 195. Write 62 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 11000011 (195 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 00111110.
  7. The selected stored byte is replaced with 00111110.
  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 00111110, which equals 62 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 62

State and memory · Problem 0017

RAM[3] initially stores 208. Write 99 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 11010000 (208 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 01100011.
  7. The selected stored byte is replaced with 01100011.
  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 01100011, which equals 99 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 99

State and memory · Problem 0018

RAM[10] initially stores 221. Write 136 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 11011101 (221 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 10001000.
  7. The selected stored byte is replaced with 10001000.
  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 10001000, which equals 136 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 136

State and memory · Problem 0019

RAM[1] initially stores 234. Write 173 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 11101010 (234 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 10101101.
  7. The selected stored byte is replaced with 10101101.
  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 10101101, which equals 173 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 173

State and memory · Problem 0020

RAM[8] initially stores 247. Write 210 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 11110111 (247 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 11010010.
  7. The selected stored byte is replaced with 11010010.
  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 11010010, which equals 210 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 210

State and memory · Problem 0021

RAM[15] initially stores 4. Write 247 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 00000100 (4 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 11110111.
  7. The selected stored byte is replaced with 11110111.
  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 11110111, which equals 247 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 247

State and memory · Problem 0022

RAM[6] initially stores 17. Write 28 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 00010001 (17 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 00011100.
  7. The selected stored byte is replaced with 00011100.
  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 00011100, which equals 28 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 28

State and memory · Problem 0023

RAM[13] initially stores 30. Write 65 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 00011110 (30 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 01000001.
  7. The selected stored byte is replaced with 01000001.
  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 01000001, which equals 65 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 65

State and memory · Problem 0024

RAM[4] initially stores 43. Write 102 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 00101011 (43 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 01100110.
  7. The selected stored byte is replaced with 01100110.
  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 01100110, which equals 102 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 102

State and memory · Problem 0025

RAM[11] initially stores 56. Write 139 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 00111000 (56 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 10001011.
  7. The selected stored byte is replaced with 10001011.
  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 10001011, which equals 139 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 139

State and memory · Problem 0026

RAM[2] initially stores 69. Write 176 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 01000101 (69 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 10110000.
  7. The selected stored byte is replaced with 10110000.
  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 10110000, which equals 176 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 176

State and memory · Problem 0027

RAM[9] initially stores 82. Write 213 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 01010010 (82 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 11010101.
  7. The selected stored byte is replaced with 11010101.
  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 11010101, which equals 213 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 213

State and memory · Problem 0028

RAM[0] initially stores 95. Write 250 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 01011111 (95 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 11111010.
  7. The selected stored byte is replaced with 11111010.
  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 11111010, which equals 250 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 250

State and memory · Problem 0029

RAM[7] initially stores 108. Write 31 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 01101100 (108 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 00011111.
  7. The selected stored byte is replaced with 00011111.
  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 00011111, which equals 31 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 31

State and memory · Problem 0030

RAM[14] initially stores 121. Write 68 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 01111001 (121 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 01000100.
  7. The selected stored byte is replaced with 01000100.
  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 01000100, which equals 68 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 68

State and memory · Problem 0031

RAM[5] initially stores 134. Write 105 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 10000110 (134 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 01101001.
  7. The selected stored byte is replaced with 01101001.
  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 01101001, which equals 105 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 105

State and memory · Problem 0032

RAM[12] initially stores 147. Write 142 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 10010011 (147 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 10001110.
  7. The selected stored byte is replaced with 10001110.
  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 10001110, which equals 142 decimal.
  11. The address determines WHERE the information is stored; the data determines WHAT is stored.

Final answer: 142