Hexadecimal Numbers (OCR A Level Computer Science)
Revision Note
Author
James WoodhouseExpertise
Computer Science
Representing Hexadecimal Numbers
What is Hexadecimal?
It serves as a more human-friendly representation of binary-coded values
Another numbering system is hexadecimal (base-16)
It consists of 10 numbers (0-9) and 6 letters (A-F)
Why use hexadecimal instead of binary?
It is more concise as four binary bits (e.g. 1010) can be represented with one hexadecimal character (e.g. A)
It is easier for humans to read and write
it is less prone to error as it is more likely to be communicated correctly
Potential uses of hexadecimal
It is commonly used for debugging, configuring hardware devices, and in cryptographic algorithms
It also also commonly used to define colours. As there are millions of colours in the visual spectrum that require very large binary numbers to represent them, they can be replaced with shorter hexadecimal values
Sample hexcolours
Hexadecimal Lookup Table
The hexadecimal lookup table serves as a quick reference for converting numbers between denary, binary and hexadecimal values
The hexadecimal scale is identical to the denary scale until the tens column is introduced
When the denary scale reaches 10, this is when the hexadecimal scale switches to letters, starting with A
Denary | Binary | Hexadecimal |
---|---|---|
0 | 0000 | 0 |
1 | 0001 | 1 |
2 | 0010 | 2 |
3 | 0011 | 3 |
4 | 0100 | 4 |
5 | 0101 | 5 |
6 | 0110 | 6 |
7 | 0111 | 7 |
8 | 1000 | 8 |
9 | 1001 | 9 |
10 | 1010 | A |
11 | 1011 | B |
12 | 1100 | C |
13 | 1101 | D |
14 | 1110 | E |
15 | 1111 | F |
Using subscript in number representation
The subscript in number representation denotes the base of a number
It helps in differentiating between number systems
Common uses:
indicates the number is in binary (base 2), and its value is '10' in binary
indicates the number is in denary (base 10), and its value is '10' in denary
indicates the number is in hexadecimal (base 16), and its value is '10' in hex, equivalent to '16' in denary
It provides clarity, especially in contexts where multiple numbering systems are discussed
Denary to Hexadecimal
Convert the denary number 241 to hexadecimal.
Step 1: Convert the number to binary
Step 2: Split the binary number into nibbles
Step 3: Convert each nibble into its hexadecimal value
Step 4: Final result
The denary number 241 is F1 in hexadecimal.
Hexadecimal to Denary
Convert the hexadecimal value 1A to denary.
Step 1: Convert each hexadecimal character into binary
Step 2: Join the binary values
Step 3: Final result
16 + 8 + 2 = 26
The hexadecimal value 1A is 26 in denary.
Binary to Hexadecimal
Convert 1101 0101 to hexadecimal.
Step 1: Take the binary values
Step 2: Convert each nibble into its hexadecimal value
Step 3: Final result
The binary number 11010101 is D5 in hexadecimal.
Hexadecimal to Binary
Convert B2 from Hexadecimal to Binary.
Step 1: Split the Hexadecimal into two separate digits and convert each to a nibble
Step 2: Join the two nibbles to make a byte (8 bits)
Step 3: Final result
The hexadecimal number B2 in Binary is 10110010
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)
Did this page help you?