Question

In: Computer Science

Convert the following numbers to 32-bit, 2s compliment binary and hexadecimal formats. Show your work in...

  1. Convert the following numbers to 32-bit, 2s compliment binary and hexadecimal formats. Show your work in recursive division form.
    1. 899726616
    2. 1656906428
    3. -77102817
    4. -251026154

Solutions

Expert Solution

a) 899726616
first convert 899726616 to binary
899726616
Since this is a positive number. we can directly convert this into binary
Divide 899726616 successively by 2 until the quotient is 0
   > 899726616/2 = 449863308, remainder is 0
   > 449863308/2 = 224931654, remainder is 0
   > 224931654/2 = 112465827, remainder is 0
   > 112465827/2 = 56232913, remainder is 1
   > 56232913/2 = 28116456, remainder is 1
   > 28116456/2 = 14058228, remainder is 0
   > 14058228/2 = 7029114, remainder is 0
   > 7029114/2 = 3514557, remainder is 0
   > 3514557/2 = 1757278, remainder is 1
   > 1757278/2 = 878639, remainder is 0
   > 878639/2 = 439319, remainder is 1
   > 439319/2 = 219659, remainder is 1
   > 219659/2 = 109829, remainder is 1
   > 109829/2 = 54914, remainder is 1
   > 54914/2 = 27457, remainder is 0
   > 27457/2 = 13728, remainder is 1
   > 13728/2 = 6864, remainder is 0
   > 6864/2 = 3432, remainder is 0
   > 3432/2 = 1716, remainder is 0
   > 1716/2 = 858, remainder is 0
   > 858/2 = 429, remainder is 0
   > 429/2 = 214, remainder is 1
   > 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 110101101000001011110100011000
So, 899726616 of decimal is 110101101000001011110100011000 in binary
so, 899726616 in 2's complement binary is 00110101101000001011110100011000

Now, let's convert this to hexadecimal
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Use this table to convert from binary to hexadecimal
Converting 00110101101000001011110100011000 to hexadecimal
0011 => 3
0101 => 5
1010 => A
0000 => 0
1011 => B
1101 => D
0001 => 1
1000 => 8
So, in hexadecimal 00110101101000001011110100011000 is 0x35A0BD18
Answer: 0x35A0BD18

b) 1656906428
first convert 1656906428 to binary
1656906428
Since this is a positive number. we can directly convert this into binary
Divide 1656906428 successively by 2 until the quotient is 0
   > 1656906428/2 = 828453214, remainder is 0
   > 828453214/2 = 414226607, remainder is 0
   > 414226607/2 = 207113303, remainder is 1
   > 207113303/2 = 103556651, remainder is 1
   > 103556651/2 = 51778325, remainder is 1
   > 51778325/2 = 25889162, remainder is 1
   > 25889162/2 = 12944581, remainder is 0
   > 12944581/2 = 6472290, remainder is 1
   > 6472290/2 = 3236145, remainder is 0
   > 3236145/2 = 1618072, remainder is 1
   > 1618072/2 = 809036, remainder is 0
   > 809036/2 = 404518, remainder is 0
   > 404518/2 = 202259, remainder is 0
   > 202259/2 = 101129, remainder is 1
   > 101129/2 = 50564, remainder is 1
   > 50564/2 = 25282, remainder is 0
   > 25282/2 = 12641, remainder is 0
   > 12641/2 = 6320, remainder is 1
   > 6320/2 = 3160, remainder is 0
   > 3160/2 = 1580, remainder is 0
   > 1580/2 = 790, remainder is 0
   > 790/2 = 395, remainder is 0
   > 395/2 = 197, remainder is 1
   > 197/2 = 98, remainder is 1
   > 98/2 = 49, remainder is 0
   > 49/2 = 24, remainder is 1
   > 24/2 = 12, remainder is 0
   > 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 1100010110000100110001010111100
So, 1656906428 of decimal is 1100010110000100110001010111100 in binary
so, 1656906428 in 2's complement binary is 01100010110000100110001010111100

Now, let's convert this to hexadecimal
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Use this table to convert from binary to hexadecimal
Converting 01100010110000100110001010111100 to hexadecimal
0110 => 6
0010 => 2
1100 => C
0010 => 2
0110 => 6
0010 => 2
1011 => B
1100 => C
So, in hexadecimal 01100010110000100110001010111100 is 0x62C262BC
Answer: 0x62C262BC

c) -77102817
first convert -77102817 to binary
-77102817
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Divide 77102817 successively by 2 until the quotient is 0
   > 77102817/2 = 38551408, remainder is 1
   > 38551408/2 = 19275704, remainder is 0
   > 19275704/2 = 9637852, remainder is 0
   > 9637852/2 = 4818926, remainder is 0
   > 4818926/2 = 2409463, remainder is 0
   > 2409463/2 = 1204731, remainder is 1
   > 1204731/2 = 602365, remainder is 1
   > 602365/2 = 301182, remainder is 1
   > 301182/2 = 150591, remainder is 0
   > 150591/2 = 75295, remainder is 1
   > 75295/2 = 37647, remainder is 1
   > 37647/2 = 18823, remainder is 1
   > 18823/2 = 9411, remainder is 1
   > 9411/2 = 4705, remainder is 1
   > 4705/2 = 2352, remainder is 1
   > 2352/2 = 1176, remainder is 0
   > 1176/2 = 588, remainder is 0
   > 588/2 = 294, remainder is 0
   > 294/2 = 147, remainder is 0
   > 147/2 = 73, remainder is 1
   > 73/2 = 36, remainder is 1
   > 36/2 = 18, remainder is 0
   > 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 100100110000111111011100001
So, 77102817 of decimal is 100100110000111111011100001 in binary
So, 77102817 in normal binary is 00000100100110000111111011100001
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   00000100100110000111111011100001 is flipped to 11111011011001111000000100011110
Step 3:. Add 1 to above result
11111011011001111000000100011110 + 1 = 11111011011001111000000100011111
so, -77102817 in 2's complement binary is 11111011011001111000000100011111

Now, let's convert this to hexadecimal
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Use this table to convert from binary to hexadecimal
Converting 11111011011001111000000100011111 to hexadecimal
1111 => F
1011 => B
0110 => 6
0111 => 7
1000 => 8
0001 => 1
0001 => 1
1111 => F
So, in hexadecimal 11111011011001111000000100011111 is 0xFB67811F
Answer: 0xFB67811F

d) -251026154
first convert -251026154 to binary
-251026154
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Divide 251026154 successively by 2 until the quotient is 0
   > 251026154/2 = 125513077, remainder is 0
   > 125513077/2 = 62756538, remainder is 1
   > 62756538/2 = 31378269, remainder is 0
   > 31378269/2 = 15689134, remainder is 1
   > 15689134/2 = 7844567, remainder is 0
   > 7844567/2 = 3922283, remainder is 1
   > 3922283/2 = 1961141, remainder is 1
   > 1961141/2 = 980570, remainder is 1
   > 980570/2 = 490285, remainder is 0
   > 490285/2 = 245142, remainder is 1
   > 245142/2 = 122571, remainder is 0
   > 122571/2 = 61285, remainder is 1
   > 61285/2 = 30642, remainder is 1
   > 30642/2 = 15321, remainder is 0
   > 15321/2 = 7660, remainder is 1
   > 7660/2 = 3830, remainder is 0
   > 3830/2 = 1915, remainder is 0
   > 1915/2 = 957, remainder is 1
   > 957/2 = 478, remainder is 1
   > 478/2 = 239, remainder is 0
   > 239/2 = 119, remainder is 1
   > 119/2 = 59, remainder is 1
   > 59/2 = 29, remainder is 1
   > 29/2 = 14, remainder is 1
   > 14/2 = 7, remainder is 0
   > 7/2 = 3, remainder is 1
   > 3/2 = 1, remainder is 1
   > 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 1110111101100101101011101010
So, 251026154 of decimal is 1110111101100101101011101010 in binary
So, 251026154 in normal binary is 00001110111101100101101011101010
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   00001110111101100101101011101010 is flipped to 11110001000010011010010100010101
Step 3:. Add 1 to above result
11110001000010011010010100010101 + 1 = 11110001000010011010010100010110
so, -251026154 in 2's complement binary is 11110001000010011010010100010110

Now, let's convert this to hexadecimal
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Use this table to convert from binary to hexadecimal
Converting 11110001000010011010010100010110 to hexadecimal
1111 => F
0001 => 1
0000 => 0
1001 => 9
1010 => A
0101 => 5
0001 => 1
0110 => 6
So, in hexadecimal 11110001000010011010010100010110 is 0xF109A516
Answer: 0xF109A516



Related Solutions

Convert the following numbers to 8-bit binary and 8-bit hexadecimal: a) 20 b) 78 c) -25...
Convert the following numbers to 8-bit binary and 8-bit hexadecimal: a) 20 b) 78 c) -25 d) -96 Convert the following hexadecimal numbers to binary and decimal assuming two's compliment format: a) 0x56 b) 0x14 c) 0xF8 d) 0xCC MUST DO ALL PROBLEMS AND SHOW ALL WORK!!!!
Convert 110.7510 to binary ______ and hexadecimal ______. Show the answer in both binary and hexadecimal....
Convert 110.7510 to binary ______ and hexadecimal ______. Show the answer in both binary and hexadecimal. There are ____________ kilobytes in a megabyte. Convert -13210 to a 16-bit 2’s complement in binary ____________ and hexadecimal ______________.
1a. Convert 67 (base 10) to 8-bit binary using signed magnitude. Show your work. 1b. Convert...
1a. Convert 67 (base 10) to 8-bit binary using signed magnitude. Show your work. 1b. Convert 69 (base 10) to 8-bit binary using one’s complement. Show your work 1c. Convert 70 (base 10) to 8-bit binary using two’s complement. Show your work. 1d. Convert - 67 (base 10) to 8-bit binary using signed magnitude. 1e. Convert - 67 (base 10) to 8-bit binary using ones compliment. Show your work. 1f. Convert - 67 (base 10) to 8-bit binary using 2s...
Design a Decoder Circuit that can convert a 4-bit Binary Number to a Hexadecimal Output.
Design a Decoder Circuit that can convert a 4-bit Binary Number to a Hexadecimal Output.
Translate these two LEGv8 assembly instructions to 32-bit binary machine code. Give your answer in hexadecimal....
Translate these two LEGv8 assembly instructions to 32-bit binary machine code. Give your answer in hexadecimal. CBZ X19, exit ADD X10, X19, X20 exit:
4 – The following 32-bit binary word written in hexadecimal format represents a single RISC-V assembly...
4 – The following 32-bit binary word written in hexadecimal format represents a single RISC-V assembly instruction. What is the RISC-V instruction format and specific assembly language instruction? 0x00156A33
The following 32-bit binary word written in hexadecimal format represents a single RISC-V assembly instruction. What...
The following 32-bit binary word written in hexadecimal format represents a single RISC-V assembly instruction. What is the RISC-V instruction format and specific assembly language instruction? 0xfe810113
Q1.Convert C46C000016 into a 32-bit single-precision IEEE floating-point binary number.
Q1.Convert C46C000016 into a 32-bit single-precision IEEE floating-point binary number.
11.  Convert this hexadecimal notation to binary notation: E4B Answer format: put a space between each four-bit...
11.  Convert this hexadecimal notation to binary notation: E4B Answer format: put a space between each four-bit pattern. (e.g., 1000 0000 0111) 12. Convert this decimal notation to an excess notation system using bit patterns of length three: -1 13. Convert this two's complement notation to its equivalent base ten representation: 10011 Note: Since the tables in the book on page only show 7 through -8 in a pattern of length four,          you will need to create a pattern of length...
What is (567.12) octal in binary. What is(5CF.AD) hexadecimal in binary. Please show work so I...
What is (567.12) octal in binary. What is(5CF.AD) hexadecimal in binary. Please show work so I can understand how to solve thanks.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT