01How Computers Work

Fully solved problem book

ALU and condition flags

Set 6 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 0161

For A=10001111 and B=01100111, 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=10001111 and B=01100111 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 143 + 103 = 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 -113 and 103; 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

ALU diagnostics · Problem 0162

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

Final answer: 11100100; Z0 N1 C0 V0

ALU diagnostics · Problem 0163

For A=10010011 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=10010011 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 147 + 67 = 214.
  4. Reduce the result modulo 256: 214.
  5. The eight output bits are 11010110.
  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 -109 and 67; their true signed result is -42.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -42 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11010110; they help later control logic interpret the outcome.

Final answer: 11010110; Z0 N1 C0 V0

ALU diagnostics · Problem 0164

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

Final answer: 01001111; Z0 N0 C1 V1

ALU diagnostics · Problem 0165

For A=10010100 and B=00011110, 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=10010100 and B=00011110 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 148 + 30 = 178.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are -108 and 30; 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 C0 V0

ALU diagnostics · Problem 0166

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

Final answer: 10101000; Z0 N1 C0 V0

ALU diagnostics · Problem 0167

For A=10010101 and B=01011001, 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=10010101 and B=01011001 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 149 − 89 = 60.
  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 -107 and 89; 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 0168

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

Final answer: 01111111; Z0 N0 C1 V1

ALU diagnostics · Problem 0169

For A=10010110 and B=01001100, 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=10010110 and B=01001100 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 150 + 76 = 226.
  4. Reduce the result modulo 256: 226.
  5. The eight output bits are 11100010.
  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 -106 and 76; 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 11100010; they help later control logic interpret the outcome.

Final answer: 11100010; Z0 N1 C0 V0

ALU diagnostics · Problem 0170

For A=10010110 and B=01011010, 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=10010110 and B=01011010 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 150 − 90 = 60.
  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 -106 and 90; 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 0171

For A=10011001 and B=01010101, 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=10011001 and B=01010101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 153 + 85 = 238.
  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 -103 and 85; 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 0172

For A=10011011 and B=00001000, 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=10011011 and B=00001000 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 155 − 8 = 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 -101 and 8; 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 0173

For A=10011011 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=10011011 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 155 − 22 = 133.
  4. Reduce the result modulo 256: 133.
  5. The eight output bits are 10000101.
  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 -101 and 22; their true signed result is -123.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -123 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10000101; they help later control logic interpret the outcome.

Final answer: 10000101; Z0 N1 C1 V0

ALU diagnostics · Problem 0174

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

Final answer: 10110100; Z0 N1 C0 V0

ALU diagnostics · Problem 0175

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

Final answer: 01101001; Z0 N0 C1 V1

ALU diagnostics · Problem 0176

For A=10011101 and B=11001110, 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=10011101 and B=11001110 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 157 + 206 = 363.
  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 -99 and -50; 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 0177

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

Final answer: 01001011; Z0 N0 C1 V1

ALU diagnostics · Problem 0178

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

Final answer: 00100111; Z0 N0 C1 V1

ALU diagnostics · Problem 0179

For A=10100000 and B=11110011, 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=10100000 and B=11110011 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 160 + 243 = 403.
  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 -96 and -13; 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 0180

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

Final answer: 00100110; Z0 N0 C1 V1

ALU diagnostics · Problem 0181

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

Final answer: 10000001; Z0 N1 C1 V0

ALU diagnostics · Problem 0182

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

Final answer: 00111111; Z0 N0 C1 V1

ALU diagnostics · Problem 0183

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

Final answer: 01010000; Z0 N0 C1 V1

ALU diagnostics · Problem 0184

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

Final answer: 10001100; Z0 N1 C1 V0

ALU diagnostics · Problem 0185

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

Final answer: 00100110; Z0 N0 C1 V0

ALU diagnostics · Problem 0186

For A=10101001 and B=01110001, 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=10101001 and B=01110001 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 169 − 113 = 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 -87 and 113; 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 0187

For A=10101001 and B=10100011, 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=10101001 and B=10100011 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 169 − 163 = 6.
  4. Reduce the result modulo 256: 6.
  5. The eight output bits are 00000110.
  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 -87 and -93; 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 00000110; they help later control logic interpret the outcome.

Final answer: 00000110; Z0 N0 C1 V0

ALU diagnostics · Problem 0188

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

Final answer: 00010110; Z0 N0 C1 V0

ALU diagnostics · Problem 0189

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

Final answer: 11001011; Z0 N1 C0 V0

ALU diagnostics · Problem 0190

For A=10101100 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=10101100 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 172 − 18 = 154.
  4. Reduce the result modulo 256: 154.
  5. The eight output bits are 10011010.
  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 -84 and 18; their true signed result is -102.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -102 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 10011010; they help later control logic interpret the outcome.

Final answer: 10011010; Z0 N1 C1 V0

ALU diagnostics · Problem 0191

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

Final answer: 11101100; Z0 N1 C0 V0

ALU diagnostics · Problem 0192

For A=10101101 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=10101101 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 173 + 41 = 214.
  4. Reduce the result modulo 256: 214.
  5. The eight output bits are 11010110.
  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 41; their true signed result is -42.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result -42 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 11010110; they help later control logic interpret the outcome.

Final answer: 11010110; Z0 N1 C0 V0