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

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
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.
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.
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
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
1. What is the two’s complement of: 00110101 2. Carry out the following calculation using 8-bit...
1. What is the two’s complement of: 00110101 2. Carry out the following calculation using 8-bit signed arithmetic (convert to 8-bit binary sequences) and use two’s complement for the negative number, give the result as both an 8-bit binary sequence and in base 10: 127 – 74. 3. What does shifting a binary sequence to left by 3 places correspond to (from the arithmetic standpoint)
Convert the following numbers to 8-bit binary and 8-bit hexadecimal: a) 20 b) 78 c) -25...
Convert the following numbers to 8-bit binary and 8-bit hexadecimal: a) 20 b) 78 c) -25 d) -96 Convert the following hexadecimal numbers to binary and decimal assuming two's compliment format: a) 0x56 b) 0x14 c) 0xF8 d) 0xCC MUST DO ALL PROBLEMS AND SHOW ALL WORK!!!!
Convert each of following numbers to Octal numbers, showing all steps. a. (111110110)2 b. (1100010)2 c....
Convert each of following numbers to Octal numbers, showing all steps. a. (111110110)2 b. (1100010)2 c. (2001)10 d. (1492)10 e. (A9)16 f. (5FF71 )16
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT