Question

In: Computer Science

All decimal numbers must be converted to signed two’s complement form before working. Use the least...

All decimal numbers must be converted to signed two’s complement form before working.

Use the least number of digits necessary (only using one sign bit) to represent the largest number in a given problem. The smaller number must be represented with the same number of bits.

If overflow occurs, indicate that with a note.

Show step by step subtraction.

13 - 8

6 - 19

21 - 14

Solutions

Expert Solution

13 - 8

The first number is = 13

The second number is = 8

The binary representation of the first number is = 1101

The binary representation of the second number is = 1000

We need to subtraction the second number and we can perform the addition operation by using the two's complement.

So, the two's complement of the second number is = 1000

Now, we will perform the addition operation as given below:

1101 + 1000 = 1 0101

If the sign of two subtraction operands is the same or the sign of two additional operands is different then the overflow never occurs.

So, there is no overflow.

After ignoring the carry bit, the MSB is 0, so the result is positive.

The final result is: 0101

6 - 19

The first number is = 6

The second number is = 19

The binary representation of the first number is = 00110

The binary representation of the second number is = 10011

We need to subtraction the second number and we can perform the addition operation by using the two's complement.

So, the two's complement of the second number is = 01101

Now, we will perform the addition operation as given below:

00110 + 01101 = 10011

If the sign of two subtraction operands is the same or the sign of two additional operands is different then the overflow never occurs.

The MSB of the result is 1, so the result is negative and in two's complement form. The get the actual number, we need to find the two's complement first.

The final result is: 10011

21 - 14

The first number is = 21

The second number is = 14

The binary representation of the first number is = 10101

The binary representation of the second number is = 01110

We need to subtraction the second number and we can perform the addition operation by using the two's complement.

So, the two's complement of the second number is = 10010

Now, we will perform the addition operation as given below:

10101 + 10010 = 100111

If the sign of two subtraction operands is the same or the sign of two additional operands is different then the overflow never occurs.

So, there is no overflow.

After ignoring the carry bit, the MSB is 0, so the result is positive.

The final result is: 00111


Related Solutions

All decimal numbers must be converted to signed two’s complement form before working. Use the least...
All decimal numbers must be converted to signed two’s complement form before working. Use the least number of digits necessary (only using one sign bit) to represent the largest number in a given problem. The smaller number must be represented with the same number of bits. If overflow occurs, indicate that with a note. Show step by step addition. 15 + 6 14 + 18 31 + 5
Find the decimal equivalents for the following 8-bit two’s complement numbers. a. 0010 0100 Decimal Equivalent...
Find the decimal equivalents for the following 8-bit two’s complement numbers. a. 0010 0100 Decimal Equivalent ___________ b. 1010 1001 Decimal Equivalent ___________ c. 1100 0011 Decimal Equivalent ___________ d. 0101 0101 Decimal Equivalent ___________
(a) Convert the decimal numbers, 70 and -26 to binary in the signed 2’s complement system....
(a) Convert the decimal numbers, 70 and -26 to binary in the signed 2’s complement system. Make sure there are enough digits in the results to be able to perform arithmetic operations with these two numbers. (b) Perform in the signed 2’s complement system, (+70) + (-26) (c) Perform in the signed 2’s complement system, (-70) - (-26) (d) Perform in the signed 2’s complement system, (+70) + (+26)
Evaluate the following expressions, where two’s complement numbers, A is 11111110 and B is 00000010 and...
Evaluate the following expressions, where two’s complement numbers, A is 11111110 and B is 00000010 and indicate the results. a. A + B b. A – B c. B–A d. –B e. – (-A)
Add or subtract the following 2’s complement form signed numbers, then convert the entire problem to...
Add or subtract the following 2’s complement form signed numbers, then convert the entire problem to decimal and confirm: 110110 + 111000 001100 – 011100
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7...
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7 5 -3
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7...
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7 5 -3
Represent (in binary and separately) the decimal signed whole numbers 347 and -347 in each of...
Represent (in binary and separately) the decimal signed whole numbers 347 and -347 in each of the following formats: (a) sign-magnitude. (b) 1's complement (c) 2's complement (d) excess-511 For Parts (a), (b) and (c), use the minimum number of bits necessary; for Part (d), use the same number of bits as in Parts (a), (b) and (c). CAUTION: You will earn NO CREDITS if you simply show the final result and not clearly show working (i.e., intermediate steps). (If...
Part 2: Signed values: Convert each as indicated. 8. Decimal to Hexadecimal (1 byte, one's complement)...
Part 2: Signed values: Convert each as indicated. 8. Decimal to Hexadecimal (1 byte, one's complement)      a. -18      b. -41
Convert decimal +47 and +31 to binary, using the signed-2’s-complement representation and enough digits to accommodate...
Convert decimal +47 and +31 to binary, using the signed-2’s-complement representation and enough digits to accommodate the numbers. Then perform the binary equivalent of (+31)+(-47), (-31)+(+47), and (-31)+(-47). Convert the answers back to decimal and verify that they are correct.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT