Question

In: Computer Science

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

Solutions

Expert Solution

Number: -7493
Let's convert this to two's complement binary
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Divide 7493 successively by 2 until the quotient is 0
   > 7493/2 = 3746, remainder is 1
   > 3746/2 = 1873, remainder is 0
   > 1873/2 = 936, remainder is 1
   > 936/2 = 468, remainder is 0
   > 468/2 = 234, remainder is 0
   > 234/2 = 117, remainder is 0
   > 117/2 = 58, remainder is 1
   > 58/2 = 29, remainder is 0
   > 29/2 = 14, remainder is 1
   > 14/2 = 7, remainder is 0
   > 7/2 = 3, remainder is 1
   > 3/2 = 1, remainder is 1
   > 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 1110101000101
So, 7493 of decimal is 1110101000101 in binary
Adding 3 zeros on left hand side of this number to make this of length 16
So, 7493 in normal binary is 0001110101000101
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   0001110101000101 is flipped to 1110001010111010
Step 3:. Add 1 to above result
1110001010111010 + 1 = 1110001010111011
so, -7493 in 2's complement binary is 1110001010111011

Number: -6372
Let's convert this to two's complement binary
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Divide 6372 successively by 2 until the quotient is 0
   > 6372/2 = 3186, remainder is 0
   > 3186/2 = 1593, remainder is 0
   > 1593/2 = 796, remainder is 1
   > 796/2 = 398, remainder is 0
   > 398/2 = 199, remainder is 0
   > 199/2 = 99, remainder is 1
   > 99/2 = 49, remainder is 1
   > 49/2 = 24, remainder is 1
   > 24/2 = 12, remainder is 0
   > 12/2 = 6, remainder is 0
   > 6/2 = 3, remainder is 0
   > 3/2 = 1, remainder is 1
   > 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 1100011100100
So, 6372 of decimal is 1100011100100 in binary
Adding 3 zeros on left hand side of this number to make this of length 16
So, 6372 in normal binary is 0001100011100100
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   0001100011100100 is flipped to 1110011100011011
Step 3:. Add 1 to above result
1110011100011011 + 1 = 1110011100011100
so, -6372 in 2's complement binary is 1110011100011100

Adding 1110001010111011 and 1110011100011100 in binary
1110001010111011
1110011100011100
---------------------
(1)1100100111010111
---------------------
Sum produces a carry of 1. We can ignore that carry.
So, sum of these numbers in binary is 1100100111010111

Verification:
---------------
sum = 1100100111010111
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   1100100111010111 is flipped to 0011011000101000
II. Add 1 to above result
0011011000101000 + 1 = 0011011000101001
III. Now convert this result to decimal value
=> 11011000101001
=> 1x2^13+1x2^12+0x2^11+1x2^10+1x2^9+0x2^8+0x2^7+0x2^6+1x2^5+0x2^4+1x2^3+0x2^2+0x2^1+1x2^0
=> 1x8192+1x4096+0x2048+1x1024+1x512+0x256+0x128+0x64+1x32+0x16+1x8+0x4+0x2+1x1
=> 8192+4096+0+1024+512+0+0+0+32+0+8+0+0+1
=> 13865
Answer: -13865
This is correct since we can verify that -7493+-6372 = -13865
So, there was no overflow.


Related Solutions

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
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
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
Please show complete work and all calculations Using the following information for a population of data...
Please show complete work and all calculations Using the following information for a population of data points X : n=30 =5   2 =4 ( population variance) A) What is the distribution of the population of sample means? B) Find the probability that the sample mean is less than 4 ?
Please show all calculations and formulas. If using Escel, please show data/formulas. practice 10: Show the...
Please show all calculations and formulas. If using Escel, please show data/formulas. practice 10: Show the effects of these transactions on the balance sheet equity accounts. Presently the stock price is $20 per share. You started with: common stock ($1 par value) $10,000, capital surplus $100,000, retained earnings $200,000: a. 12% stock dividend b. repurchased 1,000 shares (repurchase price is PV of 20)
Please show all the steps and calculations List and discuss 3 differences and 3 similarities between...
Please show all the steps and calculations List and discuss 3 differences and 3 similarities between how the Fed and ECB are structured and operate.
Urgent Please Explain and show the difference between IEEE 16, 32, 64, 128-bit floating-point numbers.
Urgent Please Explain and show the difference between IEEE 16, 32, 64, 128-bit floating-point numbers.
Please show any and all calculations. Thank you. “I know headquarters wants us to add that...
Please show any and all calculations. Thank you. “I know headquarters wants us to add that new product line,” said Dell Havasi, manager of Billings Company’s Office Products Division. “But I want to see the numbers before I make any move. Our division’s return on investment (ROI) has led the company for three years, and I don’t want any letdown.” Billings Company is a decentralized wholesaler with five autonomous divisions. The divisions are evaluated on the basis of ROI, with...
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)
Conduct an appropriate hypothesis test using the provided information [Neatly show all steps / necessary calculations,...
Conduct an appropriate hypothesis test using the provided information [Neatly show all steps / necessary calculations, including both a complete comparison & interpretation statement AND plain English inference statement]. The National Center for Health Statistics reports that the mean total cholesterol level for all adults in the US last year was 203 with a population standard deviation of 36. In a sample of participants (n=3539) undergoing a dietary intervention clinical trial, the mean total cholesterol was 198. Using alpha =...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT