Denary, Binary and Hexadecimal.
Our language and the language of computers is quite different. Computers cannot understand our language, however, we can try and understand theirs. Today, we'll be going in a exploring 2 languages that computers use and how we can convert from our language to their language.
DENARY:
- our number system
- it's a base 10 language since it uses 10 numbers: 0-9.
BINARY:
- signifies voltage/current/electricity is on or off.
- it's a base 2 language since it only uses 2 numbers; 0 and 1.
- each binary digit is called a bit.
- 8 bits are called a byte.
CONVERTING BETWEEN THE TWO LANGUAGES:
This can be done by a simple math concept. This grid below will be used to to convert from denary to binary. Let's observe this carefully. The numbers will always go up from right to left, and you times the number by 2 to get your next value. Do not forget to lay out this grid in your exam. You can keep going and extend this grid by multiplying 128 by 2, however you only do that if you have a large denary number.
Now, let's try and convert a denary number to binary. For example, if we're converting the denary number 9 to binary. First step will always be to lay out your grid. Then, you have to calculate which numbers in the grid will add up to your denary number. In this case, it will be 8 and 1. so we put a 1 below 8 and 1 because we need them and 0 in the other numbers. We also don't need the other bits, so we can discard them. You don't have to make your grid that long if unnecessary.
If you need to convert the number from binary to denary, all you do is this process but the alternate way. See what your grid numbers that have a 1 underneath them add up to and you will get your denary number.
HEXADECIMAL:
- simpler way to represent long binary numbers.
- uses 2 nibbles (half a byte, so 4 bits in 1 nibble)
- it's a base 16 language since it uses 16 characters: 1-10 and A-F.
- after 9, since we can't use more than 1 digit, we start using letters.
- all you need to do is count after nine with the alphabet.
- for example, A will be 10, B will be 11 and so on.
- only do this until F.
CONVERTING BETWEEN THE THREE:
BINARY TO HEXADECIMAL=
- Split the binary number into 2 nibbles e.g. 10111001 will be split into 1011 1001
- Convert the 2 nibbles into separate denary numbers e.g. the above binary number will converted into 11 and 9.
- Convert your number into letters if needed e.g. 11 will be converted to B and 9 will remain the same.
- You will get your final answer e.g. B9.
DENARY TO HEXADECIMAL=
- Simply convert your denary number to binary and then to hexadecimal as explained above.
BINARY ADDITION:
- 1+1 will be equal to 10 because that's 2 in binary.
- 1+0 will be equal to 1
- these are the simple rules you need to keep in mind while doing a binary addition.
Comments
Post a Comment