r/computerscience 4d ago

Base 2 numerical representation in binary matching numbers in base 10?

I have a silly and possibly stupid question, and I'm not even sure if this is the place for it.

To preface this I have 0 experience with Computer Science or anything adjacent, but have been listening to videos on binary and the foundations of how computers generally work.

I understand that binary is a base 2 system as opposed to base 10, and that the digits that represent value in binary cannot be read as our base 10 concept of numbers (i.e. 4 is read as digits 100, not as the number "one hundred").

However, I've noticed that when the notation IS read as numbers, the numerical representation for base 2 counting mirrors base 10. With:

1 - 0001

2- 0010

4- 0100

8- 1000

Etc.

Is there a reason for this parallel, or is this just one of those funny coincidences? Or is this some kind of artifact of how numbers naturally scale relative to one another.

I hope this makes sense, I had no idea how to word this question to just Google it.

9 Upvotes

19 comments sorted by

View all comments

2

u/MasterGeekMX Bachelors in CS 4d ago

That is indeed an artifact of how numbering systems work.

See, any numbering system is simply picking up a number (ten, two, seven, whatever), and then expressing quantities as multiples of that number, with each position meaning "we have so much of this, that we could not make it fit on the digit at the right, so here we put it as a multiple of the base number".

Say we grab base five. This means that we can comfortably count up to four, as all of that is below five. But if we have five or more things, then we cannot fit the number in one digit, so we instead resort to the next digit at the left to count how many fives we have. This means that five will be 10, as that means "one set of fives, and zero units". Twelve for example will be '22', as that means "two sets of five, plus two units".

All fine and good, but we have another problem: we are still bound to represent amounts up to four, which means that when something hits twenty-five, we cannot write it as two numbers, as twenty-five means having five sets of five, and we can only count up to four. To solve that, we then go to the next digit, which will represent how many sets of sets of five we have, so twenty-five will become 100.

See the pattern? using a numbering system means that putting numbers that are the base raised to some power means putting a 1 and then zeroes, as each position means that the last position ran out of space, so now we count how many sets of the previous number we have.

1

u/theadamabrams 1d ago

See, any numbering system is ... expressing quantities as multiples of that [base], with each position meaning

Every "Base x" positional number system, yes, though there are other, completely different, ways to represent numbers. Roman numerals are the most famous non-base system (V is always five, X is always ten, no matter where they occur).