01How Computers Work (online)

Fully solved problem book

ALU and condition flags

Set 3 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 0065

For A=00110110 and B=11101011, 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=00110110 and B=11101011 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 54 − 235 = -181.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 54 and -21; their true signed result is 75.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 75 is inside 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 C0 V0

ALU diagnostics · Problem 0066

For A=00110111 and B=10000101, 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=00110111 and B=10000101 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 55 − 133 = -78.
  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 55 and -123; their true signed result is 178.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result 178 is outside 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 V1

ALU diagnostics · Problem 0067

For A=00111000 and B=00000110, 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=00111000 and B=00000110 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 56 + 6 = 62.
  4. Reduce the result modulo 256: 62.
  5. The eight output bits are 00111110.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 56 and 6; their true signed result is 62.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 62 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 00111110; they help later control logic interpret the outcome.

Final answer: 00111110; Z0 N0 C0 V0

ALU diagnostics · Problem 0068

For A=00111001 and B=11000001, 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=00111001 and B=11000001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 57 + 193 = 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 57 and -63; 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 0069

For A=00111011 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=00111011 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 59 + 15 = 74.
  4. Reduce the result modulo 256: 74.
  5. The eight output bits are 01001010.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 59 and 15; their true signed result is 74.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 74 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 01001010; they help later control logic interpret the outcome.

Final answer: 01001010; Z0 N0 C0 V0

ALU diagnostics · Problem 0070

For A=00111011 and B=00010000, 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=00111011 and B=00010000 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 59 + 16 = 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 59 and 16; their true signed result is 75.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 75 is inside 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 C0 V0

ALU diagnostics · Problem 0071

For A=00111011 and B=01000100, 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=00111011 and B=01000100 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 59 + 68 = 127.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 59 and 68; 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 01111111; they help later control logic interpret the outcome.

Final answer: 01111111; Z0 N0 C0 V0

ALU diagnostics · Problem 0072

For A=00111011 and B=01000110, 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=00111011 and B=01000110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 59 − 70 = -11.
  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 59 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 0073

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

Final answer: 10010010; Z0 N1 C0 V1

ALU diagnostics · Problem 0074

For A=00111011 and B=11100001, 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=00111011 and B=11100001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 59 + 225 = 284.
  4. Reduce the result modulo 256: 28.
  5. The eight output bits are 00011100.
  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 59 and -31; 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 00011100; they help later control logic interpret the outcome.

Final answer: 00011100; Z0 N0 C1 V0

ALU diagnostics · Problem 0075

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

Final answer: 11011100; Z0 N1 C0 V0

ALU diagnostics · Problem 0076

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

Final answer: 11000101; Z0 N1 C0 V0

ALU diagnostics · Problem 0077

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

Final answer: 11010011; Z0 N1 C0 V0

ALU diagnostics · Problem 0078

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

Final answer: 10000010; Z0 N1 C0 V1

ALU diagnostics · Problem 0079

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

Final answer: 10111011; Z0 N1 C0 V1

ALU diagnostics · Problem 0080

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

Final answer: 11110000; Z0 N1 C0 V0

ALU diagnostics · Problem 0081

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

Final answer: 11111001; Z0 N1 C0 V0

ALU diagnostics · Problem 0082

For A=01000011 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=01000011 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 67 − 62 = 5.
  4. Reduce the result modulo 256: 5.
  5. The eight output bits are 00000101.
  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 62; 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 00000101; they help later control logic interpret the outcome.

Final answer: 00000101; Z0 N0 C1 V0

ALU diagnostics · Problem 0083

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

Final answer: 00011001; Z0 N0 C1 V0

ALU diagnostics · Problem 0084

For A=01000101 and B=00110001, 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=01000101 and B=00110001 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 69 + 49 = 118.
  4. Reduce the result modulo 256: 118.
  5. The eight output bits are 01110110.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 69 and 49; their true signed result is 118.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 118 is inside the 8-bit signed range.
  12. The flags do not change the stored byte 01110110; they help later control logic interpret the outcome.

Final answer: 01110110; Z0 N0 C0 V0

ALU diagnostics · Problem 0085

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

ALU diagnostics · Problem 0086

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

Final answer: 10111001; Z0 N1 C0 V1

ALU diagnostics · Problem 0087

For A=01001000 and B=00100011, 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=01001000 and B=00100011 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 72 + 35 = 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 72 and 35; their true signed result is 107.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=0; signed result 107 is inside 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 C0 V0

ALU diagnostics · Problem 0088

For A=01001001 and B=11011101, 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=01001001 and B=11011101 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 73 − 221 = -148.
  4. Reduce the result modulo 256: 108.
  5. The eight output bits are 01101100.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 73 and -35; 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 01101100; they help later control logic interpret the outcome.

Final answer: 01101100; Z0 N0 C0 V0

ALU diagnostics · Problem 0089

For A=01001011 and B=01111101, 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=01001011 and B=01111101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 75 + 125 = 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 75 and 125; 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 11001000; they help later control logic interpret the outcome.

Final answer: 11001000; Z0 N1 C0 V1

ALU diagnostics · Problem 0090

For A=01001101 and B=00100101, 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=01001101 and B=00100101 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 77 + 37 = 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=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 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 01110010; they help later control logic interpret the outcome.

Final answer: 01110010; Z0 N0 C0 V0

ALU diagnostics · Problem 0091

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

Final answer: 10011001; Z0 N1 C0 V1

ALU diagnostics · Problem 0092

For A=01010001 and B=00101010, 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=01010001 and B=00101010 as the input bit patterns.
  2. Execute ADD; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 81 + 42 = 123.
  4. Reduce the result modulo 256: 123.
  5. The eight output bits are 01111011.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 81 and 42; 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 01111011; they help later control logic interpret the outcome.

Final answer: 01111011; Z0 N0 C0 V0

ALU diagnostics · Problem 0093

For A=01010001 and B=10111110, 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=01010001 and B=10111110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 81 − 190 = -109.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 81 and -66; 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 10010011; they help later control logic interpret the outcome.

Final answer: 10010011; Z0 N1 C0 V1

ALU diagnostics · Problem 0094

For A=01010010 and B=11000011, 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=01010010 and B=11000011 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 82 − 195 = -113.
  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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
  9. Signed readings are 82 and -61; their true signed result is 143.
  10. The signed result range is −128 through 127.
  11. Overflow flag V=1; signed result 143 is outside 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 C0 V1

ALU diagnostics · Problem 0095

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

Final answer: 01000110; Z0 N0 C1 V0

ALU diagnostics · Problem 0096

For A=01010011 and B=01000110, 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=01010011 and B=01000110 as the input bit patterns.
  2. Execute SUB; compute the mathematical integer expression using the input patterns.
  3. The ordinary unsigned calculation yields 83 − 70 = 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 83 and 70; 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