Computing uses big numbers. Think about HTML color codes. 0x3DE401. If we express this in decimal we get 405606510. If we express the same number in binary we get 0011110111100100000000012.
So, for human computer programmers, hexadecimal is a very convenient form of representing binary numbers - the 1s and 0s that computers understand.
Here we will look at some practical examples of hexadecimal usage:
Everytime you connect to the Internet, your device is assigned an IP (Internet Protocol) address. This can be an IPv4 address which uses 4 bytes and is written in the form 203.113.131.3 for example. This address identifies the location of your device on the Internet, allowing the device to be found when data is sent to it. The IP address assigned to your device can change. For example, if you go to Starbucks and use the available wifi, your device will be assigned a different IP address than the one you use at home.
Every device also has a MAC (Media Access Control) address. This identifies the actual device. It never changes. Here is a sample MAC Address:
It is a 6-byte address and is represented using hexadecimal - remember, a byte is 8 bits and can be represented by 2 hexadecimal numbers.
What is the MAC address of your computer? Write it down in binary form.
Think about programming languages you are familiar with - Javascript, Python, Java, Ruby. These languages are close to human language. They use words like for, while and repeat. These are high level programming languages.
Low-level programming languages also exist and are necessary for writing specific code for hardware devices like your CPU.
For example, an Intel engineer programming the latest chip will need to use Assembly Language, a low level programming language.
To access specific memory addresses on the chip, the engineer will need to know which addresses to use.
To make it a little easier for the engineer to work with these addresses, Assembly Language presents them in hexadecimal format, rather than binary.
Here is an example of Assembly Language...
Can you convert these hexadecimal numbers to binary?
Go to boxy-svg and create an image of the device that is controlled by a microprocessor/register system in the last lesson.
So... 8 bits is a byte of information and 4 bits is a nibble! Colors are represented using 3 bytes of data, one byte representing the red component, one byte representing the blue component and one byte representing the green component.
Hexadecimal is used to represent color information. A nibble (4 bits) can represent every hexadecimal symbol, from 0000 (0) to 1111 (F). So, 2 hexadecimal symbols represent 1 byte of information! In Photoshop, when you see the color code 0C1FDD 0C represents the red component (or channel), 1F represents the green channel and DD represents the blue channel - an RGB color code!
color decimal binary rgb hexadecimal base-2 red byte base-10 green bit base-16 blue nibble