Practice question · Put in order
Order the steps to convert the decimal number 13 to binary.
- Divide 3 by 2: quotient 1, remainder 1
- Divide 6 by 2: quotient 3, remainder 0
- Divide 1 by 2: quotient 0, remainder 1 → read remainders bottom-up: 1101
- Divide 13 by 2: quotient 6, remainder 1
Hints
- Divide repeatedly by two and keep every remainder.
- The remainders come out in reverse order to how they are read.
Show the answer
- Divide 13 by 2: quotient 6, remainder 1
- Divide 6 by 2: quotient 3, remainder 0
- Divide 3 by 2: quotient 1, remainder 1
- Divide 1 by 2: quotient 0, remainder 1 → read remainders bottom-up: 1101
Why
Repeated division by 2, reading remainders bottom-up, gives 13₁₀ = 1101₂.
Practise Data representation and basic types
The app has 8 more questions on this lesson, and keeps your place in the course. Physics I is free to start.
More questions on Data representation and basic types
- In Python, 0.1 + 0.2 == 0.3 is False. What is the root cause?
- A sensor stores readings as 8-bit unsigned integers. How many distinct values can one reading take? Set the…
- In Python, the string '42' and the integer 42 are the same type.
- In floating point, 0.1 + 0.2 == 0.3 is false. What does that reveal about how numbers are stored?