Fully solved problem book
ALU and condition flags
Set 2 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 0033
For A=00100100 and B=01110101, 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=00100100 and B=01110101 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 36 + 117 = 153.
- Reduce the result modulo 256: 153.
- The eight output bits are 10011001.
- 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 36 and 117; their true signed result is 153.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 153 is outside the 8-bit signed range.
- 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 0034
For A=00100100 and B=10100001, 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=00100100 and B=10100001 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 36 + 161 = 197.
- Reduce the result modulo 256: 197.
- The eight output bits are 11000101.
- 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 36 and -95; their true signed result is -59.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -59 is inside the 8-bit signed range.
- 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 0035
For A=00100101 and B=10111110, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=00100101 and B=10111110 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 37 + 190 = 227.
- Reduce the result modulo 256: 227.
- The eight output bits are 11100011.
- 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 37 and -66; 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 11100011; they help later control logic interpret the outcome.
Final answer: 11100011; Z0 N1 C0 V0
ALU diagnostics · Problem 0036
For A=00100111 and B=00100010, 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=00100111 and B=00100010 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 39 − 34 = 5.
- Reduce the result modulo 256: 5.
- The eight output bits are 00000101.
- 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 39 and 34; their true signed result is 5.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 5 is inside the 8-bit signed range.
- 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 0037
For A=00100111 and B=10001000, 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=00100111 and B=10001000 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 39 − 136 = -97.
- 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 39 and -120; their true signed result is 159.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 159 is outside 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 C0 V1
ALU diagnostics · Problem 0038
For A=00100111 and B=10111001, 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=00100111 and B=10111001 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 39 − 185 = -146.
- Reduce the result modulo 256: 110.
- The eight output bits are 01101110.
- 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 39 and -71; their true signed result is 110.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 110 is inside the 8-bit signed range.
- The flags do not change the stored byte 01101110; they help later control logic interpret the outcome.
Final answer: 01101110; Z0 N0 C0 V0
ALU diagnostics · Problem 0039
For A=00100111 and B=11111001, 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=00100111 and B=11111001 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 39 + 249 = 288.
- Reduce the result modulo 256: 32.
- The eight output bits are 00100000.
- 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 39 and -7; their true signed result is 32.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 32 is inside the 8-bit signed range.
- The flags do not change the stored byte 00100000; they help later control logic interpret the outcome.
Final answer: 00100000; Z0 N0 C1 V0
ALU diagnostics · Problem 0040
For A=00101000 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 →
- Treat A=00101000 and B=01000000 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 40 + 64 = 104.
- Reduce the result modulo 256: 104.
- The eight output bits are 01101000.
- 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 40 and 64; their true signed result is 104.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 104 is inside the 8-bit signed range.
- The flags do not change the stored byte 01101000; they help later control logic interpret the outcome.
Final answer: 01101000; Z0 N0 C0 V0
ALU diagnostics · Problem 0041
For A=00101000 and B=10011110, 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=00101000 and B=10011110 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 40 + 158 = 198.
- Reduce the result modulo 256: 198.
- The eight output bits are 11000110.
- 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 40 and -98; their true signed result is -58.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -58 is inside the 8-bit signed range.
- The flags do not change the stored byte 11000110; they help later control logic interpret the outcome.
Final answer: 11000110; Z0 N1 C0 V0
ALU diagnostics · Problem 0042
For A=00101000 and B=10100101, 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=00101000 and B=10100101 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 40 − 165 = -125.
- Reduce the result modulo 256: 131.
- The eight output bits are 10000011.
- 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 40 and -91; their true signed result is 131.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 131 is outside the 8-bit signed range.
- The flags do not change the stored byte 10000011; they help later control logic interpret the outcome.
Final answer: 10000011; Z0 N1 C0 V1
ALU diagnostics · Problem 0043
For A=00101000 and B=10110001, 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=00101000 and B=10110001 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 40 + 177 = 217.
- Reduce the result modulo 256: 217.
- The eight output bits are 11011001.
- 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 40 and -79; their true signed result is -39.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -39 is inside the 8-bit signed range.
- The flags do not change the stored byte 11011001; they help later control logic interpret the outcome.
Final answer: 11011001; Z0 N1 C0 V0
ALU diagnostics · Problem 0044
For A=00101000 and B=10111101, 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=00101000 and B=10111101 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 40 − 189 = -149.
- Reduce the result modulo 256: 107.
- The eight output bits are 01101011.
- 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 40 and -67; their true signed result is 107.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 107 is inside the 8-bit signed range.
- 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 0045
For A=00101000 and B=11011111, 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=00101000 and B=11011111 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 40 − 223 = -183.
- Reduce the result modulo 256: 73.
- The eight output bits are 01001001.
- 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 40 and -33; their true signed result is 73.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 73 is inside the 8-bit signed range.
- The flags do not change the stored byte 01001001; they help later control logic interpret the outcome.
Final answer: 01001001; Z0 N0 C0 V0
ALU diagnostics · Problem 0046
For A=00101010 and B=10101111, 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=00101010 and B=10101111 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 42 + 175 = 217.
- Reduce the result modulo 256: 217.
- The eight output bits are 11011001.
- 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 42 and -81; their true signed result is -39.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -39 is inside the 8-bit signed range.
- The flags do not change the stored byte 11011001; they help later control logic interpret the outcome.
Final answer: 11011001; Z0 N1 C0 V0
ALU diagnostics · Problem 0047
For A=00101011 and B=00111111, 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=00101011 and B=00111111 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 43 − 63 = -20.
- Reduce the result modulo 256: 236.
- The eight output bits are 11101100.
- 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 43 and 63; their true signed result is -20.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -20 is inside the 8-bit signed range.
- 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 0048
For A=00101100 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 →
- Treat A=00101100 and B=00101010 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 44 + 42 = 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 44 and 42; their true signed result is 86.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 86 is inside 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 C0 V0
ALU diagnostics · Problem 0049
For A=00101101 and B=01010011, 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=00101101 and B=01010011 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 45 + 83 = 128.
- Reduce the result modulo 256: 128.
- The eight output bits are 10000000.
- 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 45 and 83; their true signed result is 128.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 128 is outside the 8-bit signed range.
- The flags do not change the stored byte 10000000; they help later control logic interpret the outcome.
Final answer: 10000000; Z0 N1 C0 V1
ALU diagnostics · Problem 0050
For A=00101110 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=00101110 and B=00110011 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 46 + 51 = 97.
- Reduce the result modulo 256: 97.
- The eight output bits are 01100001.
- 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 46 and 51; 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 01100001; they help later control logic interpret the outcome.
Final answer: 01100001; Z0 N0 C0 V0
ALU diagnostics · Problem 0051
For A=00101110 and B=11011011, 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=00101110 and B=11011011 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 46 + 219 = 265.
- Reduce the result modulo 256: 9.
- The eight output bits are 00001001.
- 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 46 and -37; 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 00001001; they help later control logic interpret the outcome.
Final answer: 00001001; Z0 N0 C1 V0
ALU diagnostics · Problem 0052
For A=00110000 and B=10011011, 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=00110000 and B=10011011 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 48 − 155 = -107.
- Reduce the result modulo 256: 149.
- The eight output bits are 10010101.
- 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 48 and -101; their true signed result is 149.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 149 is outside the 8-bit signed range.
- The flags do not change the stored byte 10010101; they help later control logic interpret the outcome.
Final answer: 10010101; Z0 N1 C0 V1
ALU diagnostics · Problem 0053
For A=00110000 and B=10110100, 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=00110000 and B=10110100 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 48 − 180 = -132.
- Reduce the result modulo 256: 124.
- The eight output bits are 01111100.
- 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 48 and -76; their true signed result is 124.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 124 is inside the 8-bit signed range.
- The flags do not change the stored byte 01111100; they help later control logic interpret the outcome.
Final answer: 01111100; Z0 N0 C0 V0
ALU diagnostics · Problem 0054
For A=00110000 and B=11001000, 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=00110000 and B=11001000 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 48 + 200 = 248.
- Reduce the result modulo 256: 248.
- The eight output bits are 11111000.
- 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 48 and -56; their true signed result is -8.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -8 is inside the 8-bit signed range.
- The flags do not change the stored byte 11111000; they help later control logic interpret the outcome.
Final answer: 11111000; Z0 N1 C0 V0
ALU diagnostics · Problem 0055
For A=00110000 and B=11001010, 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=00110000 and B=11001010 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 48 + 202 = 250.
- Reduce the result modulo 256: 250.
- The eight output bits are 11111010.
- 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 48 and -54; their true signed result is -6.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -6 is inside the 8-bit signed range.
- 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 0056
For A=00110001 and B=01001011, 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=00110001 and B=01001011 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 49 − 75 = -26.
- Reduce the result modulo 256: 230.
- The eight output bits are 11100110.
- 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 49 and 75; their true signed result is -26.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -26 is inside the 8-bit signed range.
- The flags do not change the stored byte 11100110; they help later control logic interpret the outcome.
Final answer: 11100110; Z0 N1 C0 V0
ALU diagnostics · Problem 0057
For A=00110001 and B=10001011, 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=00110001 and B=10001011 as the input bit patterns.
- Execute SUB; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 49 − 139 = -90.
- Reduce the result modulo 256: 166.
- The eight output bits are 10100110.
- 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 49 and -117; their true signed result is 166.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 166 is outside the 8-bit signed range.
- The flags do not change the stored byte 10100110; they help later control logic interpret the outcome.
Final answer: 10100110; Z0 N1 C0 V1
ALU diagnostics · Problem 0058
For A=00110010 and B=01010100, 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=00110010 and B=01010100 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 50 + 84 = 134.
- Reduce the result modulo 256: 134.
- The eight output bits are 10000110.
- 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 50 and 84; their true signed result is 134.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 134 is outside the 8-bit signed range.
- The flags do not change the stored byte 10000110; they help later control logic interpret the outcome.
Final answer: 10000110; Z0 N1 C0 V1
ALU diagnostics · Problem 0059
For A=00110011 and B=10101101, 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=00110011 and B=10101101 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 51 + 173 = 224.
- Reduce the result modulo 256: 224.
- The eight output bits are 11100000.
- 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 51 and -83; their true signed result is -32.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result -32 is inside the 8-bit signed range.
- The flags do not change the stored byte 11100000; they help later control logic interpret the outcome.
Final answer: 11100000; Z0 N1 C0 V0
ALU diagnostics · Problem 0060
For A=00110011 and B=11110110, 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=00110011 and B=11110110 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 51 + 246 = 297.
- Reduce the result modulo 256: 41.
- The eight output bits are 00101001.
- 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 51 and -10; their true signed result is 41.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 41 is inside the 8-bit signed range.
- The flags do not change the stored byte 00101001; they help later control logic interpret the outcome.
Final answer: 00101001; Z0 N0 C1 V0
ALU diagnostics · Problem 0061
For A=00110100 and B=00101011, 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=00110100 and B=00101011 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 52 + 43 = 95.
- Reduce the result modulo 256: 95.
- The eight output bits are 01011111.
- 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=0 under the selected convention (ADD uses carry-out; SUB uses no-borrow).
- Signed readings are 52 and 43; their true signed result is 95.
- The signed result range is −128 through 127.
- Overflow flag V=0; signed result 95 is inside the 8-bit signed range.
- The flags do not change the stored byte 01011111; they help later control logic interpret the outcome.
Final answer: 01011111; Z0 N0 C0 V0
ALU diagnostics · Problem 0062
For A=00110100 and B=01110100, 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=00110100 and B=01110100 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 52 + 116 = 168.
- Reduce the result modulo 256: 168.
- The eight output bits are 10101000.
- 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 52 and 116; their true signed result is 168.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 168 is outside the 8-bit signed range.
- The flags do not change the stored byte 10101000; they help later control logic interpret the outcome.
Final answer: 10101000; Z0 N1 C0 V1
ALU diagnostics · Problem 0063
For A=00110101 and B=01100001, run ADD; find the low byte and Z, N, C, V.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Treat A=00110101 and B=01100001 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 53 + 97 = 150.
- Reduce the result modulo 256: 150.
- The eight output bits are 10010110.
- 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 53 and 97; their true signed result is 150.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 150 is outside the 8-bit signed range.
- The flags do not change the stored byte 10010110; they help later control logic interpret the outcome.
Final answer: 10010110; Z0 N1 C0 V1
ALU diagnostics · Problem 0064
For A=00110110 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=00110110 and B=01001010 as the input bit patterns.
- Execute ADD; compute the mathematical integer expression using the input patterns.
- The ordinary unsigned calculation yields 54 + 74 = 128.
- Reduce the result modulo 256: 128.
- The eight output bits are 10000000.
- 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 54 and 74; their true signed result is 128.
- The signed result range is −128 through 127.
- Overflow flag V=1; signed result 128 is outside the 8-bit signed range.
- The flags do not change the stored byte 10000000; they help later control logic interpret the outcome.
Final answer: 10000000; Z0 N1 C0 V1