RecallStrideA BreakellSystems productTry revision

Binary and hexadecimal conversion: worked examples

Use place values and four-bit groups to convert numbers, then check your answer in the opposite direction.

Binary uses two digits, 0 and 1. Denary uses ten, 0 to 9. Hexadecimal uses sixteen: 0 to 9, followed by A, B, C, D, E and F for the values ten to fifteen. The value of a digit depends on its position. Always identify the base before calculating: the written number 10 represents different quantities in each system.

Convert binary to denary using place values

For an eight-bit unsigned number, the place values from left to right are 128, 64, 32, 16, 8, 4, 2 and 1. Add only the columns containing a 1.

Worked example: 10110110 in binary
Place value1286432168421
Bit10110110

128 + 32 + 16 + 4 + 2 = 182. The zero in the 64 column means that 64 contributes nothing; it does not move the other columns.

Convert denary to binary

To encode 73 as an unsigned eight-bit number, work from 128 downwards. 128 is too large, so write 0. Use 64, leaving 9. Skip 32 and 16. Use 8, leaving 1. Skip 4 and 2, then use 1. The result is 01001001. Check it: 64 + 8 + 1 = 73. Keep leading zeroes when the question specifies eight bits.

Convert binary to hexadecimal in groups of four

One hexadecimal digit represents four binary bits. Split 10110110 into 1011 0110. The first group is 8 + 2 + 1 = 11, written B. The second is 4 + 2 = 6. Therefore 10110110 in binary is B6 in hexadecimal.

For the reverse conversion, replace each hex digit with four bits. 3A becomes 0011 1010. Do not drop the zeroes inside a group: writing 11 followed by 1010 would change the alignment and may change the value.

Convert hexadecimal to denary

For two hexadecimal digits, the left digit has place value 16 and the right digit has place value 1. B6 therefore means (11 × 16) + (6 × 1) = 182. For three digits, include the 256 column: 12F means (1 × 256) + (2 × 16) + 15 = 303.

Know the range and spot overflow

An unsigned eight-bit value can represent 0 to 255. There are 256 combinations, including zero. Adding 1 to 11111111 needs a ninth bit: 100000000. If storage is limited to eight bits, the result cannot be represented in that unsigned format. Signed representations have different ranges, so do not assume that a leading 1 always means a large positive number.

Try these before opening the answers

Convert 00101101 to denary

32 + 8 + 4 + 1 = 45.

Convert 94 to eight-bit binary

64 + 16 + 8 + 4 + 2 = 94, so the answer is 01011110.

Convert 7C from hexadecimal to denary

(7 × 16) + 12 = 124. In binary it is 01111100.

When you make a mistake, name the step that failed: place value, arithmetic, grouping or the required number of bits. Then solve another example of that same type without looking at the method.

Related course topics

OCR J277 1.2.4 · OCR H446 1.4.1

Scope and sources

These original RecallStride explanations and examples are for study. Consult the OCR GCSE J277 specification (PDF) and OCR A-Level H446 specification (PDF) for qualification requirements. Not every detail applies at the same depth to both courses. Read the editorial policy or report an error to support@recallstride.com.

Continue learning