01How Computers Work

Fully solved problem book

RAM addressing

Set 2 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 0033

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

Final answer: 179

State and memory · Problem 0034

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

Final answer: 216

State and memory · Problem 0035

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

Final answer: 253

State and memory · Problem 0036

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

Final answer: 34

State and memory · Problem 0037

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

Final answer: 71

State and memory · Problem 0038

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

Final answer: 108

State and memory · Problem 0039

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

Final answer: 145

State and memory · Problem 0040

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

Final answer: 182

State and memory · Problem 0041

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

Final answer: 219

State and memory · Problem 0042

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

Final answer: 0

State and memory · Problem 0043

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

Final answer: 37

State and memory · Problem 0044

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

Final answer: 74

State and memory · Problem 0045

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

Final answer: 111

State and memory · Problem 0046

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

Final answer: 148

State and memory · Problem 0047

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

Final answer: 185

State and memory · Problem 0048

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

Final answer: 222

State and memory · Problem 0049

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

Final answer: 3

State and memory · Problem 0050

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

Final answer: 40

State and memory · Problem 0051

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

Final answer: 77

State and memory · Problem 0052

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

Final answer: 114

State and memory · Problem 0053

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

Final answer: 151

State and memory · Problem 0054

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

Final answer: 188

State and memory · Problem 0055

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

Final answer: 225

State and memory · Problem 0056

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

Final answer: 6

State and memory · Problem 0057

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

Final answer: 43

State and memory · Problem 0058

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

Final answer: 80

State and memory · Problem 0059

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

Final answer: 117

State and memory · Problem 0060

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

Final answer: 154

State and memory · Problem 0061

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

Final answer: 191

State and memory · Problem 0062

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

Final answer: 228

State and memory · Problem 0063

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

Final answer: 9

State and memory · Problem 0064

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

Final answer: 46