In: Computer Science
Convert the following decimal number to eight (8) binary bits: 21, 200, 105, 144, 183, 199, 88, 100, 19, 204
1)
Divide 21 successively by 2 until the quotient is 0
> 21/2 = 10, remainder is 1
> 10/2 = 5, remainder is 0
> 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 10101
So, 21 of decimal is 10101 in binary
Answer: 00010101
2)
Divide 200 successively by 2 until the quotient is 0
> 200/2 = 100, remainder is 0
> 100/2 = 50, remainder is 0
> 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 11001000
So, 200 of decimal is 11001000 in binary
Answer: 11001000
3)
Divide 105 successively by 2 until the quotient is 0
> 105/2 = 52, remainder is 1
> 52/2 = 26, remainder is 0
> 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 1101001
So, 105 of decimal is 1101001 in binary
Answer: 01101001
4)
Divide 144 successively by 2 until the quotient is 0
> 144/2 = 72, remainder is 0
> 72/2 = 36, remainder is 0
> 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 10010000
So, 144 of decimal is 10010000 in binary
Answer: 10010000
5)
Divide 183 successively by 2 until the quotient is 0
> 183/2 = 91, remainder is 1
> 91/2 = 45, remainder is 1
> 45/2 = 22, remainder is 1
> 22/2 = 11, remainder is 0
> 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 10110111
So, 183 of decimal is 10110111 in binary
Answer: 10110111
6)
Divide 199 successively by 2 until the quotient is 0
> 199/2 = 99, remainder is 1
> 99/2 = 49, remainder is 1
> 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 11000111
So, 199 of decimal is 11000111 in binary
Answer: 11000111
7)
Divide 88 successively by 2 until the quotient is 0
> 88/2 = 44, remainder is 0
> 44/2 = 22, remainder is 0
> 22/2 = 11, remainder is 0
> 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 1011000
So, 88 of decimal is 1011000 in binary
Answer: 01011000
8)
Divide 100 successively by 2 until the quotient is 0
> 100/2 = 50, remainder is 0
> 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 1100100
So, 100 of decimal is 1100100 in binary
Answer: 01100100
9)
Divide 19 successively by 2 until the quotient is 0
> 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 10011
So, 19 of decimal is 10011 in binary
Answer: 00010011
10)
Divide 204 successively by 2 until the quotient is 0
> 204/2 = 102, remainder is 0
> 102/2 = 51, remainder is 0
> 51/2 = 25, remainder is 1
> 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 11001100
So, 204 of decimal is 11001100 in binary
Answer: 11001100