n binary system each and every number and its sign are represented by using only thesetwo digits 0 and 1. As the negative and positive signs cannot be written directly in binarysystem. The alternative method to represent negative and positive numbers is the 2’scomplement method. It has an interesting property that the binary arithmetic operationcan be performed easily on signed or unsigned numbers. Compute the following binaryarithmetic operations using 2’s complement method. Show all the steps clearly. (LO 01)(2*5 = 10 Marks)a) Sum of -30 and 17b) Sum of -42 and -15c) Sum of -13 and -16d) Multiplication of -8 by 6e) Multiplication of -11 by -9
Question
n binary system each and every number and its sign are represented by using only thesetwo digits 0 and 1. As the negative and positive signs cannot be written directly in binarysystem. The alternative method to represent negative and positive numbers is the 2’scomplement method. It has an interesting property that the binary arithmetic operationcan be performed easily on signed or unsigned numbers. Compute the following binaryarithmetic operations using 2’s complement method. Show all the steps clearly. (LO 01)(2*5 = 10 Marks)a) Sum of -30 and 17b) Sum of -42 and -15c) Sum of -13 and -16d) Multiplication of -8 by 6e) Multiplication of -11 by -9
Solution
a) Sum of -30 and 17
-
Convert 30 and 17 to binary: 30 in binary: 00011110 17 in binary: 00010001
-
Find the 2's complement of 30 to represent -30:
- Invert the digits: 11100001
- Add 1: 11100001 + 1 = 11100010
-
Add the binary numbers: 11100010 (2's complement of -30)
- 00010001 (binary of 17)
11110011
-
Since the result is in 2's complement form, it represents a negative number. Convert it back to decimal:
- Invert the digits: 00001100
- Add 1: 00001100 + 1 = 00001101
- Convert to decimal: 13
Therefore, the result is -13.
b) Sum of -42 and -15
-
Convert 42 and 15 to binary: 42 in binary: 00101010 15 in binary: 00001111
-
Find the 2's complement of 42 and 15 to represent -42 and -15:
- Invert the digits of 42: 11010101
- Add 1: 11010101 + 1 = 11010110
- Invert the digits of 15: 11110000
- Add 1: 11110000 + 1 = 11110001
-
Add the binary numbers: 11010110 (2's complement of -42)
- 11110001 (2's complement of -15)
11000111 (discard the carry)
-
Since the result is in 2's complement form, it represents a negative number. Convert it back to decimal:
- Invert the digits: 00111000
- Add 1: 00111000 + 1 = 00111001
- Convert to decimal: 57
Therefore, the result is -57.
c) Sum of -13 and -16
-
Convert 13 and 16 to binary: 13 in binary: 00001101 16 in binary: 00010000
-
Find the 2's complement of 13 and 16 to represent -13 and -16:
- Invert the digits of 13: 11110010
- Add 1: 11110010 + 1 = 11110011
- Invert the digits of 16: 11101111
- Add 1: 11101111 + 1 = 11110000
-
Add the binary numbers: 11110011 (2's complement of -13)
- 11110000 (2's complement of -16)
11100011 (discard the carry)
-
Since the result is in 2's complement form, it represents a negative number. Convert it back to decimal:
- Invert the digits: 00011100
- Add 1: 00011100 + 1 = 00011101
- Convert to decimal: 29
Therefore, the result is -29.
d) Multiplication of -8 by 6
-
Convert 8 and 6 to binary: 8 in binary: 00001000 6 in binary: 00000110
-
Find the 2's complement of 8 to represent -8:
- Invert the digits: 11110111
- Add 1: 11110111 + 1 = 11111000
-
Multiply the binary numbers: 11111000 (2's complement of -8) x 00000110 (binary of 6)
11111000 11111000
111000000 (discard the carry)
-
Since the result is in 2's complement form, it represents a negative number. Convert it back to decimal:
- Invert the digits: 000111111
- Add 1: 000111111 + 1 = 00100000
- Convert to decimal: 32
Therefore, the result is -48.
e) Multiplication of -11 by -9
-
Convert 11 and 9 to binary: 11 in binary: 00001011 9 in binary: 00001001
-
Find the 2's complement of 11 and 9 to represent -11 and -9:
- Invert the digits of 11: 11110100
- Add 1: 11110100 + 1 = 11110101
- Invert the digits of 9: 11110110
- Add 1: 11110110 + 1 = 11110111
-
Multiply the binary numbers: 11110101 (2's complement of -11) x 11110111 (2's complement of -9)
11110101 11110101 11110101 11110101 11110101 11110101 11110101 11110101
100000011011 (discard the carry)
-
Since the result is in 2's complement form, it represents a positive number. Convert it back to decimal:
- Convert to decimal: 99
Therefore, the result is 99.
Similar Questions
Compute the following binaryarithmetic operations using 2’s complement method. Show all the steps clearly. (LO 01)(2*5 = 10 Marks)a) Sum of -30 and 17b) Sum of -42 and -15c) Sum of -13 and -16d) Multiplication of -8 by 6e) Multiplication of -11 by -9
Perform the arithmetic operations ( +42) + ( - 13) in binary using signed-2's complement representation for negative numbers*111110100111000011000001110
erform six bit signed two’s complement arithmetic operation on (−15)10 +(+65)10
Why do we use two's complement to represent negative numbers in binary? Choose all that apply. Group of answer choices So that there is only one representation of 0 So that we can perform addition without worrying about the sign of the numbers So that we can use the most significant bit as a sign bit
Perform the subtraction with the following unsigned binary numbers by taking the 2's complement of the subtrahend. 1010100 - 101010*10000000100000111111111110000
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.