buying advice shift registers

Am I right that 255 is all eight binary values (0-7) converted to decimal again?

No, 255 is all eight bits of a byte set to 1:

255 == 0b11111111

If you have a binary number abcdefgh, where a-h are all either 0 or 1, you can convert this to a decimal value using the following:

value = a2^7 + b2^6 + c2^5 + d2^4 + e2^3 + f2^2 + g2^1 + h2^0
= 128a + 64b + 32c + 16d + 8e + 4f + 2g + h

Note that you can perform this exact same calculation in a base-10 system (there's nothing special about base-2). For example:

1234 = 1 * 10^3 + 210 ^2 + 310^1 + 410^0
= 1
1000 + 2100 + 310 + 4

For a general base b, your numerical value is:

sum from i = 0 to n-1 of (digit i * base ^ i)

where you have n base-b digits in your number.

Does this make sense?

  • Ben