• :00Days
• :00Hours
• :00Mins
• 00Seconds
A new era for learning is coming soon Suggested languages for you:

Europe

Answers without the blur. Sign up and see all textbooks for free! Q40E

Expert-verified Found in: Page 256 ### Discrete Mathematics and its Applications

Book edition 7th
Author(s) Kenneth H. Rosen
Pages 808 pages
ISBN 9780073383095 # Find the two’s complement representations, using bit strings of length six, of the following integers. a) 22 b) 31 c) −7 d) −19

The one’s complement representations, using bit strings of length six

$a\right)010110\phantom{\rule{0ex}{0ex}}b\right)011111\phantom{\rule{0ex}{0ex}}c\right)111001\phantom{\rule{0ex}{0ex}}d\right)101101$

See the step by step solution

## Step 1:

a) You obtain the binary expansion of an integer by consecutively dividing the integer by 2 until you obtain 0

$\begin{array}{r}22=2.11+0\\ 11=2.5+1\\ 5=2.2+1\\ 2=2.2+0\\ 1=2.0+1\end{array}$

The successive remainders of each division represents the binary expansion from right to left.

10110

Since 22 is positive, we add a 0 to the left of the binary expansions (to signify a positive number)

$010110$

## Step 2:

b) You obtain the binary expansion of an integer by consecutively dividing the integer by 2 until you obtain 0

$\begin{array}{r}31=2.15+1\\ 15=2.7+1\\ 7=2.3+1\\ 3=2.1+1\\ 1=2.0+1\end{array}$

c) The successive remainders of each division represents the binary expansion from right to left.

11111

Since 31 is positive, we add a 0 to the left of the binary expansions (to signify a positive number)

011111

## Step 3:

d) You obtain the binary expansion of an integer by consecutively dividing the integer by 2 until you obtain 0

$\begin{array}{r}7=2.3+1\\ 3=2.1+1\\ 1=2.0+1\end{array}$

The successive remainders of each division represents the binary expansion from right to left.

111

Since two’s complement needs to contain 6 bits, the expansion will need to contain 5 bits, thus add 0’s in front of the binary expansion until we obtain 5 bits.

00111

Since -7 is negative, subtract 00111 from 100000

$\left(100000{\right)}_{2}-\left(00111{\right)}_{2}=\left(11001{\right)}_{2}$

Note: you could determine the difference by using $\left(00111{\right)}_{2}+\left(11001{\right)}_{2}=\left(100000{\right)}_{2}$

Since -7 is negative, we add a 1 to the left of the previous result (to signify a negative number).

111001

## Step 4:

e) You obtain the binary expansion of an integer by consecutively dividing the integer by 2 until you obtain 0

$\begin{array}{r}19=2.9+1\\ 9=2.4+1\\ 4=2.2+1\\ 2=2.1+0\\ 1=2.0+1\end{array}$

The successive remainders of each division represents the binary expansion from right to left.

10011

Since -19 is negative, subtract 10011 from 100000

$\left(100000{\right)}_{2}-\left(10011{\right)}_{2}=\left(01101{\right)}_{2}$

Note: you could determine the difference by using $\left(10011{\right)}_{2}+\left(01101{\right)}_{2}=\left(100000{\right)}_{2}$

Since -19 is negative, we add a 1 to the left of the previous result (to signify a negative number).

101101 ### Want to see more solutions like these? 