The Gateway to Computer Science Excellence
0 votes
600 views
Let Z = X – Y, X, Y, Z are signed magnitude numbers and X, Y are represented in n-bit numbers. To avoid overflow minimum number of bits would require for Z is _________
(a) n-bit
(b) n + 2 bits
(c) n + 1 bits
(d) (n – 1) bits
in Digital Logic by | 600 views
+3
It is asking about sign magnitude number. n-1 bit is used for representation and most significant bit used for sign bit. Now When overflow occur ? it is occured when both have sign bit same. So , here we can use sign bit as overflow avoidance bit as sign bit is already identified from the input . As they are asking about minimum,  N bits are sufficient to avoid overflow. option A is correct.
0
No, its like overflow occurs when sign bits both are 1 and the output signbit is 0 or both 0 and output is 1.

So n bit plus n bit can result at max in n+1 bits. So the msb will be signbit which is n+1 th bit in Z.

If n bits were used then when 2 negative numbers are added the output is shown as positive which is wrong so n+1 bits.

1 Answer

+6 votes
Its C n+1
by
0
Yes even i thought n+1 it was 2 marks or 1 marks?
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,345 questions
60,489 answers
201,830 comments
95,296 users