• :00Days
  • :00Hours
  • :00Mins
  • 00Seconds
A new era for learning is coming soonSign up for free
Log In Start studying!

Select your language

Suggested languages for you:
Answers without the blur. Sign up and see all textbooks for free! Illustration

Q40E

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

Discrete Mathematics and its Applications

Book edition 7th
Author(s) Kenneth H. Rosen
Pages 808 pages
ISBN 9780073383095

Answers without the blur.

Just sign up for free and you're in.

Illustration

Short Answer

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)010110b)011111c)111001d)101101

See the step by step solution

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

22=2.11+011=2.5+1 5=2.2+1 2=2.2+0 1=2.0+1

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

31=2.15+115=2.7+1 7=2.3+1 3=2.1+1 1=2.0+1

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

7=2.3+13=2.1+11=2.0+1

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

(100000)2(00111)2=(11001)2

Note: you could determine the difference by using (00111)2+(11001)2=(100000)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

19=2.9+19=2.4+14=2.2+12=2.1+01=2.0+1

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

10011

Since -19 is negative, subtract 10011 from 100000

(100000)2(10011)2=(01101)2

Note: you could determine the difference by using (10011)2+(01101)2=(100000)2

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

101101

Recommended explanations on Math Textbooks

94% of StudySmarter users get better grades.

Sign up for free
94% of StudySmarter users get better grades.