Solutions to binary practice problems

  1. Convert the following base ten (decimal) numbers into binary.

    1. 6    = 110₂
    2. 18    = 10010₂
    3. 51    = 110011₂
    4. 63    = 111111₂
  2. Convert the following unsigned binary numbers into base ten.

    1. 1010    = 10₁₀ (ten)
    2. 1101    = 13₁₀
    3. 1000    = 8₁₀
    4. 10001    = 17₁₀
  3. What do all odd numbers have in common, when written in binary? (Hint: try writing the quantities 3, 5, 7, 9, 11 in binary.)

    Odd numbers always end with a 1.

  4. Using 7-bit signed (two’s complement) binary numbers, what is the largest positive number? What is the most negative number?

    Largest is +63, most negative is –64.

  5. Convert the following 5-bit signed (two’s complement) binary numbers into base ten.

    1. 01101    = +13
    2. 01111    = +15
    3. 10011    = –13
    4. 11111    = –1
  6. Convert the following 16-bit binary number into hexadecimal, and then into octal.

    0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0

    Hexadecimal: 0111,1111,0011,1010 = 7F3A
    Octal: 0,111,111,100,111,010 = 77472 (I initially had a mistake here.)

  7. Convert the following hexadecimal numbers into binary:

    1. 9D    = 1001,1101
    2. C4    = 1100,0100
    3. A17E    = 1010,0001,0111,1110
  8. Add and verify the following unsigned binary numbers.

    We keep the extra carry bit, because these are unsigned and I didn’t say they were fixed width!

    1 1 1 1 1 1                      1     1
      1 0 1 1 1 1  = 47                1 1 0 1 1 1  = 55
    +   1 1 1 0 1  = 29              + 1 0 0 1 0 0  = 36
    ——————————————                   ——————————————
    1 0 0 1 1 0 0  = 76              1 0 1 1 0 1 1  = 91