Question

In: Computer Science

Compute the following operations using 8-bits 2’s complement encoded numbers: a. 127-47 b. 47-56 c. 19-120

Compute the following operations using 8-bits 2’s complement encoded numbers:

a. 127-47

b. 47-56

c. 19-120

Solutions

Expert Solution

a.   127 - 47

   Solution -

       (127)   ->   (0111 1111)
       (47)   ->   (0010 1111)   [47 is negative in the equation]
       (-47)   ->   (1101 0001)   [2's complement]


       Adding the two terms

           0111 1111
       +   1101 0001
       -----------------
       1 0101 0000       [overflow is be ignored]

       (0101 0000)   ->   (80)


   Answer -
       127 - 47 = 80

b.

   47 - 56

   Solution -

       (47)   ->   (0010 1111)
       (56)   ->   (0011 1000)   [56 is negative in the equation]
       (-56)   ->   (1100 1000)   [2's complement]


       Adding the two terms

           0010 1111
       +   1100 1000
       -----------------
       1111 0111   [no overflow - take 2's complement again and put negative sign]
  
       (1111 0111)   ->   (0000 1001)   ->   (-9)

   Answer -
       47 - 56 = -9


c.
   19 - 120

   Solution -

       (19)   ->   (0001 0011)
       (120)   ->   (0111 1000)   [-120 is negative in the equation]
       (-120)   ->   (1000 1000)   [2's complement]


       Adding the two terms

           0001 0011
       +   1000 1000
       -----------------
           1001 1011   [no overflow - take 2's complement again and put negative sign]

       (1001 1011)   ->   (0110 0101)   ->   (101)

   Answer -
       19 - 120 = 101


Related Solutions

convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain...
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain all the steps and details.
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain...
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain all the steps and details.
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain...
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain all the steps and details.
convert -97 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain...
convert -97 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain all the steps and details.
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
For the following operations: write the operands as 2's complement binary numbers then perform the addition...
For the following operations: write the operands as 2's complement binary numbers then perform the addition or subtraction operation shown. Show all work in binary operating on 8-bit numbers. 7 + 3 7 - 3 3 - 7
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers,...
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers, • perform the operation shown, • show all work in binary operating on 4-bit numbers, and • identify overflow if necessary. a) 4 + 2 b) 4 – 2 c) 2 – 4 d) 4 + 4
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
Write -127 as 8 bit signed binary number both using 2'complement and sign/magnitude notation.
Write -127 as 8 bit signed binary number both using 2'complement and sign/magnitude notation.
add -19 and 79 using 16-bit 2's complement format
add -19 and 79 using 16-bit 2's complement format
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT