Assume that 151 and 214 are signed 8-bit decimal integers stored
in two’s complement format. Calculate 151 + 214 by adding the two’s
complement numbers first and then writing the final result in
decimal. Then explain why the final result is very different from
366 (151+214=366). Note that if a number requires more than 8 bits,
you need to represent first the number correctly using as many bits
as necessary, then keep only the 8 bits, and use the resulting
number in the arithmetic operation.
Then,
Calculate 151- 214 by performing binary addition.
Please show all work! Thank you for the help
1)
Number: 151
Let's convert this to two's complement binary
Since this is a positive number. we can directly convert this into binary
Divide 151 successively by 2 until the quotient is 0
> 151/2 = 75, remainder is 1
> 75/2 = 37, remainder is 1
> 37/2 = 18, remainder is 1
> 18/2 = 9, remainder is 0
> 9/2 = 4, remainder is 1
> 4/2 = 2, remainder is 0
> 2/2 = 1, remainder is 0
> 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 10010111
So, 151 of decimal is 10010111 in binary
so, 151 in 2's complement binary is 10010111
Number: 214
Let's convert this to two's complement binary
Since this is a positive number. we can directly convert this into binary
Divide 214 successively by 2 until the quotient is 0
> 214/2 = 107, remainder is 0
> 107/2 = 53, remainder is 1
> 53/2 = 26, remainder is 1
> 26/2 = 13, remainder is 0
> 13/2 = 6, remainder is 1
> 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 11010110
So, 214 of decimal is 11010110 in binary
so, 214 in 2's complement binary is 11010110
Adding 10010111 and 11010110 in binary
10010111
11010110
-------------
(1)01101101
-------------
Sum produces a carry of 1. We can ignore that carry.
So, sum of these numbers in binary is 01101101
Verification:
---------------
sum = 01101101
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
=> 1101101
=> 1x2^6+1x2^5+0x2^4+1x2^3+1x2^2+0x2^1+1x2^0
=> 1x64+1x32+0x16+1x8+1x4+0x2+1x1
=> 64+32+0+8+4+0+1
=> 109
Answer: 109
151+214 must be 365
This is not correct since we can verify that 151+214 not equals 109
So, there was an overflow.
1)
Number: 151
Let's convert this to two's complement binary
Since this is a positive number. we can directly convert this into binary
Divide 151 successively by 2 until the quotient is 0
> 151/2 = 75, remainder is 1
> 75/2 = 37, remainder is 1
> 37/2 = 18, remainder is 1
> 18/2 = 9, remainder is 0
> 9/2 = 4, remainder is 1
> 4/2 = 2, remainder is 0
> 2/2 = 1, remainder is 0
> 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 10010111
So, 151 of decimal is 10010111 in binary
so, 151 in 2's complement binary is 10010111
Number: -214
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 214 successively by 2 until the quotient is 0
> 214/2 = 107, remainder is 0
> 107/2 = 53, remainder is 1
> 53/2 = 26, remainder is 1
> 26/2 = 13, remainder is 0
> 13/2 = 6, remainder is 1
> 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 11010110
So, 214 of decimal is 11010110 in binary
So, 214 in normal binary is 11010110
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
11010110 is flipped to 00101001
Step 3:. Add 1 to above result
00101001 + 1 = 00101010
so, -214 in 2's complement binary is 00101010
Adding 10010111 and 00101010 in binary
10010111
00101010
-------------
(0)11000001
-------------
Sum does not produces a carry
So, sum of these numbers in binary is 11000001
Verification:
---------------
sum = 11000001
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.
11000001 is flipped to 00111110
II. Add 1 to above result
00111110 + 1 = 00111111
III. Now convert this result to decimal value
=> 111111
=> 1x2^5+1x2^4+1x2^3+1x2^2+1x2^1+1x2^0
=> 1x32+1x16+1x8+1x4+1x2+1x1
=> 32+16+8+4+2+1
=> 63
Answer: -63
This is correct since we can verify that 151+-214 = -63
So, there was no overflow.
Assume that 151 and 214 are signed 8-bit decimal integers stored in two’s complement format. Calculate...
Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude format. Calculate 185–122. Is there overflow, underflow, or neither? The result is -193 but I want to know the steps to solving it. Please show your work. Thanks.
3) Convert following decimal to 8-bit signed numbers in hexadecimal, use two’s-complement for signed integer 127d, -20d, -128d, -1d 4) Convert the 16-bit signed numbers to the decimal C0A3h, 3AECh, 0101 1001 0111b, 1011 0101 1001 0111b please solve the problems step by step. It would be of great help.
Compute 410 – 510 using 4-bit two’s complement addition. You will need to first convert each number into its 4-bit two’s complement code and then perform binary addition (i.e., 410 + (−510)). Provide the 4-bit result and indicate whether two’s complement overflow occurred. Check your work by converting the 4-bit result back to decimal.
2. Convert the following two's complement binary numbers to decimal numbers. These numbers are integers. a. 110101 b. 01101010 c. 10110101 3. Convert the following decimal numbers to 6-bit two's complement binary numbers and add them. Write the results in 6-bit two's complement binary number format and decimal number format. Indicate whether or not the sum overflows a 6-bit result. a. 14 + 12 b. 30 + 2 C. -7 + 20 d. -18-17 4. What is the signed/magnitude and two's complement range of...
(20 pts) Perform the following operation: • (4−12)10, Using signed binary, 8–bit 2’s complement arithmetic.
Perform the following binary multiplications using 7-bit signed numbers in two's complement format. Convert them to decimal, and verify the correct result of the operation.
Four 8-bit 2's complement (signed) integers A, B, C, and D are packed into the 32-bit word stored in the memory of an ARM processor at address 0x36F0: Extract the 8-bit integer A into the 32-bit register Ra, the 8-bit register B into the 32-bit register Rb,the 8-bit register C into the 32-bit register Rc, and the 8-bit register D into the 32-bit register Rd. Hint: in ARM an address refers to a byte, not a word
3.8) Convert the hexadecimal number 0x15 to a decimal number. 3.9) Convert the hexadecimal number 0x19 to a decimal number. 3.10) Convert the decimal number -35 to an 8-bit two’s complement binary number. 3.11) Convert the decimal number -32 to an 8-bit two’s complement binary number. 3.12) Assuming the use of the two’s complement number system find the equivalent decimal values for the following 8-bit binary numbers: a)10000001 b)11111111 c)01010000 d)11100000 e)10000011 3.13) Convert the base 8 number 204 to...
What decimal value does the 8-bit binary number 10110111 have if: a) it is interpreted as an unsigned number? b) it is on a computer using signed-magnitude representation? c) it is on a computer using one’s complement representation? d) it is on a computer using two’s complement representation? e) it is on a computer using excess-127 representation?
4. What decimal value does the 8-bit binary number 10011110 have if: a) It is interpreted as an unsigned number? b) It is on a computer using signed-magnitude representation? c) It is on a computer using ones complement representation? d) It is on a computer using twos complement representation? 5. Given the following two binary numbers: 11111100 and 01110000. a) Which of these two numbers is the larger unsigned binary number? b) Which of these two is the larger when it is being...