01How Computers Work

Fully solved problem book

Signed eight-bit values

Set 1 of 8 · 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.

Foundations · Problem 0001

Interpret 00000000 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00000000 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 0.
  6. Add those contributions: 0 + 0 = 0.
  7. As an unsigned pattern, the same eight bits represent 0.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11111111; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 00000000.
  11. Answer: signed(00000000) = 0.

Final answer: 0

Foundations · Problem 0002

Interpret 00000001 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00000001 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 1.
  6. Add those contributions: 0 + 1 = 1.
  7. As an unsigned pattern, the same eight bits represent 1.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11111110; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11111111.
  11. Answer: signed(00000001) = 1.

Final answer: 1

Foundations · Problem 0003

Interpret 00000010 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00000010 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 2.
  6. Add those contributions: 0 + 2 = 2.
  7. As an unsigned pattern, the same eight bits represent 2.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11111101; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11111110.
  11. Answer: signed(00000010) = 2.

Final answer: 2

Foundations · Problem 0004

Interpret 00000011 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00000011 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 3.
  6. Add those contributions: 0 + 3 = 3.
  7. As an unsigned pattern, the same eight bits represent 3.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11111100; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11111101.
  11. Answer: signed(00000011) = 3.

Final answer: 3

Foundations · Problem 0005

Interpret 00000100 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00000100 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 4.
  6. Add those contributions: 0 + 4 = 4.
  7. As an unsigned pattern, the same eight bits represent 4.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11111011; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11111100.
  11. Answer: signed(00000100) = 4.

Final answer: 4

Foundations · Problem 0006

Interpret 00000101 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00000101 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 5.
  6. Add those contributions: 0 + 5 = 5.
  7. As an unsigned pattern, the same eight bits represent 5.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11111010; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11111011.
  11. Answer: signed(00000101) = 5.

Final answer: 5

Foundations · Problem 0007

Interpret 00000110 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00000110 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 6.
  6. Add those contributions: 0 + 6 = 6.
  7. As an unsigned pattern, the same eight bits represent 6.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11111001; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11111010.
  11. Answer: signed(00000110) = 6.

Final answer: 6

Foundations · Problem 0008

Interpret 00000111 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00000111 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 7.
  6. Add those contributions: 0 + 7 = 7.
  7. As an unsigned pattern, the same eight bits represent 7.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11111000; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11111001.
  11. Answer: signed(00000111) = 7.

Final answer: 7

Foundations · Problem 0009

Interpret 00001000 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00001000 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 8.
  6. Add those contributions: 0 + 8 = 8.
  7. As an unsigned pattern, the same eight bits represent 8.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11110111; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11111000.
  11. Answer: signed(00001000) = 8.

Final answer: 8

Foundations · Problem 0010

Interpret 00001001 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00001001 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 9.
  6. Add those contributions: 0 + 9 = 9.
  7. As an unsigned pattern, the same eight bits represent 9.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11110110; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11110111.
  11. Answer: signed(00001001) = 9.

Final answer: 9

Foundations · Problem 0011

Interpret 00001010 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00001010 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 10.
  6. Add those contributions: 0 + 10 = 10.
  7. As an unsigned pattern, the same eight bits represent 10.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11110101; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11110110.
  11. Answer: signed(00001010) = 10.

Final answer: 10

Foundations · Problem 0012

Interpret 00001011 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00001011 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 11.
  6. Add those contributions: 0 + 11 = 11.
  7. As an unsigned pattern, the same eight bits represent 11.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11110100; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11110101.
  11. Answer: signed(00001011) = 11.

Final answer: 11

Foundations · Problem 0013

Interpret 00001100 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00001100 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 12.
  6. Add those contributions: 0 + 12 = 12.
  7. As an unsigned pattern, the same eight bits represent 12.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11110011; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11110100.
  11. Answer: signed(00001100) = 12.

Final answer: 12

Foundations · Problem 0014

Interpret 00001101 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00001101 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 13.
  6. Add those contributions: 0 + 13 = 13.
  7. As an unsigned pattern, the same eight bits represent 13.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11110010; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11110011.
  11. Answer: signed(00001101) = 13.

Final answer: 13

Foundations · Problem 0015

Interpret 00001110 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00001110 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 14.
  6. Add those contributions: 0 + 14 = 14.
  7. As an unsigned pattern, the same eight bits represent 14.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11110001; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11110010.
  11. Answer: signed(00001110) = 14.

Final answer: 14

Foundations · Problem 0016

Interpret 00001111 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00001111 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 15.
  6. Add those contributions: 0 + 15 = 15.
  7. As an unsigned pattern, the same eight bits represent 15.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11110000; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11110001.
  11. Answer: signed(00001111) = 15.

Final answer: 15

Foundations · Problem 0017

Interpret 00010000 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00010000 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 16.
  6. Add those contributions: 0 + 16 = 16.
  7. As an unsigned pattern, the same eight bits represent 16.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11101111; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11110000.
  11. Answer: signed(00010000) = 16.

Final answer: 16

Foundations · Problem 0018

Interpret 00010001 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00010001 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 17.
  6. Add those contributions: 0 + 17 = 17.
  7. As an unsigned pattern, the same eight bits represent 17.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11101110; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11101111.
  11. Answer: signed(00010001) = 17.

Final answer: 17

Foundations · Problem 0019

Interpret 00010010 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00010010 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 18.
  6. Add those contributions: 0 + 18 = 18.
  7. As an unsigned pattern, the same eight bits represent 18.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11101101; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11101110.
  11. Answer: signed(00010010) = 18.

Final answer: 18

Foundations · Problem 0020

Interpret 00010011 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00010011 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 19.
  6. Add those contributions: 0 + 19 = 19.
  7. As an unsigned pattern, the same eight bits represent 19.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11101100; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11101101.
  11. Answer: signed(00010011) = 19.

Final answer: 19

Foundations · Problem 0021

Interpret 00010100 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00010100 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 20.
  6. Add those contributions: 0 + 20 = 20.
  7. As an unsigned pattern, the same eight bits represent 20.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11101011; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11101100.
  11. Answer: signed(00010100) = 20.

Final answer: 20

Foundations · Problem 0022

Interpret 00010101 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00010101 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 21.
  6. Add those contributions: 0 + 21 = 21.
  7. As an unsigned pattern, the same eight bits represent 21.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11101010; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11101011.
  11. Answer: signed(00010101) = 21.

Final answer: 21

Foundations · Problem 0023

Interpret 00010110 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00010110 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 22.
  6. Add those contributions: 0 + 22 = 22.
  7. As an unsigned pattern, the same eight bits represent 22.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11101001; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11101010.
  11. Answer: signed(00010110) = 22.

Final answer: 22

Foundations · Problem 0024

Interpret 00010111 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00010111 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 23.
  6. Add those contributions: 0 + 23 = 23.
  7. As an unsigned pattern, the same eight bits represent 23.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11101000; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11101001.
  11. Answer: signed(00010111) = 23.

Final answer: 23

Foundations · Problem 0025

Interpret 00011000 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00011000 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 24.
  6. Add those contributions: 0 + 24 = 24.
  7. As an unsigned pattern, the same eight bits represent 24.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11100111; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11101000.
  11. Answer: signed(00011000) = 24.

Final answer: 24

Foundations · Problem 0026

Interpret 00011001 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00011001 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 25.
  6. Add those contributions: 0 + 25 = 25.
  7. As an unsigned pattern, the same eight bits represent 25.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11100110; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11100111.
  11. Answer: signed(00011001) = 25.

Final answer: 25

Foundations · Problem 0027

Interpret 00011010 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00011010 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 26.
  6. Add those contributions: 0 + 26 = 26.
  7. As an unsigned pattern, the same eight bits represent 26.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11100101; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11100110.
  11. Answer: signed(00011010) = 26.

Final answer: 26

Foundations · Problem 0028

Interpret 00011011 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00011011 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 27.
  6. Add those contributions: 0 + 27 = 27.
  7. As an unsigned pattern, the same eight bits represent 27.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11100100; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11100101.
  11. Answer: signed(00011011) = 27.

Final answer: 27

Foundations · Problem 0029

Interpret 00011100 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00011100 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 28.
  6. Add those contributions: 0 + 28 = 28.
  7. As an unsigned pattern, the same eight bits represent 28.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11100011; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11100100.
  11. Answer: signed(00011100) = 28.

Final answer: 28

Foundations · Problem 0030

Interpret 00011101 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00011101 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 29.
  6. Add those contributions: 0 + 29 = 29.
  7. As an unsigned pattern, the same eight bits represent 29.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11100010; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11100011.
  11. Answer: signed(00011101) = 29.

Final answer: 29

Foundations · Problem 0031

Interpret 00011110 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00011110 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 30.
  6. Add those contributions: 0 + 30 = 30.
  7. As an unsigned pattern, the same eight bits represent 30.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11100001; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11100010.
  11. Answer: signed(00011110) = 30.

Final answer: 30

Foundations · Problem 0032

Interpret 00011111 as an 8-bit two’s complement value.

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

Reveal detailed solution →
  1. Treat 00011111 as exactly eight bits.
  2. For signed 8-bit values the leftmost column has weight −128, not +128.
  3. The remaining seven columns have weights 64, 32, 16, 8, 4, 2 and 1.
  4. The leading sign bit is 0, so its signed contribution is 0.
  5. The lower seven bits contribute 31.
  6. Add those contributions: 0 + 31 = 31.
  7. As an unsigned pattern, the same eight bits represent 31.
  8. The signed range for eight bits is −128 through +127.
  9. Bitwise inversion alone yields 11100000; inversion plus one wraps modulo 256.
  10. The eight-bit negated pattern is 11100001.
  11. Answer: signed(00011111) = 31.

Final answer: 31