84.2k views
5 votes
If you add 111 and 0101 in 4-bit signed fields, is there a carry or overflow?

User Tvo
by
6.1k points

1 Answer

6 votes

Answer: there is an overflow

Step-by-step explanation:

Here using 4-bit signed fields to store the addition value.

0111 + 0101 = 1100

In above addition the MSB is reserved for sign.

If MSB is 0 means the number is positive.

If MSB is 1 means the number is negative.

The first number 0111 has MSB 0 means it is a positive number.

The second number 0101 has MSB 0 means it is also a positive number.

But after addition the result obtained is 1100 which MSB is 1 indicating the

result is negative number.

How can it be possible to add two positive numbers and get a negative number as result.

This type of situation is called overflow situation.

It is used for error detection purpose.

therefore there is an overflow

User Vignesh Jayavel
by
5.7k points