You can convert any number from 0 to 31 inclusive into a 5-bit binary number. Here's the easy way to do it:

1. Can you subtract 16 from the number and get a positive result? If yes, the first bit is 1, and your new number is the result. If no, leave the number unchanged, and the first bit is 0.

2. From the result of Step 1, can you subtract 8 and get a positive result? If yes, the second bit is 1, and your new number is the result. If no, leave the number unchanged, and the second bit is 0.

Continue doing this, marching down the powers of 2, until you get to 1. That corresponds to the last bit. Then you stop.

Example: , where the subscript indicates the base.