Hexadecimal (CIE IGCSE Computer Science)

Revision Note

Test Yourself
Becci Peters

Expertise

Computer Science

Hexadecimal

Why Use Hexadecimal?

  • Hexadecimal numbers are often used as a beneficial method of data representation in computer science 
  • It takes fewer digits to represent a given value in hexadecimal than in binary
  • One hexadecimal digit can represent four bits of binary data
  • It is beneficial to use hexadecimal over binary because:
    • The more bits there are in a binary number, the harder it is to read
    • Numbers with more bits are more prone to errors when being copied

Worked example

The following binary number has 24 bits: 101110110011101011101010. Write the number in hexadecimal and explain why it is better to write the number in hexadecimal rather than in binary.

  • This number can be represented with only 6 digits in hexadecimal:
  • B B 3 A E A Mark for each character [6]
  • This number is:
    • Much shorter and a more efficient way of representing numbers [1] 
    • Easier to spot any errors in [1]

How is Hexadecimal used in Computers?

  • Using hexadecimal allows computer scientists to represent large amounts of binary data in a more manageable and readable format
  • There are many uses of hexadecimal in computers:
    • Memory addresses and other hardware related values
    • Representation of colour values
    • Error messages
    • Memory dump
    • Debugging
    • IP addresses
    • ASCII / Unicode 
    • Assembly language 
    • URLs 
  • Representation of colour values in HTML/CSS and in computer graphics: eg. RGB (red-green-blue) colour values can be represented in a compact and readable format. E.g. #FF0000
  • Error messages & debugging: eg. 0x80070643 to give technicians/developers information about what the error is in relation to
  • Memory dump: this is a record of what happened in the computer's memory at the time of an error. These are often difficult to read because they contain a lot of technical information, but computers can use hexadecimal values in memory dumps to identify specific memory locations and values.
    • Eg. A video game on a computer crashes and a memory dump is created. A technician analyses the memory dump and looks for hexadecimal values to identify the cause of the crash. They might look for specific memory addresses and values that relate to the game being played or the graphics card in the computer.
  • IP addresses
    • Hexadecimal values can be used to represent each set of numbers in an IP address
    • Each set of numbers can be converted into a two-digit hexadecimal value, giving a total of eight digits in the IP address
    • Eg. the IP address "192.168.0.1" could be represented in hexadecimal as "C0A80001"
    • The hexadecimal values can make IP addresses easier to work with in some cases, such as when configuring network devices or writing scripts that interact with IP addresses, however, they are not commonly used in everyday applications or browsing the internet
  • ASCII / Unicode: eg. The letter "A" is represented in ASCII as the decimal value 65, which is equivalent to the binary value 01000001. This binary value can also be represented in hexadecimal as the value 41
  • Assembly language
    • Hexadecimal values are used in assembly language to represent the binary code for the instructions and data 
    • Each instruction or data value is represented by a specific sequence of hexadecimal digits, which can make it easier for programmers to read and understand the code 
    • Eg. "MOV AX, 5" instruction is represented by the hexadecimal value "B805", which tells the computer to move the value 5 into register AX
  • URLs:
    • To encode a space in a URL using hexadecimal, the space character is replaced by a percent sign ("%") followed by the hexadecimal value of the space character. In ASCII, the space character has a decimal value of 32, which can be represented in hexadecimal as "20". 
    • So, to encode the URL "my website.com/page one" using hexadecimal, it would look like this: my%20website.com/page%20one

Exam Tip

  • When a question is asked which asks you to name a certain number of uses of hexadecimal, ensure you write the number asked for and no more. E.g. name 3 uses of hexadecimal - if you write more than 3, the last ones will be ignored by the examiner, even if they’re correct
  • If you're asked to name any uses of hexadecimal, don't write down any given in the question as you won't get marks for this

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Becci Peters

Author: Becci Peters

Becci has been a passionate Computing teacher for over 9 years, teaching Computing across the UK helping to engage, interest and develop confidence in the subject at all levels. Working as a Head of Department and then as an educational consultant, Becci has advised schools in England, where her role was to support and coach teachers to improve Computing teaching for all. Becci is also a senior examiner for multiple exam boards covering GCSE & A-level. She has worked as a lecturer at a university, lecturing trainee teachers for Computing.