Q2 · Binary arithmetic and overflow

Variations in the paper’s own format. Scratch paper only, 6 minutes per variation. Write each result at the width of the wider operand. Solutions are on a separate page.

Method, three lines: sign-extend the shorter operand by copying its top bit · a − b = a + (−b), negate once then add · overflow only when two same-sign operands give the other sign; drop the carry-out before judging.

Variation 1 2 pts · 6 min

The following are 2’s complement binary numbers. Perform the following operations and indicate if any of the operations generate overflow.

Q2.1 Binary Arithmetic/Overflow - part a 0.5
1010 + 11 =

Overflow?

  • Yes
  • No

Q2.2 Binary Arithmetic/Overflow - part b 0.5
0110 + 011 =

Overflow?

  • Yes
  • No

Q2.3 Binary Arithmetic/Overflow - part c 0.5
10000000 + 1110 =

Overflow?

  • Yes
  • No

Q2.4 Binary Arithmetic/Overflow - part d 0.5
01001 - xC =

Overflow?

  • Yes
  • No
Solutions