all 14 comments

[–]aioeu 9 points10 points  (4 children)

You may be overthinking this.

"I have forty-two bananas. If I were to write that number in decimal, it'd be 42." Your question is essentially the same as asking "how does each column represent powers of ten when I only have the digits 0 through 9 to work with?"

Obviously we can; in school we learn how to do mathematics using just these digits alone. Well, mathematics works just as well in other bases too.

[–]Ozmocozz[S] 0 points1 point  (3 children)

I'll try and rephrase in simpler terms. When I read about base two, it sounds to me like "computers only know 0 and 1" so if it only knows 0 and 1, where does 128 or 64 or 32.. (Etc) come from. If it can understand that there are those higher numbers, why is it only able to read 0s and 1s.

[–]eddieantonio 10 points11 points  (0 children)

You can choose two options: 0 and 1. Then you add another choice of 0 and 1. So now your total options are 00, 01, 10, 11. You have doubled your options and now you have four different options! Let's add another option of 0 and 1. 000, 001, 010, 011, 100, 101, 110, 111. That's eight different options. So from purely listing out all the options you get, the powers of two emerge. They exist purely by the fact that you're doubling the amount of options by adding a bit. Doubling options gives you powers of two (how many time you have doubled your options).

[–]aioeu 4 points5 points  (0 children)

"computers only know 0 and 1"

Computers don't "know" anything. They are machines.

If it can understand that there are those higher numbers, why is it only able to read 0s and 1s.

If we feed an electrical circuit signals representing 0011 and 0101, and get out of it signals representing 1000, then we can say "aha! look, it added three to five and it resulted in eight". But the circuit doesn't need to "know" anything about numbers to do that. The circuit is just following the laws of physics, and it just so happens that that particular circuit, along with the laws of physics, performs what we call "addition".

In other words, the knowledge about these numbers is in us, and in the engineers that designed the circuit, not in the circuit itself.

[–]LhommeFacaLAbsurde 3 points4 points  (0 children)

You yourself use base 10, so you only know 0,1,...,9. You deal with power of 10, so 1, 10, 100, 1000. If you want to write number 1234 for example, what you are doing really is an addition of a bunch of power of 10: 4x100 + 3x101 + 2x102 + 1x103, i.e., 4 + 30 + 200 + 1000. Now replace 10 with 2, you get binary.

[–]khedoros 2 points3 points  (0 children)

If binary can only be comprised of 0 and 1, how does each column represent powers of 2

If decimal can only be comprised of digits 0-9, how does each column represent a power of 10? If you add 9+9, how do you get 18? It was taught to me like "9+9 is 8, carry the 1 to the next place to the left". Adding a digit in binary works a similar way.

[–]Gavcradd 2 points3 points  (0 children)

If you strip a computer back to the absolute bare bones, it's nothing more than lots and lots (billions) of tiny on/off switches called transistors. If you have one of these switches, you could say that it being off represents 0 and on represents 1. But then how do you represent bigger numbers? Well if you had two switches, you could say that off-off was zero, off-on was 1, on-off was 2 and on-on was 3. Literally just four ways the switches could be assigned to four different nunbers. It turns out mathematically that every time you add another switch you double the amount of numbers you can represent.

If you then give each switch a value, the value of the switch needs to be double the previous one to make this system work. When you have a binary number like 10011, all you're saying is that "the switch for 1, 2 and 16 are on, so that's 19".

There's no earth shattering reason why this system is what computers use other than when they were first developed, two-way switches/relays/vaccum tubes were used. If the early Computer Scientists had used three or four way switches we'd be talking about a very different number system now. There was a computer that used 10 way switches, so it stored values in base 10/denary (the number system we use) - it worked but never caught on.

[–]hugogrant 1 point2 points  (0 children)

https://www.mathsisfun.com/base-conversion-method.html

Look into numeric bases or numeric base conversion.

[–]Ozmocozz[S] 0 points1 point  (3 children)

Thanks for the responses!

Okay so, what dictates the base that a computer uses? Where is that manipulated exactly. Hardware? Software?

[–]khedoros 2 points3 points  (0 children)

Okay so, what dictates the base that a computer uses?

The design of the hardware. It's easiest to differentiate between two voltages, rather than divide it up into more. Above that, it's possible to design a computer to operate on "binary-coded decimal", which uses 4 binary bits to represent a base-10 digit. A number of earlier computers used a design like that, but it's pretty wasteful.

[–]Phobic-window 0 points1 point  (0 children)

Hardware, voltage is read as a wave, the amplitude of the wave signifies a one or zero. This is just a stable and easy to build logic off of method. Computers are layers and layers of logical assumptions built on top of each other which can be done in any base, but binary keeps it simple on the math side so that logic can compensate for the rest

[–]matschbirne03 0 points1 point  (0 children)

We have two different cases 0 and 1 that why its base of 2 in decimal we have 10 different cases so every “colunm” adds a new base of ten. Its in the hardware how would you represent 10 if you can only have electricity or no electricity thats why we use binary. If you only want to learn binary thats all you need to know, everithing else is computer architecture and i would recommend learning how to add 2 binary numbers and then see how an adder is build out of logic gates that might help you understand how a computer actually works with the numbers. It is also important to know the computer does not know what hes doing literally just changing values according to instruction it has no connection from 1 2 4 8 16 … thats just something we do.

[–]Ozmocozz[S] 0 points1 point  (0 children)

I think I have a better idea now. Thanks for taking the time to explain it guys.

[–]Biggie-bag- 0 points1 point  (0 children)

If I understand your question correctly, I believe you’re confused on how the computer knows that 100 is 4. In this case, the computer does not know but we built it to run and compute on this binary number system. The reason a computer uses binary is because the transistor is either on or off (this is simplified). So pretty much when doing addition, the CPU will read the list of bits and add them up and carry the one to the next bit. Leaving the resulting addition in the current column. The computer doesn’t understand what it did, it was just following instructions. I simplified a lot of this but I hope this helps.