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}{&} \)

Section3.2Exercises

1

How many bits are required to store a single decimal digit?

Hint Answer
2

Develop an algorithm for adding fixed-width integers in the binary number system.

Hint Solution
3

Develop an algorithm for adding fixed-width integers in the hexadecimal number system.

Solution
4

Using the answer from Exercise 3.2.1, invent a code for storing two decimal digits in 32 bits. Using this code, does binary addition produce the correct results?

Solution
5

Develop an algorithm for subtracting fixed-width integers in the binary number system.

Hint Solution
6

Develop an algorithm for adding fixed-width integers in the hexadecimal number system.

Solution