Computers use binary to represent all data and instructions but binary is difficult for humans to read. Although the computer will always process data in a binary format Hexadecimal is used as an alternative representation.
Hexadecimal is a base 16 system and each hexadecimal value can only be represented by a single character, therefore to represent all 16 values within the Hex system the following values are used.
The number system we all know has Units, Tens, Hundreds, Thousands and so on. The Hexadecimal number system has 1s, 16s, 256s, 4096s and so on.
Like in traditional math if you take the value from each column and multiply it by the column header you get the total value of the number. Here we has the HEX value 1 0 4 1 so (1 x 4096 = 4096, 0 x 256 = 0, 4 x 16 = 64, 1 x 1 = 1). 4096 + 0 + 64 + 1 = 4161 So Hex 1041 is equivalent to Denary 4161 The chart below shows 3 numbers represented by Binary, Denary and HEX
CONVERTING BINARY TO HEXADECIMAL
To convert Binary to HEX you can simply split the Binary representation in to 4 bits then use each of the 4 bits to represent the HEX value. The table below shows 254 in binary 11111110 converted to HEX
HEXADECIMAL COLOUR REPRESENTATION
Just as numbers and letters are represented with Binary, so are images. To a computer an image is nothing more than a series of ones and zeros which allow the display of pixels in various colours.
To aid human reading of different colour codes, colours are commonly represented in Hexadecimal using the RGB Red Green Blue system. For example the chart below shows how pure blue is represented using HEX, the HEX code for pure blue is #00 00 FF, meaning it has zero red components, zero green components and the maximum amount of Blue components.
A brief colour chart for some of the other colours represented in hexadecimal.
Most software that allows you to manipulate images or colours will allow you to select colours by their HEX or RGB values.
Remember: Hex is used for our benefit to make it easy for use to see and work with, but the computer still deals with colour in binary format.
1: Convert the following Hex values to Denary. (Show your working)
7F
F7
2: What colour does #00007F represent ? 3: How do you know what colour #00FF00 represents without the need to look it up? 4: Hexadecimal addition, add the following HEX values (Show your working)
A8 + 25
22 + 22
5: A washing machine displays the following hexadecimal error code EA2. Rewrite this error code in binary. 6: Explain two reasons why hexadecimal is often used to display an error code on washing machine displays. 7: Explain how Hexadecimal is used in the following situations.