Before reading this post make sure that you watched my youtube video about numbers and their bases.
So, as we say we have different ways to express numbers, every number represents digits, that it includes.

But what about hexadecimal numbers? what comes after 9? In Base 16 system, beside digits we have also 6 Letters, to represent numbers higher than 9
In order to convert from binary to hexadecimal, we need to divide our binary number to 4 digit parts. Why 4?
Cause 16 it 4th power of 2.
If we have lack of digits to form accurate parts, we add 0s in their place
then, we deal with each of those parts.
It is the same principe as in video, we count starting from zero from the end, then counting 2s with the powers of those numbers. Main thing to do here is to multiply our binary ones and zeroes with the powers we get.
We do the same with another set of 4 digits
this is how we convert binary to hexadecimal, and same logic applies everywhere where we can express our base numbers with some power of 2.
Let's talk about addition in binary system.
Do you remember how to do simple additions with columns?
It is very close to what we are going to do now.

adding digits one by one, we carry them to the next column until the end.
Multiplication is also close to what we do in elementary school, and for the second step rules of addition are the same.
The last one manipulation to do, is to subtract one binary from another.
every time we have 0-1, we can't allow it to result negative number, so we need to take one from the next column, and every time we do this, we replace 0 with 2.
We can check it if we did it correctly or not with converting numbers back to decimal.
So that post was the very basic explanation of everything related to number representations, hope you enjoyed it, Thanks for reading)






Top comments (0)