โ† Back to Number Systems

Worked Examples: Number Conversions

Step-by-step solutions for all conversion types

Example 1 Foundation

Binary to Denary

Question

Convert the binary number 11010110 to denary.

Solution

1 Write out the place values
1286432168421
2 Write the binary digits underneath
1286432168421
11010110
3 Add place values where there's a 1
128 + 64 + 16 + 4 + 2 = 214

Final Answer

11010110โ‚‚ = 214โ‚โ‚€

Example 2 Foundation

Denary to Binary (Division Method)

Question

Convert denary 179 to an 8-bit binary number.

Solution

1 Repeatedly divide by 2, recording remainders
179 รท 2 = 89remainder 1
89 รท 2 = 44remainder 1
44 รท 2 = 22remainder 0
22 รท 2 = 11remainder 0
11 รท 2 = 5remainder 1
5 รท 2 = 2remainder 1
2 รท 2 = 1remainder 0
1 รท 2 = 0remainder 1
2 Read remainders from bottom to top
Reading up: 1 โ†’ 0 โ†’ 1 โ†’ 1 โ†’ 0 โ†’ 0 โ†’ 1 โ†’ 1 = 10110011

Final Answer

179โ‚โ‚€ = 10110011โ‚‚

Verify: 128 + 32 + 16 + 2 + 1 = 179 โœ“

Example 3 Core

Binary Addition

Question

Add the binary numbers 01011011 and 00101110.

State whether overflow occurs.

Solution

1 Set up the addition (rightmost column first)
  01011011
+ 00101110
----------
2 Add column by column, carrying when needed

Column 1 (rightmost): 1 + 0 = 1

Column 2: 1 + 1 = 10, write 0, carry 1

Column 3: 0 + 1 + 1(carry) = 10, write 0, carry 1

Column 4: 1 + 0 + 1(carry) = 10, write 0, carry 1

Column 5: 1 + 1 + 1(carry) = 11, write 1, carry 1

Column 6: 0 + 0 + 1(carry) = 1

Column 7: 1 + 1 = 10, write 0, carry 1

Column 8: 0 + 0 + 1(carry) = 1

3 Write the result
    1 1 1 1  โ† carries
  01011011  (91)
+ 00101110  (46)
----------
  10001001  (137)

Final Answer

01011011 + 00101110 = 10001001

Verify: 91 + 46 = 137 โœ“

No overflow - result (137) fits within 8 bits (max 255)

Example 4 Core

Hexadecimal to Denary

Question

Convert hexadecimal B7 to denary.

Solution

1 Identify the hex digits and their denary values

B = 11, 7 = 7

2 Multiply by place values (powers of 16)

B (11) is in the 16s column: 11 ร— 16 = 176

7 is in the 1s column: 7 ร— 1 = 7

3 Add the results
176 + 7 = 183

Final Answer

B7โ‚โ‚† = 183โ‚โ‚€

Example 5 Core

Binary to Hexadecimal

Question

Convert binary 11011001 to hexadecimal.

Solution

1 Split into groups of 4 bits (from right)
1101 | 1001
2 Convert each group to hex

1101 = 8 + 4 + 1 = 13 = D

1001 = 8 + 1 = 9 = 9

Final Answer

11011001โ‚‚ = D9โ‚โ‚†

Verify: D9 = (13ร—16) + 9 = 208 + 9 = 217

Binary: 128+64+16+8+1 = 217 โœ“

Example 6 Core

Binary Shifts

Question

a) Perform a left shift by 2 on 00010100 (20)

b) Perform a right shift by 2 on 01100100 (100)

Solution (a) - Left Shift

1 Move all bits left by 2 positions

Original: 0 0 0 1 0 1 0 0

After: 0 1 0 1 0 0 0 0

Fill empty positions on right with 0s

2 Calculate expected result

Left shift by 2 = multiply by 2ยฒ = multiply by 4

20 ร— 4 = 80

Answer (a)

00010100 << 2 = 01010000 (80)

Solution (b) - Right Shift

1 Move all bits right by 2 positions

Original: 0 1 1 0 0 1 0 0

After: 0 0 0 1 1 0 0 1

Fill empty positions on left with 0s, rightmost bits are lost

2 Calculate expected result

Right shift by 2 = divide by 2ยฒ = divide by 4

100 รท 4 = 25

Answer (b)

01100100 >> 2 = 00011001 (25)

Practice Problems

1. Convert 10101100 to denary

2. Convert 145 to binary

3. Add 01110011 + 00011010

4. Convert C4 to denary

5. Convert 10111010 to hex

6. Shift 00011000 left by 1