You will need to convert up to 32 bit numbers between Denary, Binary, and Hexadecimal.
Denary-to-Binary Conversion
Can easily move between hexadecimal and binary, then use the techniques above to convert between denary. E.g.,
You might be wondering why we would want to use hexadecimal when we have binary and denary, and when computers store and calculate everything in binary. The answer is that it is entirely for human ease. Consider the following example:
All the digit strings are the same number and the easiest version to remember/understand for humans is the base-16, especially if it represents a sequence of 3 bytes as in colour codes. Hexadecimal is used in computers for representing numbers for human consumption, having uses for things such as:
NOTE: Hexadecimal is used as it is shorthand for binary and easier for people to remember (than binary). It DOES NOT take up less space in computer memory, only on paper or in your head! Computers still have to store everything as binary even if it appears as hexadecimal on the screen.
In exam questions for why hexadecimal is used, you usually need to choose from the following
"True color" in computers is where each pixel has 24 bits of color depth divided amongst the 3 colour channels Red, Green, and Blue - the three additive primary colours. That is, there is 1 Byte of information for each of RGB for each pixel. This is often written as 6 hex digits: #RRGGBB. For example. #FF0000 is bright red, #FFFF00 is bright yellow, #FF00FF is bright pink/magenta, #A8A8A8 is a light grey.
To approximately figure out what colour is represented by a RGB mix, place them on the rainbow / colour wheel. (Note that the concept of Blue in the 7 ROYGBIV colours due to Newton has shifted over the years)
Magenta R O Y G B I V Magenta
R G B
Note that the additive primary colours RGB used for mixing light are the opposite of the subtractive primary colours used for mixing paint and inks. Printers use CMYK, which stands for Cyan, Magenta, Yellow, Key/blacK.
Resources
Media Access Control addresses identify networking devices at the hardware level. It is a 48 bit address usually written as 6 pairs of hexadecimal digits separated by hyphens or colons. The first 24 bits correspond to the vendor of the hardware (ethernet, WiFi, bluetooth, etc...) device, the organizationally unique identifier (OUI).
IP addresses are used for identifying devices communicating with the Internet Protocol.
You can find your MAC addresses and IP addresses by using the terminal command ifconfig
(MacOS or Linux) or ipconfig
in Windows.
You can find your external facing IP address (controlled by your ISP / school / etc...) using whatsmyip.org, and you can lookup the vendors associated with your MAC addresses using whatsmyip.org/mac-address-lookup
Internal memory of the computer is binary data, which is hard to read and write by a human, and takes a lot of space to print on a screen. Using hexadecimal is more compact and readable than binary, and it is closer to the underlying binary data than a denary equivalent.
For this reason, when a computer generates a crash report (along with a memory dump) or when debugging, the memory content is often represented in hexadecimal.