I have done some searching but have not found a truly satisfactory answer. As a developer i want to invest the necessary time in understanding this, thus i am looking for a complete explanation on this and feel free to provide any useful references.
Thanks.
I would recommend buying this book by Andrew S. Tanenbaum. He developed one of the predecessors to Linux called Minix. I used Structured Computer Organization as part of my university course.
Why computers use binary is not just a matter of switch context.
Relative to a reference voltage of say 3v. +1v(4v) = true or 1 and -1v(2v) = false or 0.
It also has to do with the most efficient method of creating controlling or logic circuits. This has to do with cost of implementation. How much does it cost to build circuits that work with binary compared to circuits that work with decimal or analogue see this answer.
If you compare how many billions of binary circuit transistors fit on to a modern CPU. The cost of doing that with say decimal (or analogue) system increases exponentially for every digit you want to add as you now have to add that much more controlling circuitry.
If you want to understand some of the most important contributing components that have helped to make binary the default standard for logic and controlling circuitry read and understand the following topics from Wikipedia. It will take about 4 hours to read through the most important topics, which have to do with some of the electrical engineering used to create the circuits.
I tried to be complete in this list of concepts you need to understand how the actual switches work and why they are used. As well as why Binary Arithmetic is such an efficient form of computation in hardware.
Now for some hard cores stuff. C. and C++ is used to write device drivers that speak to actual hardware. If you really want to get into how certain devices work, your CPU, and or external devices learn Assembler. You will begin to see how you can switch off a device by setting a certain device register to a specific value, that will be read by a logic circuit to change the devices state. For example you will understand why (0101) base2 = 5 (binary related stuff) will route a specific way through the circuits to switch the device on and off.
Computers could have been built to work even with decimal numbers, but from the engineering point of view it is a lot safer to distinguish only two states.
The voltage of the value 1 (+5V) is only a theoretical value, in real-life it always differs a bit. Would have they done computers with decimals, there would be no way to tell if +4.75V is 9 or 10.
It is because how logic gates work: There is a logical output (1) if the control voltage exceeds a certain threshold; no logical output (0) if not.
But probably much more crucial:
Maybe one time computers wouldn't work in binary anymore when quantum based machines arise (or other stuff like that, which maybe would encourage more complex state representations). But as binary values are the simplest possible representation of any (more complex) state, even in "quantum times" it probably would be most appropriate to stay with computers working in binary (abstracting from other physical representations like ternary or so, if given).
Stumbled upon this question. I recommend two books which addresses the question faithfully:
A Peek at Computer Electronics: Things you Should Know - by Caleb Tennis
CODE : The Hidden Language of Computer Hardware and Software - by Charles Petzold
And if you really want to understand how computers work, then take up:
The Elements of Computing Systems: Building a Modern Computer from First Principles
-By Noam Nisan and Shimon Schocken
Computers are using electricity as a mean to transport informations. And the easiest way to use electricity as an information is as On or Off (1 or 0).
Sure you can use different voltage to represents different number, but the electronic components to do so are really complicated.
It is also important to note that the ability to write and read 1 and 0 are enough to compute any calculation, this is called Turing completeness, so there is no need to find some more complex systems allowing something else than binary
(Ok, to be thorough, Turing completeness can be achieved only with infinite memory, but this isn't really relevant here.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With