You are on page 1of 2

Two's Complement Exercises

Answers:
1. Find the 8-bit two's complement of 26

10

a) write the 8-bit binary representation of 26


26 = (16 + 8 + 2) = 11010 = 00011010
10

10

10

b) switch all the 1's to 0's and 0's to 1's


11100101

c) add 1 in binary notation


11100101
+
1
11100110

Therefore, the 8-bit two's complement of 26 is 11100110 .


10

2. Find the decimal representation of the two's complement number 11010011

a) find the two's complement of 11010011


1. switch all 1's to 0's and 0's to 1's ; 11010011

00101100

2. add 1 in binary notation


00101100
+
1
00101101

b. write the decimal representation of 00101101

00101101 = (32 + 8 + 4 + 1) = 45
2

10

10

Therefore, the decimal representation of the two's complement 11010011 is -45 .


2

10

You might also like