01How Computers Work (online)

Fully solved problem book

ALU and condition flags

Set 7 of 10 · 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.

ALU diagnostics · Problem 0193

For A=10101101 and B=01001010, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10101101 and B=01001010 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 173 + 74 = 247.
  4. Reduce the result modulo 256: 247.
  5. The eight output bits are 11110111.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -83 and 74; their true signed result is -9.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -9 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11110111; they help later control logic interpret the outcome.

Final answer: 11110111; Z0 N1 C0 V0

ALU diagnostics · Problem 0194

For A=10101111 and B=01000110, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10101111 and B=01000110 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 175 + 70 = 245.
  4. Reduce the result modulo 256: 245.
  5. The eight output bits are 11110101.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -81 and 70; their true signed result is -11.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -11 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11110101; they help later control logic interpret the outcome.

Final answer: 11110101; Z0 N1 C0 V0

ALU diagnostics · Problem 0195

For A=10110000 and B=10000101, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110000 and B=10000101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 176 + 133 = 309.
  4. Reduce the result modulo 256: 53.
  5. The eight output bits are 00110101.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -80 and -123; their true signed result is -203.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -203 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 00110101; they help later control logic interpret the outcome.

Final answer: 00110101; Z0 N0 C1 V1

ALU diagnostics · Problem 0196

For A=10110000 and B=10001100, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110000 and B=10001100 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 176 + 140 = 316.
  4. Reduce the result modulo 256: 60.
  5. The eight output bits are 00111100.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -80 and -116; their true signed result is -196.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -196 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 00111100; they help later control logic interpret the outcome.

Final answer: 00111100; Z0 N0 C1 V1

ALU diagnostics · Problem 0197

For A=10110001 and B=01101101, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110001 and B=01101101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 177 + 109 = 286.
  4. Reduce the result modulo 256: 30.
  5. The eight output bits are 00011110.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -79 and 109; their true signed result is 30.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 30 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00011110; they help later control logic interpret the outcome.

Final answer: 00011110; Z0 N0 C1 V0

ALU diagnostics · Problem 0198

For A=10110001 and B=10000101, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110001 and B=10000101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 177 + 133 = 310.
  4. Reduce the result modulo 256: 54.
  5. The eight output bits are 00110110.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -79 and -123; their true signed result is -202.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -202 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 00110110; they help later control logic interpret the outcome.

Final answer: 00110110; Z0 N0 C1 V1

ALU diagnostics · Problem 0199

For A=10110011 and B=00100000, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110011 and B=00100000 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 179 − 32 = 147.
  4. Reduce the result modulo 256: 147.
  5. The eight output bits are 10010011.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -77 and 32; their true signed result is -109.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -109 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10010011; they help later control logic interpret the outcome.

Final answer: 10010011; Z0 N1 C1 V0

ALU diagnostics · Problem 0200

For A=10110011 and B=11011011, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110011 and B=11011011 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 179 − 219 = -40.
  4. Reduce the result modulo 256: 216.
  5. The eight output bits are 11011000.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -77 and -37; their true signed result is -40.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -40 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11011000; they help later control logic interpret the outcome.

Final answer: 11011000; Z0 N1 C0 V0

ALU diagnostics · Problem 0201

For A=10110100 and B=00101001, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110100 and B=00101001 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 180 − 41 = 139.
  4. Reduce the result modulo 256: 139.
  5. The eight output bits are 10001011.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -76 and 41; their true signed result is -117.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -117 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10001011; they help later control logic interpret the outcome.

Final answer: 10001011; Z0 N1 C1 V0

ALU diagnostics · Problem 0202

For A=10110100 and B=11101011, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110100 and B=11101011 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 180 + 235 = 415.
  4. Reduce the result modulo 256: 159.
  5. The eight output bits are 10011111.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -76 and -21; their true signed result is -97.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -97 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10011111; they help later control logic interpret the outcome.

Final answer: 10011111; Z0 N1 C1 V0

ALU diagnostics · Problem 0203

For A=10110101 and B=00110011, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110101 and B=00110011 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 181 + 51 = 232.
  4. Reduce the result modulo 256: 232.
  5. The eight output bits are 11101000.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -75 and 51; their true signed result is -24.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -24 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11101000; they help later control logic interpret the outcome.

Final answer: 11101000; Z0 N1 C0 V0

ALU diagnostics · Problem 0204

For A=10110101 and B=01100011, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110101 and B=01100011 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 181 + 99 = 280.
  4. Reduce the result modulo 256: 24.
  5. The eight output bits are 00011000.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -75 and 99; their true signed result is 24.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 24 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00011000; they help later control logic interpret the outcome.

Final answer: 00011000; Z0 N0 C1 V0

ALU diagnostics · Problem 0205

For A=10110101 and B=10001111, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110101 and B=10001111 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 181 + 143 = 324.
  4. Reduce the result modulo 256: 68.
  5. The eight output bits are 01000100.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -75 and -113; their true signed result is -188.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -188 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01000100; they help later control logic interpret the outcome.

Final answer: 01000100; Z0 N0 C1 V1

ALU diagnostics · Problem 0206

For A=10110101 and B=10101110, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110101 and B=10101110 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 181 + 174 = 355.
  4. Reduce the result modulo 256: 99.
  5. The eight output bits are 01100011.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -75 and -82; their true signed result is -157.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -157 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01100011; they help later control logic interpret the outcome.

Final answer: 01100011; Z0 N0 C1 V1

ALU diagnostics · Problem 0207

For A=10110110 and B=10000110, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110110 and B=10000110 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 182 + 134 = 316.
  4. Reduce the result modulo 256: 60.
  5. The eight output bits are 00111100.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -74 and -122; their true signed result is -196.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -196 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 00111100; they help later control logic interpret the outcome.

Final answer: 00111100; Z0 N0 C1 V1

ALU diagnostics · Problem 0208

For A=10110110 and B=10101110, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110110 and B=10101110 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 182 + 174 = 356.
  4. Reduce the result modulo 256: 100.
  5. The eight output bits are 01100100.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -74 and -82; their true signed result is -156.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -156 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01100100; they help later control logic interpret the outcome.

Final answer: 01100100; Z0 N0 C1 V1

ALU diagnostics · Problem 0209

For A=10110110 and B=11001000, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110110 and B=11001000 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 182 − 200 = -18.
  4. Reduce the result modulo 256: 238.
  5. The eight output bits are 11101110.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -74 and -56; their true signed result is -18.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -18 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11101110; they help later control logic interpret the outcome.

Final answer: 11101110; Z0 N1 C0 V0

ALU diagnostics · Problem 0210

For A=10110111 and B=01001010, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110111 and B=01001010 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 183 − 74 = 109.
  4. Reduce the result modulo 256: 109.
  5. The eight output bits are 01101101.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -73 and 74; their true signed result is -147.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -147 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01101101; they help later control logic interpret the outcome.

Final answer: 01101101; Z0 N0 C1 V1

ALU diagnostics · Problem 0211

For A=10110111 and B=01111111, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10110111 and B=01111111 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 183 − 127 = 56.
  4. Reduce the result modulo 256: 56.
  5. The eight output bits are 00111000.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -73 and 127; their true signed result is -200.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -200 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 00111000; they help later control logic interpret the outcome.

Final answer: 00111000; Z0 N0 C1 V1

ALU diagnostics · Problem 0212

For A=10111100 and B=11000010, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10111100 and B=11000010 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 188 + 194 = 382.
  4. Reduce the result modulo 256: 126.
  5. The eight output bits are 01111110.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -68 and -62; their true signed result is -130.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -130 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01111110; they help later control logic interpret the outcome.

Final answer: 01111110; Z0 N0 C1 V1

ALU diagnostics · Problem 0213

For A=10111101 and B=01101000, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10111101 and B=01101000 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 189 + 104 = 293.
  4. Reduce the result modulo 256: 37.
  5. The eight output bits are 00100101.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -67 and 104; their true signed result is 37.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 37 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00100101; they help later control logic interpret the outcome.

Final answer: 00100101; Z0 N0 C1 V0

ALU diagnostics · Problem 0214

For A=10111110 and B=01101000, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10111110 and B=01101000 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 190 − 104 = 86.
  4. Reduce the result modulo 256: 86.
  5. The eight output bits are 01010110.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -66 and 104; their true signed result is -170.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -170 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01010110; they help later control logic interpret the outcome.

Final answer: 01010110; Z0 N0 C1 V1

ALU diagnostics · Problem 0215

For A=10111110 and B=11010001, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10111110 and B=11010001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 190 + 209 = 399.
  4. Reduce the result modulo 256: 143.
  5. The eight output bits are 10001111.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -66 and -47; their true signed result is -113.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -113 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10001111; they help later control logic interpret the outcome.

Final answer: 10001111; Z0 N1 C1 V0

ALU diagnostics · Problem 0216

For A=10111111 and B=00000001, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10111111 and B=00000001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 191 + 1 = 192.
  4. Reduce the result modulo 256: 192.
  5. The eight output bits are 11000000.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -65 and 1; their true signed result is -64.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -64 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11000000; they help later control logic interpret the outcome.

Final answer: 11000000; Z0 N1 C0 V0

ALU diagnostics · Problem 0217

For A=10111111 and B=11001001, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=10111111 and B=11001001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 191 + 201 = 392.
  4. Reduce the result modulo 256: 136.
  5. The eight output bits are 10001000.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -65 and -55; their true signed result is -120.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -120 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10001000; they help later control logic interpret the outcome.

Final answer: 10001000; Z0 N1 C1 V0

ALU diagnostics · Problem 0218

For A=11000000 and B=00011101, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=11000000 and B=00011101 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 192 − 29 = 163.
  4. Reduce the result modulo 256: 163.
  5. The eight output bits are 10100011.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -64 and 29; their true signed result is -93.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -93 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10100011; they help later control logic interpret the outcome.

Final answer: 10100011; Z0 N1 C1 V0

ALU diagnostics · Problem 0219

For A=11000000 and B=01001110, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=11000000 and B=01001110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 192 − 78 = 114.
  4. Reduce the result modulo 256: 114.
  5. The eight output bits are 01110010.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -64 and 78; their true signed result is -142.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -142 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01110010; they help later control logic interpret the outcome.

Final answer: 01110010; Z0 N0 C1 V1

ALU diagnostics · Problem 0220

For A=11000000 and B=01011101, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=11000000 and B=01011101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 192 + 93 = 285.
  4. Reduce the result modulo 256: 29.
  5. The eight output bits are 00011101.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -64 and 93; their true signed result is 29.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 29 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00011101; they help later control logic interpret the outcome.

Final answer: 00011101; Z0 N0 C1 V0

ALU diagnostics · Problem 0221

For A=11000010 and B=01001101, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=11000010 and B=01001101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 194 + 77 = 271.
  4. Reduce the result modulo 256: 15.
  5. The eight output bits are 00001111.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -62 and 77; their true signed result is 15.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 15 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00001111; they help later control logic interpret the outcome.

Final answer: 00001111; Z0 N0 C1 V0

ALU diagnostics · Problem 0222

For A=11000011 and B=01011011, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=11000011 and B=01011011 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 195 + 91 = 286.
  4. Reduce the result modulo 256: 30.
  5. The eight output bits are 00011110.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -61 and 91; their true signed result is 30.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 30 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00011110; they help later control logic interpret the outcome.

Final answer: 00011110; Z0 N0 C1 V0

ALU diagnostics · Problem 0223

For A=11000011 and B=10010010, run ADD; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=11000011 and B=10010010 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 195 + 146 = 341.
  4. Reduce the result modulo 256: 85.
  5. The eight output bits are 01010101.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=0, because the most significant output bit is 0.
  8. Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -61 and -110; their true signed result is -171.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -171 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01010101; they help later control logic interpret the outcome.

Final answer: 01010101; Z0 N0 C1 V1

ALU diagnostics · Problem 0224

For A=11000101 and B=11000111, run SUB; find the low byte and Z, N, C, V.

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

Reveal detailed solution →
  1. Treat A=11000101 and B=11000111 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 197 − 199 = -2.
  4. Reduce the result modulo 256: 254.
  5. The eight output bits are 11111110.
  6. Zero flag Z=0, because the stored output is nonzero.
  7. Negative flag N=1, because the most significant output bit is 1.
  8. Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -59 and -57; their true signed result is -2.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -2 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11111110; they help later control logic interpret the outcome.

Final answer: 11111110; Z0 N1 C0 V0