Lesson

Denary to binary conversion

1. Create a grid:

128 64 32 16 8 4 2 1

2. Add a 1 to the corresponding cell if number contributes to target number and 0 to all the other cells


Worked example: convert 2410 to binary.

128 64 32 16 8 4 2 1
0 0 0 1 1 0 0 0

1610+810=2410

The binary value is 110002 (we can ignore the preceding zeros)


Binary to denary conversion

Worked example: Convert 010110012 to denary

1. Create the grid:

128 64 32 16 8 4 2 1
0 1 0 1 1 0 0 1

2. Add up the cells that have a corresponding value of 1:

64 + 1610 + 810 + 1= 8910


Hexadecimal to denary conversion

  1. Convert the two hex values separately to denary value
  2. Multiply the first value by 16
  3. Add the second value

Worked example: Covert A316 to denary

A16 = 1010

316 = 310

(1010 x 1610) +310 = 16310


Denary to hexadecimal conversion

  1. Integer divide the denary number by 16
  2. Take the modulus 16 of the denary number
  3. Convert the two numbers to the corresponding hex values.

Worked example: Covert 18910 to hex

18910 / 1610 = 1110 remainder 1510

1110 = B16

1510 = F16

18910 = BF16


Hexadecimal to binary conversion

  1. Find the corresponding 4-bit binary number for the two numbers
  2. Concatenate the two binary values to give the final binary value

Worked example: Covert C316 to binary

C16 = 1210 = 11002

316= 310 = 00112

110000112


Binary to hexadecimal conversion

  1. Split the binary number into groups of 4 bits: 11102 10102
  2. Find the corresponding Hex value for each of the 4-bit groups

Worked example: Covert 111010102 to hexadecimal

11102 |10102

11102 = 1410 = E16

10102 = 1010 = A16

EA16



Learning Videos

For more information click on the tab below to watch a video about the lesson.


Click for video - Converting between decimal and 8 bit binary


Click for video - Converting between decimal and 2 digit hexadecimal

Questions

  1. For each of the binary values below, write down the decimal equivalent.

    a) 1101

    b) 1111

    c) 00100110

    d) 10110111


    a) 13

    b) 15

    c) 38

    d) 183

  2. For each of the decimal values below, write down the binary equivalent.

    a) 18

    b) 57

    c) 163

    d) 255


    a) 00010010

    b) 00111001

    c) 10100011

    d) 11111111


    When converting from denary to binary, leading zeros do not need to be written. So (a) would be just as correct to write 10010. However, if the question asks for an 8 bit number, then only 00010010 would be correct.

  3. Circle the binary value below that represents the decimal value 87.

    (a) 01011010

    (b) 11000100

    (c) 01010111

    (d) 00011010


    (c) 01010111

  4. Decimal to Hexadecimal conversion

    (i) Convert decimal 19 to hexadecimal:

    (ii) Convert decimal 44 to hexadecimal:

    (iii) Convert hexadecimal 19 to decimal:

    (iv) Convert hexadecimal A3 to decimal:


    i) 13

    ii) 2C

    iii) 25

    iv) 163

  5. Binary to hexadecimal conversion:

    (i) Convert binary 00110101 to hexadecimal:

    (ii) Convert binary 11010111 to hexadecimal:

    (iii) Convert hexadecimal 1E to binary:

    (iv) Convert hexadecimal FF to binary:


    i) 35

    ii) D7

    iii) 0001 1110

    iv) 1111 1111

  6. Convert the following values to and from Hexadecimal: (Show your working).

    (a) Decimal 37 to Hex

    (b) Decimal 59 to Hex

    (c) Hex 11 to Decimal

    (d) Hex 2F to Decimal

    (e) Hex 1A to Binary

    (f) Hex 16 to Binary

    (g) Binary 0011 0111 to Hex

    (h) Binary 1101 1111 to Hex


    a) 25

    b) 3B

    c) 17

    d) 47

    e) 0001 1010

    f) 0001 0110

    g) 37

    h) DF



Go Back