Find the word length 2\'s complement representation of each of the following dec
ID: 3784997 • Letter: F
Question
Find the word length 2's complement representation of each of the following decimal numbers 845 15000 100 -923 For each problem, perform the addition or subtraction operation, giving the sum or difference in hex using the same number of hex digits as the original two operands. For each operation, state whether or not overflow occurs. For each sum, state whether or not there is a carry: for each difference state whether or not there is a borrow. For each problem, interpret the operations as 2's complement signed and convert the problem to the equivalent decimal problem; verify that the signed interpretation is correct when there is no overflow For each problem, interpret the operands as unsigned and convert problem to the equivalent decimal problem; verify that the unsigned interpretation is correct when there is no carry (borrow for subtraction). 1848 + 29E1 Sum:______ overflow (yes, no): _______ Carry (yes, no): ________ signed check: ________ Unsigned check: ___________ FFF1 + 8005 Sum:______ overflow (yes, no): _______ Carry (yes, no): ________ signed check: ________ Unsigned check: ___________ 9E58 + EBBC Difference: _______ Overflow(yes, no):_______ Borrow (yes, no): _________ signed check: __________ Unsigned check: __________ EBBC - 9E58 Difference: _______ Overflow(yes, no):_______ Borrow (yes, no): _________ signed check: __________ Unsigned check: __________Explanation / Answer
Positive numbers represented normally
Example: Using a 4 bit representation 5 in 2's complement
0101
Example: Using an 8 bit representation 5 in 2's complement
0000 0101
Example: Using an 8 bit representation 24 base 16
0010 0100
845:
Binary 845 = 11010011012
The binary for 845 is 1101001101
1’s complement is 0010110010
Add 1
2’s complement:0010110011
Negative numbers
Are represented using a 2's complement form. To obtain the 2's complement of a number:
Examples: (4 bits)
Represent -6 in 2's complement
+6 0110
complement 1001
add 1 0001
-6 = 1010
-923:
Binary 923 = 11100110112
The binary for 923 is 1110011011
Complement 0001100100
Add1 0000000001
-923= 0001100101
Addition and subtraction in 2's complement notation
Is performed by doing the simple binary addition of the two numbers. Subtraction is accomplished by first performing the 2's complement operation on the number being subtracted then adding the two numbers.
Examples: 5 bits
8 01000
+4 00100
-- -----
12 01100
-8 11000
+ -4 11100
-- -----
-12 10100
8 01000
+ -4 11100
-- -----
4 00100
Example: 8 bits
25 0001 1001 19
+ -29 1110 0011 E3
--- ---------
-4 1111 1100 FC
Overflow
Since we are working with numbers contained in a fixed number of bits, we must be able to detect overflow following an operation.
Examples: 4 bits
6 0110
+ 1 0001
----- ------
7 0111
7 0111
+ 1 0001
----- ------
8 1000
but, in the second case is 8 the correct answer?
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.