Question

In: Computer Science

Problem 5: Perform the subtraction on the following pairs of signed numbers using the 2’s complement...

Problem 5: Perform the subtraction on the following pairs of signed numbers using the 2’s complement system. Express the results as signed binary numbers and as decimal values. Please show all work to fully understand.

A. 01001 - 11010 B. 10010 - 10011

Solutions

Expert Solution

A. Given pair of signed numbers are : 01001,11010

Binary Decimal value
01001 9
11010 26

01001 - 11010 = 9 - 26 = 9+(-26)

Using the 2’s complement : -26 = 2's complement of 26

2's complement of a number is nothing but 1's complement of number + 1.

26 = 11010, 1's complement of 26 is 00101.

Note : 1's complement is just inversion of all bits in the given number.

2's complement of 26 : 00101 + 1= 00110.

-26 = 00110

Decimal Binary
9 0 1 0 0 1
+ -26 0 0 1 1 0
Result -17 0 1 1 1 1

0 1 1 1 1, there is no carry in the result. It is clear that the result is negative.

Inversion of all bits : 10000 [Inversion of 01111]

Adding 1 : 10000+1 = 10001

Binary representation of 17 is (10001)2.

Conclusion : The result is -17. [which is equivalent to decimal result]

B. 10010 - 10011

(10010)2 = (18)10 , (10011)2 = (19)10

18-19 = 18+(-19)

-19 = 2's complement of 19

2's complement of 19 = 01100 + 1 = 01101 [ 1's complement of 19 + 1]

Decimal Binary
18 1 0 0 1 0
+ -19 0 1 1 0 1
Result -1 1 1 1 1 1

Here also there is no carry in the result. It is clear that the result is negative.

Note : We know that -1 is represented as all 1's in 2's complement form.

Inversion of all bits : 00000 [Inversion of 11111]

Adding 1 : 00000+1 = 00001

Conclusion : The result is -1. [which is equivalent to decimal result]


Related Solutions

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
(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)
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
Identify the following numbers using 2’s complement by making suitable assumptions: a. 1710 + 610 b....
Identify the following numbers using 2’s complement by making suitable assumptions: a. 1710 + 610 b. 2110 – 410 c. -1310 - 2010
Convert each of the following 5-digit 6’s complement base 7 numbers to 9-digit 4’s complement base...
Convert each of the following 5-digit 6’s complement base 7 numbers to 9-digit 4’s complement base 4. Be careful, show all your reasoning/arithmetic, and make no unwarranted assumptions! (a) 50135 (b) 11402
Problem: Perform following operations in binary using 8-bit addition/subtraction/multiplication. 1. −80 + 42 2. −99 −...
Problem: Perform following operations in binary using 8-bit addition/subtraction/multiplication. 1. −80 + 42 2. −99 − 20 3. 60 − 70 4. −59 × 3 5. 52×−1
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.
Please read carefully. Using the minimum number of digits in 2’s complement notation, perform 25 –...
Please read carefully. Using the minimum number of digits in 2’s complement notation, perform 25 – 18 (subtraction by preserving addition). Show all the significant steps in your work by indicating the starting values, sign conversion and the addition operation aligning all numbers including the carry values in each position using the Courier New font. Indicate the final value as a decimal.
add the following numbers using 16-bit 2's complement. show all the steps and calculations. Please also...
add the following numbers using 16-bit 2's complement. show all the steps and calculations. Please also show steps to verify that the answer is correct. -7493 and -6372
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT