Fully solved problem book
ALU and condition flags
Set 7 of 10 · 32 worked questions. Predict your result before expanding the solution.
These worked traces are meant to build fluency through controlled variation. If several answers feel identical, try the next difficult value and look for the point where a carry, sign, branch, or selected memory address changes the outcome.
ALU diagnostics · Problem 0193
For A=10101101 and B=01001010, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10101101 and B=01001010 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 173 + 74 = 247.
- Reduce the result modulo 256: 247.
- The eight output bits are 11110111.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -83 and 74; their true signed result is -9.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -9 is inside the 8-bit signed range.
- The flags do not change the stored byte 11110111; they help later control logic interpret the outcome.
Final answer: 11110111; Z0 N1 C0 V0
ALU diagnostics · Problem 0194
For A=10101111 and B=01000110, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10101111 and B=01000110 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 175 + 70 = 245.
- Reduce the result modulo 256: 245.
- The eight output bits are 11110101.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -81 and 70; their true signed result is -11.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -11 is inside the 8-bit signed range.
- The flags do not change the stored byte 11110101; they help later control logic interpret the outcome.
Final answer: 11110101; Z0 N1 C0 V0
ALU diagnostics · Problem 0195
For A=10110000 and B=10000101, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110000 and B=10000101 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 176 + 133 = 309.
- Reduce the result modulo 256: 53.
- The eight output bits are 00110101.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -80 and -123; their true signed result is -203.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -203 is outside the 8-bit signed range.
- The flags do not change the stored byte 00110101; they help later control logic interpret the outcome.
Final answer: 00110101; Z0 N0 C1 V1
ALU diagnostics · Problem 0196
For A=10110000 and B=10001100, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110000 and B=10001100 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 176 + 140 = 316.
- Reduce the result modulo 256: 60.
- The eight output bits are 00111100.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -80 and -116; their true signed result is -196.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -196 is outside the 8-bit signed range.
- The flags do not change the stored byte 00111100; they help later control logic interpret the outcome.
Final answer: 00111100; Z0 N0 C1 V1
ALU diagnostics · Problem 0197
For A=10110001 and B=01101101, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110001 and B=01101101 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 177 + 109 = 286.
- Reduce the result modulo 256: 30.
- The eight output bits are 00011110.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -79 and 109; their true signed result is 30.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 30 is inside the 8-bit signed range.
- The flags do not change the stored byte 00011110; they help later control logic interpret the outcome.
Final answer: 00011110; Z0 N0 C1 V0
ALU diagnostics · Problem 0198
For A=10110001 and B=10000101, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110001 and B=10000101 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 177 + 133 = 310.
- Reduce the result modulo 256: 54.
- The eight output bits are 00110110.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -79 and -123; their true signed result is -202.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -202 is outside the 8-bit signed range.
- The flags do not change the stored byte 00110110; they help later control logic interpret the outcome.
Final answer: 00110110; Z0 N0 C1 V1
ALU diagnostics · Problem 0199
For A=10110011 and B=00100000, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110011 and B=00100000 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 179 − 32 = 147.
- Reduce the result modulo 256: 147.
- The eight output bits are 10010011.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -77 and 32; their true signed result is -109.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -109 is inside the 8-bit signed range.
- The flags do not change the stored byte 10010011; they help later control logic interpret the outcome.
Final answer: 10010011; Z0 N1 C1 V0
ALU diagnostics · Problem 0200
For A=10110011 and B=11011011, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110011 and B=11011011 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 179 − 219 = -40.
- Reduce the result modulo 256: 216.
- The eight output bits are 11011000.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -77 and -37; their true signed result is -40.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -40 is inside the 8-bit signed range.
- The flags do not change the stored byte 11011000; they help later control logic interpret the outcome.
Final answer: 11011000; Z0 N1 C0 V0
ALU diagnostics · Problem 0201
For A=10110100 and B=00101001, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110100 and B=00101001 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 180 − 41 = 139.
- Reduce the result modulo 256: 139.
- The eight output bits are 10001011.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -76 and 41; their true signed result is -117.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -117 is inside the 8-bit signed range.
- The flags do not change the stored byte 10001011; they help later control logic interpret the outcome.
Final answer: 10001011; Z0 N1 C1 V0
ALU diagnostics · Problem 0202
For A=10110100 and B=11101011, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110100 and B=11101011 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 180 + 235 = 415.
- Reduce the result modulo 256: 159.
- The eight output bits are 10011111.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -76 and -21; their true signed result is -97.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -97 is inside the 8-bit signed range.
- The flags do not change the stored byte 10011111; they help later control logic interpret the outcome.
Final answer: 10011111; Z0 N1 C1 V0
ALU diagnostics · Problem 0203
For A=10110101 and B=00110011, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110101 and B=00110011 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 181 + 51 = 232.
- Reduce the result modulo 256: 232.
- The eight output bits are 11101000.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -75 and 51; their true signed result is -24.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -24 is inside the 8-bit signed range.
- The flags do not change the stored byte 11101000; they help later control logic interpret the outcome.
Final answer: 11101000; Z0 N1 C0 V0
ALU diagnostics · Problem 0204
For A=10110101 and B=01100011, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110101 and B=01100011 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 181 + 99 = 280.
- Reduce the result modulo 256: 24.
- The eight output bits are 00011000.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -75 and 99; their true signed result is 24.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 24 is inside the 8-bit signed range.
- The flags do not change the stored byte 00011000; they help later control logic interpret the outcome.
Final answer: 00011000; Z0 N0 C1 V0
ALU diagnostics · Problem 0205
For A=10110101 and B=10001111, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110101 and B=10001111 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 181 + 143 = 324.
- Reduce the result modulo 256: 68.
- The eight output bits are 01000100.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -75 and -113; their true signed result is -188.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -188 is outside the 8-bit signed range.
- The flags do not change the stored byte 01000100; they help later control logic interpret the outcome.
Final answer: 01000100; Z0 N0 C1 V1
ALU diagnostics · Problem 0206
For A=10110101 and B=10101110, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110101 and B=10101110 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 181 + 174 = 355.
- Reduce the result modulo 256: 99.
- The eight output bits are 01100011.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -75 and -82; their true signed result is -157.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -157 is outside the 8-bit signed range.
- The flags do not change the stored byte 01100011; they help later control logic interpret the outcome.
Final answer: 01100011; Z0 N0 C1 V1
ALU diagnostics · Problem 0207
For A=10110110 and B=10000110, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110110 and B=10000110 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 182 + 134 = 316.
- Reduce the result modulo 256: 60.
- The eight output bits are 00111100.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -74 and -122; their true signed result is -196.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -196 is outside the 8-bit signed range.
- The flags do not change the stored byte 00111100; they help later control logic interpret the outcome.
Final answer: 00111100; Z0 N0 C1 V1
ALU diagnostics · Problem 0208
For A=10110110 and B=10101110, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110110 and B=10101110 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 182 + 174 = 356.
- Reduce the result modulo 256: 100.
- The eight output bits are 01100100.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -74 and -82; their true signed result is -156.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -156 is outside the 8-bit signed range.
- The flags do not change the stored byte 01100100; they help later control logic interpret the outcome.
Final answer: 01100100; Z0 N0 C1 V1
ALU diagnostics · Problem 0209
For A=10110110 and B=11001000, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110110 and B=11001000 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 182 − 200 = -18.
- Reduce the result modulo 256: 238.
- The eight output bits are 11101110.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -74 and -56; their true signed result is -18.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -18 is inside the 8-bit signed range.
- The flags do not change the stored byte 11101110; they help later control logic interpret the outcome.
Final answer: 11101110; Z0 N1 C0 V0
ALU diagnostics · Problem 0210
For A=10110111 and B=01001010, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110111 and B=01001010 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 183 − 74 = 109.
- Reduce the result modulo 256: 109.
- The eight output bits are 01101101.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -73 and 74; their true signed result is -147.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -147 is outside the 8-bit signed range.
- The flags do not change the stored byte 01101101; they help later control logic interpret the outcome.
Final answer: 01101101; Z0 N0 C1 V1
ALU diagnostics · Problem 0211
For A=10110111 and B=01111111, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10110111 and B=01111111 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 183 − 127 = 56.
- Reduce the result modulo 256: 56.
- The eight output bits are 00111000.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -73 and 127; their true signed result is -200.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -200 is outside the 8-bit signed range.
- The flags do not change the stored byte 00111000; they help later control logic interpret the outcome.
Final answer: 00111000; Z0 N0 C1 V1
ALU diagnostics · Problem 0212
For A=10111100 and B=11000010, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10111100 and B=11000010 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 188 + 194 = 382.
- Reduce the result modulo 256: 126.
- The eight output bits are 01111110.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -68 and -62; their true signed result is -130.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -130 is outside the 8-bit signed range.
- The flags do not change the stored byte 01111110; they help later control logic interpret the outcome.
Final answer: 01111110; Z0 N0 C1 V1
ALU diagnostics · Problem 0213
For A=10111101 and B=01101000, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10111101 and B=01101000 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 189 + 104 = 293.
- Reduce the result modulo 256: 37.
- The eight output bits are 00100101.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -67 and 104; their true signed result is 37.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 37 is inside the 8-bit signed range.
- The flags do not change the stored byte 00100101; they help later control logic interpret the outcome.
Final answer: 00100101; Z0 N0 C1 V0
ALU diagnostics · Problem 0214
For A=10111110 and B=01101000, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10111110 and B=01101000 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 190 − 104 = 86.
- Reduce the result modulo 256: 86.
- The eight output bits are 01010110.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -66 and 104; their true signed result is -170.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -170 is outside the 8-bit signed range.
- The flags do not change the stored byte 01010110; they help later control logic interpret the outcome.
Final answer: 01010110; Z0 N0 C1 V1
ALU diagnostics · Problem 0215
For A=10111110 and B=11010001, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10111110 and B=11010001 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 190 + 209 = 399.
- Reduce the result modulo 256: 143.
- The eight output bits are 10001111.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -66 and -47; their true signed result is -113.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -113 is inside the 8-bit signed range.
- The flags do not change the stored byte 10001111; they help later control logic interpret the outcome.
Final answer: 10001111; Z0 N1 C1 V0
ALU diagnostics · Problem 0216
For A=10111111 and B=00000001, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10111111 and B=00000001 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 191 + 1 = 192.
- Reduce the result modulo 256: 192.
- The eight output bits are 11000000.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -65 and 1; their true signed result is -64.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -64 is inside the 8-bit signed range.
- The flags do not change the stored byte 11000000; they help later control logic interpret the outcome.
Final answer: 11000000; Z0 N1 C0 V0
ALU diagnostics · Problem 0217
For A=10111111 and B=11001001, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=10111111 and B=11001001 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 191 + 201 = 392.
- Reduce the result modulo 256: 136.
- The eight output bits are 10001000.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -65 and -55; their true signed result is -120.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -120 is inside the 8-bit signed range.
- The flags do not change the stored byte 10001000; they help later control logic interpret the outcome.
Final answer: 10001000; Z0 N1 C1 V0
ALU diagnostics · Problem 0218
For A=11000000 and B=00011101, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=11000000 and B=00011101 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 192 − 29 = 163.
- Reduce the result modulo 256: 163.
- The eight output bits are 10100011.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -64 and 29; their true signed result is -93.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -93 is inside the 8-bit signed range.
- The flags do not change the stored byte 10100011; they help later control logic interpret the outcome.
Final answer: 10100011; Z0 N1 C1 V0
ALU diagnostics · Problem 0219
For A=11000000 and B=01001110, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=11000000 and B=01001110 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 192 − 78 = 114.
- Reduce the result modulo 256: 114.
- The eight output bits are 01110010.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -64 and 78; their true signed result is -142.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -142 is outside the 8-bit signed range.
- The flags do not change the stored byte 01110010; they help later control logic interpret the outcome.
Final answer: 01110010; Z0 N0 C1 V1
ALU diagnostics · Problem 0220
For A=11000000 and B=01011101, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=11000000 and B=01011101 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 192 + 93 = 285.
- Reduce the result modulo 256: 29.
- The eight output bits are 00011101.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -64 and 93; their true signed result is 29.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 29 is inside the 8-bit signed range.
- The flags do not change the stored byte 00011101; they help later control logic interpret the outcome.
Final answer: 00011101; Z0 N0 C1 V0
ALU diagnostics · Problem 0221
For A=11000010 and B=01001101, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=11000010 and B=01001101 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 194 + 77 = 271.
- Reduce the result modulo 256: 15.
- The eight output bits are 00001111.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -62 and 77; their true signed result is 15.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 15 is inside the 8-bit signed range.
- The flags do not change the stored byte 00001111; they help later control logic interpret the outcome.
Final answer: 00001111; Z0 N0 C1 V0
ALU diagnostics · Problem 0222
For A=11000011 and B=01011011, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=11000011 and B=01011011 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 195 + 91 = 286.
- Reduce the result modulo 256: 30.
- The eight output bits are 00011110.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -61 and 91; their true signed result is 30.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 30 is inside the 8-bit signed range.
- The flags do not change the stored byte 00011110; they help later control logic interpret the outcome.
Final answer: 00011110; Z0 N0 C1 V0
ALU diagnostics · Problem 0223
For A=11000011 and B=10010010, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=11000011 and B=10010010 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 195 + 146 = 341.
- Reduce the result modulo 256: 85.
- The eight output bits are 01010101.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=0, because the most significant output bit is 0.
- Carry flag C=1 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -61 and -110; their true signed result is -171.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result -171 is outside the 8-bit signed range.
- The flags do not change the stored byte 01010101; they help later control logic interpret the outcome.
Final answer: 01010101; Z0 N0 C1 V1
ALU diagnostics · Problem 0224
For A=11000101 and B=11000111, run SUB; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=11000101 and B=11000111 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 197 − 199 = -2.
- Reduce the result modulo 256: 254.
- The eight output bits are 11111110.
- Zero flag Z=0, because the stored output is nonzero.
- Negative flag N=1, because the most significant output bit is 1.
- Carry flag C=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are -59 and -57; their true signed result is -2.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -2 is inside the 8-bit signed range.
- The flags do not change the stored byte 11111110; they help later control logic interpret the outcome.
Final answer: 11111110; Z0 N1 C0 V0