in Digital Logic edited by
2,624 views
2 votes
2 votes
$(a) A = 101010$ and $B = 011101$ are $1’s$ complement numbers. Perform the following operations and indicate whether overflow occurs.

$(i) A + B$

$(ii) A − B$

$(b)$ Repeat part $(a)$ assuming the numbers are $2’s$ complement numbers.
in Digital Logic edited by
2.6k views

1 Answer

0 votes
0 votes
for 1's complement

a)A=101010=-21 and B=+34  maximum range of number in 1's complement number for 6 bit  is -31 to +31 so A+B can't overflow.

b) A-B =-55 which is out of range so overflow occur.

for 2's complement range =-32 to +31

a)A=101010=-22 and B=+35

A+B overflow can't occur.

b)A-B =-57 overflow occur

4 Comments

@BASANT KUMAR

the 2's complement of +ve number is the number itself.

B=011110 which is +ve number so B value should be 29 not 35(2's complement is done for negative nos)

correct me  if m wrong??

1
1
same issue bro. I also have the same question.You are absolutely right from my side.
0
0
The thing is, performing 2’s complement changes the sign of number. +ve changes to -ve and vice versa. There is no compulsion that you get only -ve no upon 2’s complement. And hence 2’s complement on B gives you 35 only.
0
0

Related questions