WIP
How to understand radix: A tutorial for students of systems engineering
Note the binary number 0010
. Binary is read RTL or right-to-left.
0 | 0 | 1 | 0 |
---|---|---|---|
8 | 4 | 2 | 1 |
RTL, that is: ( 0 * 1 ) + ( 1 * 2 ) + ( 0 * 4) + 0 * 8 = 2
So the result is 2.
What 2
would that look like in decimal? It would look like this: 0002
, or just 2
.
0 | 0 | 0 | 2 |
---|---|---|---|
30 | 20 | 10 | 1 |
So the radix
for the decimal system is 10. This means that in each place,
you count up from 0-9. Once you hit 10, you go to the next "place", and you
increment that number from a 0 to a 1 (and leave the place you were just at,
empty).
This is accepted knowledge for most people when it comes to the decimal system.
The binary system is a bit different and takes some getting used to. There are
other systems as well, including octal
and hexadecimal
.
What "this is a Base64 file" means:
Base 10 means each "decimal place" increments by 10. Then, you move to the next decimal place. Right?
Same thing with base64. What that means, as you can imagine, is that you count from 0-63 in the first place, then, when you want to get to 64, you go to the next place, and change that number to a 1.
Base means radix.
re: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt