01How Computers Work (online)

Fully solved problem book

ALU and condition flags

Set 8 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 0225

For A=11000110 and B=11110110, 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=11000110 and B=11110110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 198 − 246 = -48.
  4. Reduce the result modulo 256: 208.
  5. The eight output bits are 11010000.
  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 -58 and -10; their true signed result is -48.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -48 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11010000; they help later control logic interpret the outcome.

Final answer: 11010000; Z0 N1 C0 V0

ALU diagnostics · Problem 0226

For A=11000111 and B=11001100, 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=11000111 and B=11001100 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 199 − 204 = -5.
  4. Reduce the result modulo 256: 251.
  5. The eight output bits are 11111011.
  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 -57 and -52; their true signed result is -5.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -5 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11111011; they help later control logic interpret the outcome.

Final answer: 11111011; Z0 N1 C0 V0

ALU diagnostics · Problem 0227

For A=11001000 and B=00000000, 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=11001000 and B=00000000 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 200 + 0 = 200.
  4. Reduce the result modulo 256: 200.
  5. The eight output bits are 11001000.
  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 -56 and 0; their true signed result is -56.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -56 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11001000; they help later control logic interpret the outcome.

Final answer: 11001000; Z0 N1 C0 V0

ALU diagnostics · Problem 0228

For A=11001000 and B=01101111, 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=11001000 and B=01101111 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 200 − 111 = 89.
  4. Reduce the result modulo 256: 89.
  5. The eight output bits are 01011001.
  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 -56 and 111; their true signed result is -167.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -167 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01011001; they help later control logic interpret the outcome.

Final answer: 01011001; Z0 N0 C1 V1

ALU diagnostics · Problem 0229

For A=11001001 and B=00001111, 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=11001001 and B=00001111 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 201 + 15 = 216.
  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 -55 and 15; 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 0230

For A=11001100 and B=01000011, 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=11001100 and B=01000011 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 204 + 67 = 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 -52 and 67; 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 0231

For A=11001100 and B=11110111, 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=11001100 and B=11110111 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 204 + 247 = 451.
  4. Reduce the result modulo 256: 195.
  5. The eight output bits are 11000011.
  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 -52 and -9; their true signed result is -61.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -61 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11000011; they help later control logic interpret the outcome.

Final answer: 11000011; Z0 N1 C1 V0

ALU diagnostics · Problem 0232

For A=11001111 and B=00100100, 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=11001111 and B=00100100 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 207 + 36 = 243.
  4. Reduce the result modulo 256: 243.
  5. The eight output bits are 11110011.
  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 -49 and 36; their true signed result is -13.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -13 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11110011; they help later control logic interpret the outcome.

Final answer: 11110011; Z0 N1 C0 V0

ALU diagnostics · Problem 0233

For A=11001111 and B=00100110, 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=11001111 and B=00100110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 207 − 38 = 169.
  4. Reduce the result modulo 256: 169.
  5. The eight output bits are 10101001.
  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 -49 and 38; their true signed result is -87.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -87 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10101001; they help later control logic interpret the outcome.

Final answer: 10101001; Z0 N1 C1 V0

ALU diagnostics · Problem 0234

For A=11001111 and B=01101110, 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=11001111 and B=01101110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 207 − 110 = 97.
  4. Reduce the result modulo 256: 97.
  5. The eight output bits are 01100001.
  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 -49 and 110; their true signed result is -159.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -159 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01100001; they help later control logic interpret the outcome.

Final answer: 01100001; Z0 N0 C1 V1

ALU diagnostics · Problem 0235

For A=11010000 and B=00000110, 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=11010000 and B=00000110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 208 − 6 = 202.
  4. Reduce the result modulo 256: 202.
  5. The eight output bits are 11001010.
  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 -48 and 6; their true signed result is -54.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -54 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11001010; they help later control logic interpret the outcome.

Final answer: 11001010; Z0 N1 C1 V0

ALU diagnostics · Problem 0236

For A=11010000 and B=01100001, 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=11010000 and B=01100001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 208 + 97 = 305.
  4. Reduce the result modulo 256: 49.
  5. The eight output bits are 00110001.
  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 -48 and 97; their true signed result is 49.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 49 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00110001; they help later control logic interpret the outcome.

Final answer: 00110001; Z0 N0 C1 V0

ALU diagnostics · Problem 0237

For A=11010000 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=11010000 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 208 − 127 = 81.
  4. Reduce the result modulo 256: 81.
  5. The eight output bits are 01010001.
  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 -48 and 127; their true signed result is -175.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -175 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01010001; they help later control logic interpret the outcome.

Final answer: 01010001; Z0 N0 C1 V1

ALU diagnostics · Problem 0238

For A=11010001 and B=00101001, 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=11010001 and B=00101001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 209 + 41 = 250.
  4. Reduce the result modulo 256: 250.
  5. The eight output bits are 11111010.
  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 -47 and 41; their true signed result is -6.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -6 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11111010; they help later control logic interpret the outcome.

Final answer: 11111010; Z0 N1 C0 V0

ALU diagnostics · Problem 0239

For A=11010010 and B=00010110, 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=11010010 and B=00010110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 210 − 22 = 188.
  4. Reduce the result modulo 256: 188.
  5. The eight output bits are 10111100.
  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 -46 and 22; their true signed result is -68.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -68 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10111100; they help later control logic interpret the outcome.

Final answer: 10111100; Z0 N1 C1 V0

ALU diagnostics · Problem 0240

For A=11010010 and B=10010001, 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=11010010 and B=10010001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 210 + 145 = 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 -46 and -111; 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 0241

For A=11010010 and B=10100100, 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=11010010 and B=10100100 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 210 − 164 = 46.
  4. Reduce the result modulo 256: 46.
  5. The eight output bits are 00101110.
  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 -46 and -92; their true signed result is 46.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 46 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00101110; they help later control logic interpret the outcome.

Final answer: 00101110; Z0 N0 C1 V0

ALU diagnostics · Problem 0242

For A=11010011 and B=00010010, 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=11010011 and B=00010010 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 211 − 18 = 193.
  4. Reduce the result modulo 256: 193.
  5. The eight output bits are 11000001.
  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 -45 and 18; their true signed result is -63.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -63 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11000001; they help later control logic interpret the outcome.

Final answer: 11000001; Z0 N1 C1 V0

ALU diagnostics · Problem 0243

For A=11010011 and B=11000100, 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=11010011 and B=11000100 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 211 + 196 = 407.
  4. Reduce the result modulo 256: 151.
  5. The eight output bits are 10010111.
  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 -45 and -60; their true signed result is -105.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -105 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10010111; they help later control logic interpret the outcome.

Final answer: 10010111; Z0 N1 C1 V0

ALU diagnostics · Problem 0244

For A=11010011 and B=11111101, 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=11010011 and B=11111101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 211 + 253 = 464.
  4. Reduce the result modulo 256: 208.
  5. The eight output bits are 11010000.
  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 -45 and -3; their true signed result is -48.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -48 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11010000; they help later control logic interpret the outcome.

Final answer: 11010000; Z0 N1 C1 V0

ALU diagnostics · Problem 0245

For A=11010101 and B=00111000, 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=11010101 and B=00111000 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 213 − 56 = 157.
  4. Reduce the result modulo 256: 157.
  5. The eight output bits are 10011101.
  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 -43 and 56; their true signed result is -99.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -99 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10011101; they help later control logic interpret the outcome.

Final answer: 10011101; Z0 N1 C1 V0

ALU diagnostics · Problem 0246

For A=11010101 and B=00111110, 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=11010101 and B=00111110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 213 − 62 = 151.
  4. Reduce the result modulo 256: 151.
  5. The eight output bits are 10010111.
  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 -43 and 62; their true signed result is -105.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -105 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10010111; they help later control logic interpret the outcome.

Final answer: 10010111; Z0 N1 C1 V0

ALU diagnostics · Problem 0247

For A=11010101 and B=01101010, 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=11010101 and B=01101010 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 213 − 106 = 107.
  4. Reduce the result modulo 256: 107.
  5. The eight output bits are 01101011.
  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 -43 and 106; their true signed result is -149.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result -149 is outside the 8-bit signed range.
  12. The flags do not change the stored byte 01101011; they help later control logic interpret the outcome.

Final answer: 01101011; Z0 N0 C1 V1

ALU diagnostics · Problem 0248

For A=11010101 and B=11011101, 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=11010101 and B=11011101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 213 + 221 = 434.
  4. Reduce the result modulo 256: 178.
  5. The eight output bits are 10110010.
  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 -43 and -35; their true signed result is -78.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -78 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10110010; they help later control logic interpret the outcome.

Final answer: 10110010; Z0 N1 C1 V0

ALU diagnostics · Problem 0249

For A=11010110 and B=01000000, 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=11010110 and B=01000000 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 214 − 64 = 150.
  4. Reduce the result modulo 256: 150.
  5. The eight output bits are 10010110.
  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 -42 and 64; their true signed result is -106.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -106 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10010110; they help later control logic interpret the outcome.

Final answer: 10010110; Z0 N1 C1 V0

ALU diagnostics · Problem 0250

For A=11010110 and B=10000100, 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=11010110 and B=10000100 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 214 − 132 = 82.
  4. Reduce the result modulo 256: 82.
  5. The eight output bits are 01010010.
  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 -42 and -124; their true signed result is 82.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 82 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 01010010; they help later control logic interpret the outcome.

Final answer: 01010010; Z0 N0 C1 V0

ALU diagnostics · Problem 0251

For A=11010110 and B=10111110, 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=11010110 and B=10111110 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 214 + 190 = 404.
  4. Reduce the result modulo 256: 148.
  5. The eight output bits are 10010100.
  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 -42 and -66; their true signed result is -108.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -108 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10010100; they help later control logic interpret the outcome.

Final answer: 10010100; Z0 N1 C1 V0

ALU diagnostics · Problem 0252

For A=11011001 and B=10110101, 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=11011001 and B=10110101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 217 + 181 = 398.
  4. Reduce the result modulo 256: 142.
  5. The eight output bits are 10001110.
  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 -39 and -75; their true signed result is -114.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -114 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10001110; they help later control logic interpret the outcome.

Final answer: 10001110; Z0 N1 C1 V0

ALU diagnostics · Problem 0253

For A=11011011 and B=00110100, 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=11011011 and B=00110100 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 219 − 52 = 167.
  4. Reduce the result modulo 256: 167.
  5. The eight output bits are 10100111.
  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 -37 and 52; their true signed result is -89.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -89 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10100111; they help later control logic interpret the outcome.

Final answer: 10100111; Z0 N1 C1 V0

ALU diagnostics · Problem 0254

For A=11011101 and B=01011111, 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=11011101 and B=01011111 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 221 + 95 = 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 -35 and 95; their true signed result is 60.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 60 is inside 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 V0

ALU diagnostics · Problem 0255

For A=11011101 and B=11010000, 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=11011101 and B=11010000 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 221 − 208 = 13.
  4. Reduce the result modulo 256: 13.
  5. The eight output bits are 00001101.
  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 -35 and -48; their true signed result is 13.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 13 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00001101; they help later control logic interpret the outcome.

Final answer: 00001101; Z0 N0 C1 V0

ALU diagnostics · Problem 0256

For A=11011110 and B=00011000, 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=11011110 and B=00011000 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 222 + 24 = 246.
  4. Reduce the result modulo 256: 246.
  5. The eight output bits are 11110110.
  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 -34 and 24; their true signed result is -10.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -10 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11110110; they help later control logic interpret the outcome.

Final answer: 11110110; Z0 N1 C0 V0