01How Computers Work (online)

Fully solved problem book

Bitwise logic

Set 9 of 9 · 14 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.

Boolean logic · Problem 0257

Calculate 11110001 XOR 00110110.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11110001.
  2. B is the eight-bit string 00110110.
  3. The operation is XOR, applied separately to each matching bit position.
  4. Position 7 (weight 128): XOR(1, 0) = 1.
  5. Position 6 (weight 64): XOR(1, 0) = 1.
  6. Position 5 (weight 32): XOR(1, 1) = 0.
  7. Position 4 (weight 16): XOR(1, 1) = 0.
  8. Position 3 (weight 8): XOR(0, 0) = 0.
  9. Position 2 (weight 4): XOR(0, 1) = 1.
  10. Position 1 (weight 2): XOR(0, 1) = 1.
  11. Position 0 (weight 1): XOR(1, 0) = 1.
  12. Concatenate the output bits from position seven to zero: 11000111.
  13. The output is 199 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise XOR operation.

Final answer: 11000111

Boolean logic · Problem 0258

Calculate 11110010 OR 01100101.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11110010.
  2. B is the eight-bit string 01100101.
  3. The operation is OR, applied separately to each matching bit position.
  4. Position 7 (weight 128): OR(1, 0) = 1.
  5. Position 6 (weight 64): OR(1, 1) = 1.
  6. Position 5 (weight 32): OR(1, 1) = 1.
  7. Position 4 (weight 16): OR(1, 0) = 1.
  8. Position 3 (weight 8): OR(0, 0) = 0.
  9. Position 2 (weight 4): OR(0, 1) = 1.
  10. Position 1 (weight 2): OR(1, 0) = 1.
  11. Position 0 (weight 1): OR(0, 1) = 1.
  12. Concatenate the output bits from position seven to zero: 11110111.
  13. The output is 247 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise OR operation.

Final answer: 11110111

Boolean logic · Problem 0259

Calculate 11110010 OR 11010110.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11110010.
  2. B is the eight-bit string 11010110.
  3. The operation is OR, applied separately to each matching bit position.
  4. Position 7 (weight 128): OR(1, 1) = 1.
  5. Position 6 (weight 64): OR(1, 1) = 1.
  6. Position 5 (weight 32): OR(1, 0) = 1.
  7. Position 4 (weight 16): OR(1, 1) = 1.
  8. Position 3 (weight 8): OR(0, 0) = 0.
  9. Position 2 (weight 4): OR(0, 1) = 1.
  10. Position 1 (weight 2): OR(1, 1) = 1.
  11. Position 0 (weight 1): OR(0, 0) = 0.
  12. Concatenate the output bits from position seven to zero: 11110110.
  13. The output is 246 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise OR operation.

Final answer: 11110110

Boolean logic · Problem 0260

Calculate 11110111 XOR 10001101.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11110111.
  2. B is the eight-bit string 10001101.
  3. The operation is XOR, applied separately to each matching bit position.
  4. Position 7 (weight 128): XOR(1, 1) = 0.
  5. Position 6 (weight 64): XOR(1, 0) = 1.
  6. Position 5 (weight 32): XOR(1, 0) = 1.
  7. Position 4 (weight 16): XOR(1, 0) = 1.
  8. Position 3 (weight 8): XOR(0, 1) = 1.
  9. Position 2 (weight 4): XOR(1, 1) = 0.
  10. Position 1 (weight 2): XOR(1, 0) = 1.
  11. Position 0 (weight 1): XOR(1, 1) = 0.
  12. Concatenate the output bits from position seven to zero: 01111010.
  13. The output is 122 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise XOR operation.

Final answer: 01111010

Boolean logic · Problem 0261

Calculate 11110111 XOR 10110000.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11110111.
  2. B is the eight-bit string 10110000.
  3. The operation is XOR, applied separately to each matching bit position.
  4. Position 7 (weight 128): XOR(1, 1) = 0.
  5. Position 6 (weight 64): XOR(1, 0) = 1.
  6. Position 5 (weight 32): XOR(1, 1) = 0.
  7. Position 4 (weight 16): XOR(1, 1) = 0.
  8. Position 3 (weight 8): XOR(0, 0) = 0.
  9. Position 2 (weight 4): XOR(1, 0) = 1.
  10. Position 1 (weight 2): XOR(1, 0) = 1.
  11. Position 0 (weight 1): XOR(1, 0) = 1.
  12. Concatenate the output bits from position seven to zero: 01000111.
  13. The output is 71 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise XOR operation.

Final answer: 01000111

Boolean logic · Problem 0262

Calculate 11111000 AND 01110001.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111000.
  2. B is the eight-bit string 01110001.
  3. The operation is AND, applied separately to each matching bit position.
  4. Position 7 (weight 128): AND(1, 0) = 0.
  5. Position 6 (weight 64): AND(1, 1) = 1.
  6. Position 5 (weight 32): AND(1, 1) = 1.
  7. Position 4 (weight 16): AND(1, 1) = 1.
  8. Position 3 (weight 8): AND(1, 0) = 0.
  9. Position 2 (weight 4): AND(0, 0) = 0.
  10. Position 1 (weight 2): AND(0, 0) = 0.
  11. Position 0 (weight 1): AND(0, 1) = 0.
  12. Concatenate the output bits from position seven to zero: 01110000.
  13. The output is 112 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise AND operation.

Final answer: 01110000

Boolean logic · Problem 0263

Calculate 11111000 XOR 11011110.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111000.
  2. B is the eight-bit string 11011110.
  3. The operation is XOR, applied separately to each matching bit position.
  4. Position 7 (weight 128): XOR(1, 1) = 0.
  5. Position 6 (weight 64): XOR(1, 1) = 0.
  6. Position 5 (weight 32): XOR(1, 0) = 1.
  7. Position 4 (weight 16): XOR(1, 1) = 0.
  8. Position 3 (weight 8): XOR(1, 1) = 0.
  9. Position 2 (weight 4): XOR(0, 1) = 1.
  10. Position 1 (weight 2): XOR(0, 1) = 1.
  11. Position 0 (weight 1): XOR(0, 0) = 0.
  12. Concatenate the output bits from position seven to zero: 00100110.
  13. The output is 38 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise XOR operation.

Final answer: 00100110

Boolean logic · Problem 0264

Calculate 11111001 AND 11110010.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111001.
  2. B is the eight-bit string 11110010.
  3. The operation is AND, applied separately to each matching bit position.
  4. Position 7 (weight 128): AND(1, 1) = 1.
  5. Position 6 (weight 64): AND(1, 1) = 1.
  6. Position 5 (weight 32): AND(1, 1) = 1.
  7. Position 4 (weight 16): AND(1, 1) = 1.
  8. Position 3 (weight 8): AND(1, 0) = 0.
  9. Position 2 (weight 4): AND(0, 0) = 0.
  10. Position 1 (weight 2): AND(0, 1) = 0.
  11. Position 0 (weight 1): AND(1, 0) = 0.
  12. Concatenate the output bits from position seven to zero: 11110000.
  13. The output is 240 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise AND operation.

Final answer: 11110000

Boolean logic · Problem 0265

Calculate 11111010 AND 01111111.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111010.
  2. B is the eight-bit string 01111111.
  3. The operation is AND, applied separately to each matching bit position.
  4. Position 7 (weight 128): AND(1, 0) = 0.
  5. Position 6 (weight 64): AND(1, 1) = 1.
  6. Position 5 (weight 32): AND(1, 1) = 1.
  7. Position 4 (weight 16): AND(1, 1) = 1.
  8. Position 3 (weight 8): AND(1, 1) = 1.
  9. Position 2 (weight 4): AND(0, 1) = 0.
  10. Position 1 (weight 2): AND(1, 1) = 1.
  11. Position 0 (weight 1): AND(0, 1) = 0.
  12. Concatenate the output bits from position seven to zero: 01111010.
  13. The output is 122 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise AND operation.

Final answer: 01111010

Boolean logic · Problem 0266

Calculate 11111011 XOR 00001001.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111011.
  2. B is the eight-bit string 00001001.
  3. The operation is XOR, applied separately to each matching bit position.
  4. Position 7 (weight 128): XOR(1, 0) = 1.
  5. Position 6 (weight 64): XOR(1, 0) = 1.
  6. Position 5 (weight 32): XOR(1, 0) = 1.
  7. Position 4 (weight 16): XOR(1, 0) = 1.
  8. Position 3 (weight 8): XOR(1, 1) = 0.
  9. Position 2 (weight 4): XOR(0, 0) = 0.
  10. Position 1 (weight 2): XOR(1, 0) = 1.
  11. Position 0 (weight 1): XOR(1, 1) = 0.
  12. Concatenate the output bits from position seven to zero: 11110010.
  13. The output is 242 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise XOR operation.

Final answer: 11110010

Boolean logic · Problem 0267

Calculate 11111100 XOR 01101111.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111100.
  2. B is the eight-bit string 01101111.
  3. The operation is XOR, applied separately to each matching bit position.
  4. Position 7 (weight 128): XOR(1, 0) = 1.
  5. Position 6 (weight 64): XOR(1, 1) = 0.
  6. Position 5 (weight 32): XOR(1, 1) = 0.
  7. Position 4 (weight 16): XOR(1, 0) = 1.
  8. Position 3 (weight 8): XOR(1, 1) = 0.
  9. Position 2 (weight 4): XOR(1, 1) = 0.
  10. Position 1 (weight 2): XOR(0, 1) = 1.
  11. Position 0 (weight 1): XOR(0, 1) = 1.
  12. Concatenate the output bits from position seven to zero: 10010011.
  13. The output is 147 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise XOR operation.

Final answer: 10010011

Boolean logic · Problem 0268

Calculate 11111101 XOR 01010010.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111101.
  2. B is the eight-bit string 01010010.
  3. The operation is XOR, applied separately to each matching bit position.
  4. Position 7 (weight 128): XOR(1, 0) = 1.
  5. Position 6 (weight 64): XOR(1, 1) = 0.
  6. Position 5 (weight 32): XOR(1, 0) = 1.
  7. Position 4 (weight 16): XOR(1, 1) = 0.
  8. Position 3 (weight 8): XOR(1, 0) = 1.
  9. Position 2 (weight 4): XOR(1, 0) = 1.
  10. Position 1 (weight 2): XOR(0, 1) = 1.
  11. Position 0 (weight 1): XOR(1, 0) = 1.
  12. Concatenate the output bits from position seven to zero: 10101111.
  13. The output is 175 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise XOR operation.

Final answer: 10101111

Boolean logic · Problem 0269

Calculate 11111110 AND 10000100.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111110.
  2. B is the eight-bit string 10000100.
  3. The operation is AND, applied separately to each matching bit position.
  4. Position 7 (weight 128): AND(1, 1) = 1.
  5. Position 6 (weight 64): AND(1, 0) = 0.
  6. Position 5 (weight 32): AND(1, 0) = 0.
  7. Position 4 (weight 16): AND(1, 0) = 0.
  8. Position 3 (weight 8): AND(1, 0) = 0.
  9. Position 2 (weight 4): AND(1, 1) = 1.
  10. Position 1 (weight 2): AND(1, 0) = 0.
  11. Position 0 (weight 1): AND(0, 0) = 0.
  12. Concatenate the output bits from position seven to zero: 10000100.
  13. The output is 132 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise AND operation.

Final answer: 10000100

Boolean logic · Problem 0270

Calculate 11111110 AND 10011000.

Try it on paper first. The worked answer is hidden below.

Reveal detailed solution →
  1. A is the eight-bit string 11111110.
  2. B is the eight-bit string 10011000.
  3. The operation is AND, applied separately to each matching bit position.
  4. Position 7 (weight 128): AND(1, 1) = 1.
  5. Position 6 (weight 64): AND(1, 0) = 0.
  6. Position 5 (weight 32): AND(1, 0) = 0.
  7. Position 4 (weight 16): AND(1, 1) = 1.
  8. Position 3 (weight 8): AND(1, 1) = 1.
  9. Position 2 (weight 4): AND(1, 0) = 0.
  10. Position 1 (weight 2): AND(1, 0) = 0.
  11. Position 0 (weight 1): AND(0, 0) = 0.
  12. Concatenate the output bits from position seven to zero: 10011000.
  13. The output is 152 when interpreted as unsigned decimal.
  14. No arithmetic carries occur in a bitwise AND operation.

Final answer: 10011000