1.2.17

Hexadecimal

Test yourself

Hexadecimal Numbers

Hexadecimal is faster for humans to process than binary. Hexadecimal allows us to find errors more easily. Hexadecimal is used in every computer system.

Illustrative background for HexadecimalIllustrative background for Hexadecimal ?? "content

Hexadecimal

  • Hexadecimal or hex uses 16 different symbols for each place.
    • This means hexadecimal is a base-16 numerical system.
  • Hexadecimal uses the digits 0-9, then A-F:
    • A = 10 in denary, B = 11 , C = 12, D = 13 and so on.
  • Each digit's place value is multiplied by 16 as we move from right to left.
Illustrative background for AdvantagesIllustrative background for Advantages ?? "content

Advantages

  • An 8-bit binary number can be represented by two hexadecimal digits.
    • This means you can reduce processing time with hexadecimal than with binary.
  • Hex is easier and faster to write two digits than the full binary sequence.
  • It is easier for a human to process hexadecimal than binary.
Illustrative background for Using hexadecimalIllustrative background for Using hexadecimal ?? "content

Using hexadecimal

  • Hexadecimal is used extensively in programming languages such as:
    • Machine code.
    • Assembly.
  • Hex can be used during the debugging stage of writing programs as it is easy to process by humans.
  • Hex can represent numbers stored in a CPU's registers or in main memory.

Using Hexadecimal

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

Illustrative background for HTML coloursIllustrative background for HTML colours ?? "content

HTML colours

  • In HTML, colours are defined by how much red, green and blue (RGB) there is on a scale of 0 to 255.
    • 0 to 255 is the range of numbers that can be represented as a single byte.
    • This means we use 2 hexadecimal digits to represent each RGB value.
  • HTML colour codes start with a hash symbol followed by 3 pairs of hexadecimal numbers like #00FF00.
Illustrative background for HTML coloursIllustrative background for HTML colours ?? "content

HTML colours

  • We can break down the HTML colour code #00FF00 in the following way:
    • The red value is 00, which means 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.
Illustrative background for MAC addressesIllustrative background for MAC addresses ?? "content

MAC addresses

  • A MAC address is a number that uniquely identifies a networked device.
  • A MAC address is made up of 48 bits which are 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.

Jump to other topics

1Computer Systems

1.1Systems Architecture

1.2Memory & Storage

1.3Computer Networks, Connections & Protocols

1.4Network Security

1.5Systems Software

1.6Ethical, Legal, Cultural & Environmental Concern

2Computational Thinking, Algorithms and Programming

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson