Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
Digit (input) Digit (decimal) |
||||||||
Power(base, pos) Value |
||||||||
Digit * Value |
For any input, the digit is each number individually.
The number: 10, has 2 digits.
The number: 9, has 1 digit.
In the table, each digit is split up into its own column. So 10 would be: 1 0
Digits that are not present, are considered 0. 1 is the same as 000001
The base of a numerical system is how much "worth" each digit in that system has. And how high we can go.
Base-10 (Decimal) is what we use all the time. When we write: 23, it has 2 digits, each with a different worth (tens and ones).
In any base system, each digit has N options. Since the digits start at 0, the max value for each digit is N-1
For bases above 10, we have no numerical digits above 9. So we start with a (10), b(11), c(12), etc.
Base-10 (decimal), 0..9
Base-2 (binary), 0..1
Base-8 (octal), 0..7
Base-16 (hexadecimal), 0..f(15)
For any number, the position (pos) starts at the right(0) and goes up with 1
Calling the "first" position 0 is actually very helpful. Because it will match the powers perfectly.
At position pos, the digit at that position is worth: N to the power of pos
Base-2: 1, 2, 4, 8
Base-10: 1, 10, 100, 1000
This is the result of digit * power.