Compute the following decimal arithmetic operation using 8-bit 2's complement: i) t5- 7; ii) -10+6 ; iii) -23-7.
Question
Compute the following decimal arithmetic operation using 8-bit 2's complement:
- t5 - 7;
- -10 + 6 ;
- -23 - 7.
Solution
Sure, let's solve these problems one by one:
i) t5 - 7: Assuming 't5' is a typo and you meant '15', let's proceed:
First, we need to represent 15 and 7 in 8-bit 2's complement form:
15 in binary is 00001111 7 in binary is 00000111
Subtraction in binary is done by adding the 2's complement of the second number. So, we need to find the 2's complement of 7:
1's complement of 7 (00000111) is 11111000 Adding 1 to the 1's complement gives the 2's complement: 11111001
Now, we add 15 (00001111) and the 2's complement of 7 (11111001):
00001111
- 11111001
100001100
Since we're working with 8 bits, we discard the carry, and the result is 00001100, which is 8 in decimal. So, 15 - 7 = 8.
ii) -10 + 6:
First, represent -10 and 6 in 8-bit 2's complement form:
-10 in 2's complement is 11110110 6 in binary is 00000110
Adding these together:
11110110
- 00000110
11111100
This is a negative number (since the leftmost bit is 1). To find its value, we take the 2's complement:
1's complement of 11111100 is 00000011 Adding 1 gives the 2's complement: 00000100, which is 4 in decimal. So, -10 + 6 = -4.
iii) -23 - 7:
This is the same as -23 + (-7). So, represent -23 and -7 in 8-bit 2's complement form:
-23 in 2's complement is 11101001 -7 in 2's complement is 11111001
Adding these together:
11101001
- 11111001
111100010
Discarding the carry, the result is 11100010. This is a negative number, so take the 2's complement to find its value:
1's complement of 11100010 is 00011101 Adding 1 gives the 2's complement: 00011110, which is 30 in decimal. So, -23 - 7 = -30.
Similar Questions
Compute the following decimal arithmetic operation using 8-bit l's complement: \,z i) -16+78; ii) -e0-8; iii) 13-26
erform six bit signed two’s complement arithmetic operation on (−15)10 +(+65)10
Convert the following decimal values to 8-bit 2's complement representation(1*2 Marks)i. -92ii. -36
Convert the following decimal values to a 16-bit 2's complement representation. (1*2Marks)i. -2342ii. 234
Obtain the 9's complement of the following eight-digit decimal number: 12349876
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.