Skip to content
Official PYQ · 2017

GATE CS 2017 Set 1 Q9 — Number Representations (Fixed and Floating Point)

Explain with AI

When two 8-bit8\text{-bit} numbers A7⋯A0A_{7}\cdots A_{0} and B7⋯B0B_{7}\cdots B_{0} in 22's complement representation (with A0A_{0} and B0B_{0} as the least significant bits) are added using a ripple-carry adder, the sum bits obtained are S7⋯S0S_{7}\cdots S_{0} and the carry bits are C7⋯C0C_{7}\cdots C_{0}. An overflow is said to have occurred if

Choose one option
View worked solution

Answer: C

In 22's complement representation, an overflow occurs during addition if and only if the addition of two numbers with the same sign results in a sum with the opposite sign. Adding a positive number and a negative number can never result in an overflow.

For 88-bit numbers, the sign bits (Most Significant Bits) are A7A_7, B7B_7, and the resulting sum sign bit is S7S_7.

There are two possible scenarios for overflow:

  1. Adding two negative numbers results in a positive sum:
    • Both inputs are negative: A7=1A_7 = 1 and B7=1B_7 = 1
    • The sum is positive: S7=0S_7 = 0 (which means S7‾=1\overline{S_7} = 1)
    • This condition is represented by the boolean expression: A7⋅B7⋅S7‾A_7 \cdot B_7 \cdot \overline{S_7}
  2. Adding two positive numbers results in a negative sum:
    • Both inputs are positive: A7=0A_7 = 0 and B7=0B_7 = 0 (which means A7‾=1\overline{A_7} = 1 and B7‾=1\overline{B_7} = 1)
    • The sum is negative: S7=1S_7 = 1
    • This condition is represented by the boolean expression: A7‾⋅B7‾⋅S7\overline{A_7} \cdot \overline{B_7} \cdot S_7

Combining these two mutually exclusive cases, the overall overflow condition is:

Overflow=(A7⋅B7⋅S7‾)+(A7‾⋅B7‾⋅S7)=1\text{Overflow} = (A_7 \cdot B_7 \cdot \overline{S_7}) + (\overline{A_7} \cdot \overline{B_7} \cdot S_7) = 1

Thus, Option C is the correct expression.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Number Representations (Fixed and Floating Point) questions