Binary Conversion Drill

exercises
computer-systems
binary

Convert between different number representations. All binary numbers are eight bits.

On the HTML site, fill in the blank with your answer (as a quoted string, e.g. "1A"), then click Run Code on the exercise to check. Reload the page for a new random question. In the PDF, the reference implementation is shown instead (interactive exercises need a browser).

Number base conversion

A random question is generated once per page load using an ojs cell, then passed into the Python exercise cells below via the input cell option – this keeps the question stable across repeated “Run Code” clicks (setup blocks re-run on every evaluation, so randomising there would change the question out from under the learner).

Signed number format conversion