Seneca

Using Hexadecimal

Computer Science: OCR GCSE, topic 1.2.21

Using Hexadecimal

Hexadecimal is used in HTML to display colour on websites. Hexadecimal is also used to form unique MAC addresses for devices connected to a network.

HTML colours

HTML colours

  • In HTML, colours are defined by how much red, green and blue (RGB) there is.
  • The RGB amount is on a scale of 0 to 255.
  • A single byte can represent the numbers 0 to 255.
  • The 0 to 255 range means 2 hexadecimal digits are used to represent each RGB value.
  • HTML colour codes start with a hash symbol followed by 3 pairs of hexadecimal numbers like #00FF00.
HTML colours

HTML colours

  • We can break down the HTML colour code #00FF00 in the following way:
  • The red value is 00.
  • So we have 0 units of red.
  • The green value is FF.
  • So we have 255 units of green.
  • The blue value is 00.
  • So we have 0 units of blue.
  • The colour code #00FF00 corresponds to a bright green colour.
MAC addresses

MAC addresses

  • A MAC address is a number that uniquely identifies a networked device.
  • A MAC address is made up of 48 bits, shown as 6 groups of 2 hexadecimal digits:
  • NN-NN-NN-DD-DD-DD or NN:NN:NN:DD:DD:DD.
  • The first 6 hex digits identify the device manufacturer.
  • The second 6 hex digits identify the serial number of the device.

Test yourself on Using Hexadecimal

  • Which of the following gives the manufacturer of a device with MAC address 6A:BB:17:5D:33:8F?

  • Name the three colours that combine to create every colour in an HTML colour code.

  • Select the true statement in each pair.

Practise this topic for free