Skip to main content
\(\newcommand{\doubler}[1]{2#1} \newcommand{\binary}{\mathtt} \newcommand{\hex}{\mathtt} \newcommand{\octal}{\mathtt} \newcommand{\prog}{\mathtt} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section2.2Exercises

1

Express the following bit patterns in hexadecimal.

  1. \(\binary{0100} \; \binary{0101} \; \binary{0110} \; \binary{0111}\)

  2. \(\binary{1000} \; \binary{1001} \; \binary{1010} \; \binary{1011}\)

  3. \(\binary{1111} \; \binary{1110} \; \binary{1101} \; \binary{1100}\)

  4. \(\binary{0000} \; \binary{0010} \; \binary{0101} \; \binary{0010}\)

Answer

  1. \(\hex{4567}\)

  2. \(\hex{89ab}\)

  3. \(\hex{fedc}\)

  4. \(\hex{0252}\)

2

Express the following bit patterns in binary.

  1. \(\hex{83af}\)

  2. \(\hex{9001}\)

  3. \(\hex{aaaa}\)

  4. \(\hex{5555}\)

Answer

  1. \(\binary{1000} \; \binary{0011} \; \binary{1010} \; \binary{1111}\)

  2. \(\binary{1001} \; \binary{0000} \; \binary{0000} \; \binary{0001}\)

  3. \(\binary{1010} \; \binary{1010} \; \binary{1010} \; \binary{1010}\)

  4. \(\binary{0101} \; \binary{0101} \; \binary{0101} \; \binary{0101}\)

3

How many bits are represented by each of the following?

  1. \(\hex{ffff} \; \hex{ffff}\)

  2. \(\hex{7fff} \; \hex{58b7} \; \hex{def0}\)

  3. \(\binary{1111}_{2}\)

  4. \(\hex{1111}_{16}\)

Hint

Don't forget that each hexadecimal digit represents 4 bits.

Answer

  1. \(32\)

  2. \(48\)

  3. \(4\)

  4. \(16\)

4

How many hexadecimal digits are required to represent each of the following?

  1. eight bits

  2. thirty-two bits

  3. sixty-four bits

  4. ten bits

  5. twenty bits

  6. seven bits

Hint

One hexadecimal digit is required to represent one–four bits.

Answer

  1. \(2\)

  2. \(8\)

  3. \(16\)

  4. \(3\)

  5. \(5\)

  6. \(2\)