Binary to decimal and back
Without a calculator:
- What is the binary number
101101in decimal? - What is the decimal number 200 in binary?
Show hint
From the right, binary place values are 1, 2, 4, 8, 16, 32, 64, 128. For the second part, take the biggest place value that fits, subtract it, and repeat.
Show solution
- 45. The 1s sit in the 32, 8, 4 and 1 places: 32 + 8 + 4 + 1 = 45.
- 11001000. 200 = 128 + 64 + 8, so the 128, 64 and 8 places are 1 and the rest are 0.
Check in Python with int("101101", 2) and bin(200).
Want a problem like this every day? See today's problem and keep a streak going.