1.1.2 Hexadecimal Flashcards
Data representation
Why do programmers use hexadecimal?
They use hexadecimal as it is easier to read then binary as a byte can be represented shorter. Makes programs easier to debug.
Uses of hexadecimal notation:
Used for colour in HTML, normally 6 digits.
Windows error codes are in hex.
Mac adresses are 12 digit hex codes.
Why is hexadecimal used in machine code?
Machine code consists of simple instructions and is directly executed by CPU. A byte can be coded as two hex symbols hence it is used in machine code
How do you convert denary to hex?
Divide number by 16 and note result and times anything after decimal point by 16. Then keep repeating by diving result and times anything after decimal point by 16 until result is 0 and cannot be divided. Read remainder times 16 bottom up and that there is your hex
How do you convert from hex to denary?
Put number in grind with the units above it and then multiply units by the value and then sum it all up.
How do you convert binary to hex?
Break into nibbles from r - l and find denary value and note it. Read values from left to right.
How do you convert hexadecimal to binary?
Break it up into all its digits and write down binary value of digit add together and that is the binary