The number 128 is in our "natural" base: base 10.
Which basically means that it is really:
1 * 10^2 + 2 * 10^1 + 8 *10^0
Or
1 * 100 + 2 * 10 + 8 * 1
Because that is what "base 10" means - you have ten distinct digits (0 to 9) and you get "bigger numbers" you multiply by the base value.
But that's not the only way to work with numbers. You can use any positive integer as a base, except 0 and 1 (that's not actually true, you can use non-integral bases or negative bases but that gets well beyond the scope of a little text box so I'm goign to ignore those completely).
Basically, all western math is
positional - the number of digits to the right of the digit you are talking about is the power to which you raise the base in order to to get the "complete" value for a digit. Confused? OK - lets try again.
We have a number: 234
we can think of it as 200 + 30 + 4 because "2" has 2 digits to its right so be multiply it by the base to the power 2. The base is ten, so 2 gest multiplied by 10^2, or 10 * 10, or 100. Similarly, the "3" has one digit to it's right, so it's multiplied by 10^1, or 10. "4" has zero, so it's multiplied by 10^0, or 1.
OK now?
We don't have to use ten as the base - if we had two thumbs instead of one, we'd probably use 12! But twelve isn;t a lot of help to computers which - as you know - only ever thing in zeros and ones. Which is actually base two, which we call "binary" and it works exactly the same as base ten, but with less digits available, and much, much longer numbers! For example, to represent "234" in binary would be "11101010" - try it for yourself using the system above:
1 * 2^7 == 1 * 128 == 128
1 * 2^6 == 1 * 64 == 64
1 * 2^5 == 1 * 32 == 32
0 * 2^4 == 0 * 16 == 0
1 * 2^3 == 1 * 8 == 8
0 * 2^2 == 0 * 4 == 0
1 * 2^1 == 1 * 2 == 2
0 * 2^0 == 0 * 1 == 0
---
234
---
A common base in "computer speak" is base 16 - or hex because it's easy to work into binary for the computer, and also a lot shorter than binary!
For hex, we need sixteen digits: 0 to 9, plus six others, for which we use the alphabet: A, B, C, D, E, and F.
So 234 in Hex is "EA":
E == 14 in base ten * 16^1 == 14 * 16 == 224
A == 10 in base ten * 16^0 == 10 * 1 == 10
---
234
---
So... 128 in hex is 80:
8 * 16 ^ 1 == 8 * 16 == 128
0 * 16 ^ 0 == 0 * 1 == 0
---
128
---
And you can work the rest out for yourself using the same principles! :laugh: