# Radix
Radix (基數) forms the basic of number system. While radix basically mean how many numbers you can put into one digit. For a radix-R system , The the value of those numbers will be:
By changing R, all radix can be simulated.
# Binary, Octal, Hexadecimal
So for binary, octal and hexadecimal number, they are under R = 2, 8 and 16 respectively. Since number 2 can be dividend of both 8 and 16, we can canvert it easily using some tricky method. Let's say we have a binary number :
If we want it's octal and hexadecimal version, we can re form those bits into group, each group means the exact value same as the radix, i.e., radix 8 have 0-7 as it digit, then we can merge 3 bit of binary numbers into a group. And the outcome will be like:
Oct | 2 | 6 | 3 | 5 | 5 | 4 | 4 |
---|---|---|---|---|---|---|---|
Bin | 010 | 110 | 011 | 101. | 101 | 100 | 100 |
Simply is that.