0% found this document useful (0 votes)
26 views3 pages

Question 3 Part I, II

Uploaded by

Alish J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views3 pages

Question 3 Part I, II

Uploaded by

Alish J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Question 3:

i. Obtain the 1’s and 2’s complements of the following binary


numbers:

(a)00010000
1’s Complement: 11101111
2’s Complement:
11101111 + 1 = 11110000

(b) 00000000

1’s Complement: 11111111


2’s Complement:

11111111 + 1 = 00000000

(c) 11011010

1’s Complement: 00100101


2’s Complement:

00100101 + 1 = 00100110

(d) 10101010

1’s Complement: 01010101


2’s Complement:

01010101 +1 = 01010110

(e) 10000101

1’s Complement: 01111010


2’s Complement:

01111010 + 1 = 01111011
ii. Determine the decimal value of each signed binary number:

(a)10011001

1. Sign-Magnitude:
It’s MSB = 1 → means negative
The binary number 0011001 converts to decimal as follows:
=(0×26)+(0×25)+(1×24)+(1×23)+(0×22)+(0×21)+(1×20)
= (0)+(0)+(16)+(8)+(0)+(0)+(1)
= 25
Final Answer: -25

2. One’s Complement:

10011001 becomes 01100110

(0×27)+(1×26)+(1×25)+(0×24)+(0×23)+(1×22)+(1×21)+(0×20)

=0+64+32+0+0+4+2+0 = 102

Final Answer: -25

3. 2’s complement:
=10011001
=01100110 + 1 = 01100111
Into decimal:
=0×27 + 1×26 + 1×25 + 0×24 + 0×23 + 1×22 + 1×21 + 1×20
=0+64+32+0+0+4+2+1
= 103
The number is negative, so
= -103

(b) 01110100

Since MSB 0, the number is positive in all representations.


Binary to Decimal
=0×27+1×26+1×25+1×24+0×23+1×22+0×21+0×20
=0+64+32+16+0+4+0+0=116

Answer (for all cases) = 116

(c) 10111111

1. Sign-Magnitude:
It’s MSB = 1 → means negative
Magnitude: 0111111 = 63
Answer: -63
2. One’s Complement:
MSB 1 → Negative
Invert bits: 01000000
Decimal: 64
Answer: -64
3. 2’s complement:
= 10111111
= 01000000 + 1 = 01000001
Now convert into decimal
= 01000001
= 0 × 2⁷ + 1 × 2⁶ + 0 × 2⁵ + 0 × 2⁴ + 0 × 2³ + 0 × 2² + 0 × 2¹ + 1 × 2⁰
= 0 × 64 + 1 × 64 + 0 + 0 + 0 + 0 + 0 + 1
= 65

Final answer = -65

You might also like