These twelve original questions cover binary and denary, hexadecimal, binary addition with overflow, character codes, bit depth and one short trace. They run from easy to harder, and all binary numbers are 8 bits unless stated.
Write your working on paper first, then open the answer. Mark each question right or wrong, and use the section at the end to see which lesson to revisit.
You can check conversions in the Python reasoning sandbox and trace loops in the pseudocode trace trainer. This set belongs to Representing numbers and text.
Questions
1. (easy) Convert 00101101 to denary.
Show answer
Columns with a 1: 32, 8, 4, 1. Sum: 32 + 8 + 4 + 1 = 45.
2. (easy) Convert 150 to 8-bit binary.
Show answer
128 fits (22 left). 64 no. 32 no. 16 fits (6 left). 8 no. 4 fits (2 left). 2 fits (0 left). 1 no. Bits: 1 0 0 1 0 1 1 0, so 10010110. Check: 128 + 16 + 4 + 2 = 150.
3. (easy) What is the largest denary number that can be stored in 6 bits?
Show answer
6 bits give 26 = 64 patterns, starting at 0, so the largest is 64 − 1 = 63. Check: 111111 = 32 + 16 + 8 + 4 + 2 + 1 = 63.
4. (easy to medium) Convert 10101110 to hexadecimal, then to denary.
Show answer
Groups: 1010 and 1110. 1010 = 10 = A and 1110 = 14 = E. Hex: AE. Denary: 10 × 16 + 14 = 160 + 14 = 174. Check in binary: 128 + 32 + 8 + 4 + 2 = 174.
5. (medium) Convert hex 5D to binary and denary.
Show answer
5 = 0101 and D = 13 = 1101, so the binary is 01011101. Denary: 5 × 16 + 13 = 80 + 13 = 93. Check: 64 + 16 + 8 + 4 + 1 = 93.
6. (medium) Add 00110011 and 01011101. Give the 8-bit result and check it in denary.
Show answer
Denary check first: 00110011 = 32 + 16 + 2 + 1 = 51, and 01011101 = 64 + 16 + 8 + 4 + 1 = 93. Expected: 144.
Column by column from the right: col 0: 1 + 1 = 0 carry 1. Col 1: 1 + 0 + 1 = 0 carry 1. Col 2: 0 + 1 + 1 = 0 carry 1. Col 3: 0 + 1 + 1 = 0 carry 1. Col 4: 1 + 1 + 1 = 1 carry 1. Col 5: 1 + 0 + 1 = 0 carry 1. Col 6: 0 + 1 + 1 = 0 carry 1. Col 7: 0 + 0 + 1 = 1.
Result: 10010000 = 128 + 16 = 144. It matches, and there is no carry out, so no overflow.
7. (medium) Add 11110000 and 00010000. State what happens.
Show answer
240 + 16 = 256. Columns 0 to 3 are 0 + 0 = 0. Col 4: 1 + 1 = 0 carry 1. Cols 5, 6 and 7: 1 + 0 + 1 = 0 carry 1 each time, and col 7 carries 1 out.
The 8-bit result is 00000000 with a carry out. The result overflows: 256 is too large for 8 bits (maximum 255), so the stored value 0 is wrong.
8. (medium) In ASCII, A has code 65. Decode the codes 72 69 76 80.
Show answer
72 − 65 = 7, so H. 69 − 65 = 4, so E. 76 − 65 = 11, so L. 80 − 65 = 15, so P. Counting from A as place 0: H is the 8th letter (place 7), E the 5th (place 4), L the 12th (place 11), P the 16th (place 15). The word is HELP.
9. (medium) Explain why a messaging app that supports Chinese characters cannot use 7-bit ASCII only.
Show answer
7-bit ASCII has 27 = 128 codes, which cover English letters, digits and some symbols but not Chinese characters. A larger character set such as Unicode uses more bits per character, so it has enough codes for them. The cost is that each character takes more storage.
10. (medium to harder) A game uses 20 different shades of green in a pixel palette. What is the minimum colour depth needed?
Show answer
24 = 16 is less than 20. 25 = 32 is at least 20. The minimum colour depth is 5 bits.
11. (harder) An image has a colour depth of 8 bits. The depth is increased by 2 bits. By what factor does the number of possible colours increase, and what is the new number?
Show answer
Original: 28 = 256 colours. New depth: 10 bits, so 210 = 1024 colours. Each extra bit doubles the number, so two extra bits multiply by 2 × 2 = 4. Check: 256 × 4 = 1024.
12. (harder) Trace this pseudocode. What is output, and which power of 2 is it?
Value ← 1
FOR Count ← 1 TO 5
Value ← Value * 2
NEXT Count
OUTPUT Value
Show answer
| Count | Value after the loop body |
|---|---|
| start | 1 |
| 1 | 2 |
| 2 | 4 |
| 3 | 8 |
| 4 | 16 |
| 5 | 32 |
The output is 32, which is 25. It also shows that 5 bits can represent 32 different values.
If you got these wrong
| Question | Likely cause | Revisit |
|---|---|---|
| 1, 2, 3 | Place values from the wrong end, or a skipped column | Convert between binary and denary |
| 4, 5 | Grouping bits wrongly, or mixing up A to F | Use hexadecimal as a compact representation |
| 6, 7 | A lost carry, or no statement about overflow | Add binary values with overflow awareness |
| 8, 9 | Counting from the wrong letter, or explaining without “more bits” | Explain character encoding |
| 10, 11, 12 | Multiplying instead of using powers of 2 | Relate bit depth to possible representations |
Keep a short record of the errors in the mistake log and retest queue, and retry a fresh version of each wrong question a few days later. If errors keep repeating, online one-to-one Computer Science tuition lets a teacher watch your working as it happens.