Problem No.
01
Subtract 45 from 102 using 2,s complement
102-45
Notepositive number remains as such in 2,s
complement or any base complement
----------------------------------------------------------------------------------
0 1 1 0 0 1 1 0 represent 102
00101101
represent 45
1 1 0 1 0 0 1 0 on inverting we get this number
adding 1 we get
11010011
which is 2,s complement of -45
1------- carry in to MSB,s
01100110
----102
11010011
-45 in 2,s Complement
----------------------------------------------------1 0 0 1 1 1 0 0 1 Result 102-45
1 is ------ carry out of MSB and
0 0 1 1 1 0 0 1 equal to 57
Both carries (1and 1 ) are same hence no
ovf
Problem-02
Add
82+46 in 2,s complement
1--- carry in to MSB,s
01010010
00101110
0 1 0 0 0 0 0 0 0 carry out of MSB is 0,and
carry in to MSB,s 1 hence, ovf (as both are
different)
Problem-3
Add -82-46 in 2,s complement
0 1 0 1 0 0 1 0 --------- 82
10101101
on inverting
1 0 1 0 1 1 1 0 by adding 1 , we get 2.s
Complement of 82
00101110-----46
Similarly 2,s complement of 46 is
11010010
---------------------------------------------------------------------------------------------------------1
10101110
11010010
1 10000000
Carry in to MSB,s and out of MSB is same
thus no overflow and MSB 1 indicate it is
ve number.revert it back to bainary
10000000
1 subtraction
------------------0 1 1 1 1 1 1 1 now invert this we get
1 0 0 0 0 0 0 0 which is 128 and number is
negative as indicated by MSB 1
Problem-04
Find the decimal values of binary numbers: i) 10010001 and ii) 11100111 in
sign and magnitude, 1s complement, 2s complement and binary coded
decimal representations
Sign and magnitude
10010001-------- = -17
11100111
= -103
1,s compliment
10010001------ = -110
11100111
= - 24
2,s compliment
10010001------ = -111
11100111
= - 25
BCD REPRESENTATION
1001 0001------ = 91
1110 0111
= not defined
Represent 1237 in BCD
Ans.
0001 0010 0011 0111