Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Computer Programming
Dr. Deepak B Phatak
Dr. Supratik Chakraborty
Department of Computer Science and Engineering
IIT Bombay
Session: More on Twos Complement Representation
011
How about 101, 111, ?
101
+3
100
+0
000 +1 8 numbers represented:
-1
111 001 -4 through +3
101 011
-3 +3
100
-4
+0
000 +1 INCREASING
111 001
-4 -3 -2 -1 +0 +1 +2 +3
110 010 +2
100 101 110 111 000 001 010 011
101 011
+3
100
INCREASING
-4 -3 -2 -1 +0 +1 +2 +3
Desired map: 11 1, 10 2, 01 3, 00 4
Observation: 11 (represents unsigned 3) 22 3 = 1
10 (represents unsigned 2) 22 2 = 2
01 (represents unsigned 1) 22 1 = 3
00 (represents unsigned 0) 22 0 = 4
Dr. Deepak B. Phatak & Dr. Supratik Chakraborty, IIT Bombay 10
Magnitudes of Negative Integers
IIT Bombay
INCREASING
-4 -3 -2 -1 +0 +1 +2 +3
Desired map: 11 1, 10 2, 01 3, 00 4
Observation: 11 (represents unsigned 3) 00 (= 0) + 1 = 1
10 (represents unsigned 2) 01 (= 1) + 1 = 2
01 (represents unsigned 1) 10 (= 2) + 1 = 3
00 (represents unsigned 0) 11 (= 3) + 1 = 4
Dr. Deepak B. Phatak & Dr. Supratik Chakraborty, IIT Bombay 11
Magnitude of Negative Integers
IIT Bombay