Computers must use binary to represent all different forms of data because computers use voltages and although these change very often, there is no voltage value for a number in the decimal system.
This means that the signals are simply measured as “on” or “off” or simply 1 or 0. This is known as Binary
“Data is processed using Logic Gates and stored in Registers” – More on this later!
Denary (or normal numbers as we know them) are BASE 10 as they have 10 digits (0 through to 9)
Binary is BASE 2 as it has 2 digits (1 and 0)
Hexadecimal is BASE 16 (ranges from 0-9 then A=10 B=11 C=12 D=13 E=14 F=15)
Converting from one to another
Binary to Denary
Hexadecimal to Denary
Denary To Hexadecimal
Why use Hexadecimal?!
Each Hexadecimal Character is the same as 4 bits (0110 which gives us the value 6) (4 bits is also known as a nibble!)
From this process you can see that it makes it much easier than writing lots of 1’s and 0’s
Imagine 101011111111 …… We could just simply write AFF
In simple terms Hexadecimal is easier for humans to understand compared to Binary
Hexadecimal provides a much shorter representation of Binary
Hexadecimal is used for choosing colors
If I said to color a page in blue or dark blue you might think how dark is dark blue and how light is light blue (Everybody’s perception is different)
BUT If I said #3333CC you would end up with
This would be exactly the same color as someone else using #3333CC.
Think how easy it is for one person to design a website and someone else design the logo on the other end of the world. So long as they are using the Hexadecimal codes for the colors they should all match!
Click the image below to access the site to select your color and get its HEX code
Hexadecimal is used for MAC Addresses
MAC addresses as we know are contained within every device that contains a NIC (Network Interface Card) and anything that connects to the internet needs a Network Interface Card
This could be in the form of a mobile phone, a smart TV, A laptop etc (basically anything that connects to the internet!)
A MAC address is short for (Media Access Control)
A MAC address is given to a network adapter when it is manufactured. It is hardwired or hard-coded onto your computer’s network interface card (NIC) and is unique to it. This means that once the MAC address has been assigned it does not change.
The first 3 pairs of Hexadecimal values are the manufacturers code Dell is 00-14-22
The last 3 is the identification code for that particular device for that manufacturer
Note that hardware from different vendors may happen to have the same last 3 sections of the address
Hexadecimal is used for Memory Locations
In the image below you can see that the values on the left represent the location of something in memory. These are much shorter to write in Hexadecimal than in Binary. Remember each Hexadecimal is worth 4 Binary values
Note the 0x at the beginning is just to tell the computer that it is Hexadecimal.
This makes it very easy to locate certain memory locations
It is also used to determine where and what software/hardware issues have occurred
Adding two positive 8-bit binary integers
A great video from Craig ‘n’ Dave on explaining this clearly
An overflow occurs when the value or answer is great than the highest number that can be stored
Fo example in an 8 bit register the highest value is 255 so trying to store the result for 128 +186 would result in an overflow error being returned rather than the value.
For more details on the watch the above video again paying attention to 4mins 15 and onwards
How much can a computer represent or store?
With 8 bits, the maximum number of values is 256 or 0 through 255. Table 5.1 gives the number of bits in a binary number and the maximum number of states that can be represented.
|Number of Bits||Maximum Number Of States|
|12||4096 (4 K)|
|16||65,536 (64 K)|
|20||1,048,576 (1 M)|
A 64–bit processor includes a 64–bit register, which can store 264. That is 18,446,744,073,709,551,616 values!!
Perform a logical Binary Shift on a positive 8-bit binary integer and understand the effect this has on the positive binary integer
Use two’s complement to represent positive and negative 8-bit binary registers