Question

In: Computer Science

Convert the following decimal numbers to 16-bit 2’s complement binary. Display your result in hexadecimal. a.3030...

Convert the following decimal numbers to 16-bit 2’s complement binary. Display your result in hexadecimal.

a.3030

b.404

c.5050

d.-5050

e.-20000

Show work with steps

Solutions

Expert Solution

a)
Since this is a positive number. we can directly convert this into binary
Divide 3030 successively by 2 until the quotient is 0
3030/2 = 1515, remainder is 0
1515/2 = 757, remainder is 1
757/2 = 378, remainder is 1
378/2 = 189, remainder is 0
189/2 = 94, remainder is 1
94/2 = 47, remainder is 0
47/2 = 23, remainder is 1
23/2 = 11, remainder is 1
11/2 = 5, remainder is 1
5/2 = 2, remainder is 1
2/2 = 1, remainder is 0
1/2 = 0, remainder is 1
Read remainders from the bottom to top as 101111010110
Adding 4 zeros on left hand side of this number to make this of length 16
so, 3030 in 2's complement binary is 0000101111010110

Converting 0000101111010110 to hexadecimal
0000 => 0
1011 => B
1101 => D
0110 => 6
So, in hexadecimal 0000101111010110 is 0x0BD6

b)
Since this is a positive number. we can directly convert this into binary
Divide 404 successively by 2 until the quotient is 0
404/2 = 202, remainder is 0
202/2 = 101, remainder is 0
101/2 = 50, remainder is 1
50/2 = 25, remainder is 0
25/2 = 12, remainder is 1
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 110010100
Adding 7 zeros on left hand side of this number to make this of length 16
so, 404 in 2's complement binary is 0000000110010100

Converting 0000000110010100 to hexadecimal
0000 => 0
0001 => 1
1001 => 9
0100 => 4
So, in hexadecimal 0000000110010100 is 0x0194

c)
Since this is a positive number. we can directly convert this into binary
Divide 5050 successively by 2 until the quotient is 0
5050/2 = 2525, remainder is 0
2525/2 = 1262, remainder is 1
1262/2 = 631, remainder is 0
631/2 = 315, remainder is 1
315/2 = 157, remainder is 1
157/2 = 78, remainder is 1
78/2 = 39, remainder is 0
39/2 = 19, remainder is 1
19/2 = 9, remainder is 1
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 1001110111010
Adding 3 zeros on left hand side of this number to make this of length 16
so, 5050 in 2's complement binary is 0001001110111010

Converting 0001001110111010 to hexadecimal
0001 => 1
0011 => 3
1011 => B
1010 => A
So, in hexadecimal 0001001110111010 is 0x13BA

d)
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Divide 5050 successively by 2 until the quotient is 0
5050/2 = 2525, remainder is 0
2525/2 = 1262, remainder is 1
1262/2 = 631, remainder is 0
631/2 = 315, remainder is 1
315/2 = 157, remainder is 1
157/2 = 78, remainder is 1
78/2 = 39, remainder is 0
39/2 = 19, remainder is 1
19/2 = 9, remainder is 1
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 1001110111010
Adding 3 zeros on left hand side of this number to make this of length 16
So, 5050 in normal binary is 0001001110111010
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   0001001110111010 is flipped to 1110110001000101
Step 3:. Add 1 to above result
1110110001000101 + 1 = 1110110001000110
so, -5050 in 2's complement binary is 1110110001000110

Converting 1110110001000110 to hexadecimal
1110 => E
1100 => C
0100 => 4
0110 => 6
So, in hexadecimal 1110110001000110 is 0xEC46

e)
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Divide 20000 successively by 2 until the quotient is 0
20000/2 = 10000, remainder is 0
10000/2 = 5000, remainder is 0
5000/2 = 2500, remainder is 0
2500/2 = 1250, remainder is 0
1250/2 = 625, remainder is 0
625/2 = 312, remainder is 1
312/2 = 156, remainder is 0
156/2 = 78, remainder is 0
78/2 = 39, remainder is 0
39/2 = 19, remainder is 1
19/2 = 9, remainder is 1
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 100111000100000
Adding 1 zeros on left hand side of this number to make this of length 16
So, 20000 in normal binary is 0100111000100000
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   0100111000100000 is flipped to 1011000111011111
Step 3:. Add 1 to above result
1011000111011111 + 1 = 1011000111100000
so, -20000 in 2's complement binary is 1011000111100000

Converting 1011000111100000 to hexadecimal
1011 => B
0001 => 1
1110 => E
0000 => 0
So, in hexadecimal 1011000111100000 is 0xB1E0

Related Solutions

Convert the following hexadecimal representations of 16-bit 2’s complement binary numbers to decimal. a.FCAD b.DEAD c.1111...
Convert the following hexadecimal representations of 16-bit 2’s complement binary numbers to decimal. a.FCAD b.DEAD c.1111 d.8000 e.FACE
(a) Convert the decimal numbers, 70 and -26 to binary in the signed 2’s complement system....
(a) Convert the decimal numbers, 70 and -26 to binary in the signed 2’s complement system. Make sure there are enough digits in the results to be able to perform arithmetic operations with these two numbers. (b) Perform in the signed 2’s complement system, (+70) + (-26) (c) Perform in the signed 2’s complement system, (-70) - (-26) (d) Perform in the signed 2’s complement system, (+70) + (+26)
1. Please convert the following decimal numbers to 8-bit binary sign magnitude and to 8-bit 2’s...
1. Please convert the following decimal numbers to 8-bit binary sign magnitude and to 8-bit 2’s complement. Please show your work if there are multiple steps. Sign Magnitude 2’s complement a. +67 b. +40 c. -28 d. -40
1.convert the following numbers from decimal to binary assuming seven-bit twe's complement binary representation: a)49 b)...
1.convert the following numbers from decimal to binary assuming seven-bit twe's complement binary representation: a)49 b) -27 c)0 d) -64 e) -1 f) -2 g) what is the range for this computer as written in binary and in decimal? 2.convert the following numbers from decimal to binary assuming nine-bit twe's complement binary representation: a)51 b) -29 c) -2 d)0 e) -256 f) -1 g ) what is the range for this computer as written in binary and in decimal?
1) Convert negative fractional decimal number to 8-bit binary number: – 16.625 (use 2's complement binary...
1) Convert negative fractional decimal number to 8-bit binary number: – 16.625 (use 2's complement binary format) Hint: –17 + 0.375 Given the hint above, the fractional number will be divided into two parts, - Whole number, - Fractional part, must be positive (2) Proof to check that your calculation above is correct
represent 8912 in 16-bit binary format and then convert it to Hexadecimal form.
represent 8912 in 16-bit binary format and then convert it to Hexadecimal form.
represent -100 in 16-bit binary format and then convert it to Hexadecimal form.
represent -100 in 16-bit binary format and then convert it to Hexadecimal form.
represent -100 in 16-bit binary format and then convert it to Hexadecimal form.
represent -100 in 16-bit binary format and then convert it to Hexadecimal form.
represent -100 in 16-bit binary format and then convert it to Hexadecimal form.
represent -100 in 16-bit binary format and then convert it to Hexadecimal form.
(16%) Convert decimal +47 and +38 to binary, using the signed-2’s-complement representation and enough digits to...
(16%) Convert decimal +47 and +38 to binary, using the signed-2’s-complement representation and enough digits to accommodate the numbers, Then, perform the binary equivalent of (+47)+(-38) and (-47)+(-38) using addition. Convert the answers back to decimal and verify that they are correct.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT