Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Binary arithmetic in 8-bit 2\'s complement. Please just keep only 8 bits of your

ID: 3752778 • Letter: B

Question

Binary arithmetic in 8-bit 2's complement. Please just keep only 8 bits of your answer. The subtraction is performed by negating the second operand to form the 2's complement then add it to the first operand. (15 points) 5. a. 5310+ 2310 Operand 1 in binary: Operand 2 in binary: Result in binary: Result in decimal: b. 6310 1410 Operand 1 in binary: Operand 2 in binary: Negated operand 2 in binary: Result in binary: Result in decimal: c. 3010 991o Operand 1 in binary: Operand 2 in binary Result in binary: Result in decimal: What happened in this calculation? Use a sentence to explain

Explanation / Answer

(a)

5310 in binary is 001101012.

2310 in binary is 000101112.

When 0 + 0, then answer is 0 and there is no carry.

When 1 + 0, then answer is 1 and there is no carry.

When 1 + 1, then answer is 0 and carry=1.

When 1+1+1, then answer is 1 and carry=1.

Now, adding 00110101 and 00010111.

0 0 1 1 0 1 0 1 (5310)

+ 0 0 0 1 0 1 1 1 (2310)

= 0 1 0 0 1 1 0 0 (7610)

So,answer is 7610 and 010011002 in binary.

(b) 6310 in binary is 001111112.

1410 in binary is 000011102.

Now 8-bit 1's complement of 000011102 is 11110001(by flipping all the bits)

We get 2's complement by adding 1 to 1's complement.

So, -1410 in 2's complement form is 111100102.

Now,adding 00111111 and 11110010

0 0 1 1 1 1 1 1 (6310)

+ 1 1 1 1 0 0 1 0 (-1410)

= 1 0 0 1 1 0 0 0 1 (4910)

As there is an overflow, so result is positive.

So, answer is 4910 which is 00110001 in binary (without the overflow bit).

(c) 3010 in binary is 000111102.

9910 in binary is 011000112.

Now,adding 00011110 and 01100011

0 0 0 1 1 1 1 0 (3010)

+ 0 1 1 0 0 0 1 1 (9910)

= 1 0 0 0 0 0 0 1 (12910)

So, answer is 12910 which is 10000001 in binary.