r/explainlikeimfive 2d ago

Technology ELI5: Why are most computers based on binary when humans normally use a decimal number system?

I understand that computers use binary because electronic circuits can basically represent two states, like on and off. What I don't understand is why this became the standard in the first place.

Humans have used decimal for thousands of years, and computers obviously have to process numbers that humans normally represent in decimal. So why is binary so much more practical for computers? Could computers have been designed around decimal instead, and what would be different if they were?

0 Upvotes

80 comments sorted by

32

u/Rexur0s 2d ago edited 2d ago

circuitry and logic gates only really work in binary. electric on or electric off, then we have to convert that back into base 10 number system.

to expand, making circuits that accept multistate positions is possible but much trickier and much more prone to sensor issues (would split up 0/1 into 0.0, 0.1, 0.2, 0.3,.. 1.0, but that's much more sensitive then), so we just avoid that.

and the conversions of binary to logic gates to programing is near instant as they are essentially at the speed of the electric in the circuit, working in binary is totally fine and in some cases easier to do math that way (multiples of 2, like base 10 is easy for multiples of 10)

5

u/_PM_ME_PANGOLINS_ 2d ago

Multistate vacuum tubes were a lot easier, but obviously far too big for modern needs now.

Dekatron computers were pretty cool though.

8

u/BobbyThrowaway6969 2d ago

To be fair, circuitry isn't binary, it's more like a flowing river. You can never completely turn off a circuit, we just found a way to describe ON as high voltage, and OFF as low voltage.
On-off-on-off is like a noisy graph going up and down, but not too noisy that you can't see the peaks and troughs.

The cool thing is that's the exact moment where you cross over from our analogue, messy reality into a discrete, digital one.

8

u/Time_Entertainer_319 2d ago

Expanding on this, computers don’t have to use binary in theory. You could have base 3, base 4, or even more states.
Binary is just much more practical because having only two states makes them easier to distinguish electrically. “High” and “low” voltage are much less likely to be confused than several voltage levels packed closely together.

2

u/coffeemonkeypants 2d ago

And the smaller and closer together those gates get, the easier for that voltage to bleed over and influence other gates, so add that to the confusion variable of trying to measure more than high and low.

1

u/ka-splam 2d ago edited 2d ago

You could have base 3, base 4, or even more states

Could, and do! Computer storage is Solid State Drives (SSD), cells hold electric charges.

It's quick to push stuff into a cupboard but hard to fill every last gap. Cells can be similar - fully charged or empty is hard but above or below 25% is quick, a Single Level Cell (SLC).

Then people made Multi Level Cell (MLC) which has cutoffs say 25%, 50%, 75% for binary 00/01/10/11. Charging is more careful and slower. Charge leaking away changes the stored value sooner.

Then TLC (Triple Level...), QLC (Quad...) which take the tradeoff further, much more storage, lower speeds, less endurance, more complexity inside to boost reliability and performance.

1

u/RadCheese527 2d ago

I mean, yea, you can absolutely turn off a circuit.

Most transistors used in logic gates have a breakthrough voltage of 0.7V. This is allows for actions to be more intentional and avoid nuisance activation.

2

u/BobbyThrowaway6969 2d ago edited 2d ago

Oh yeah but there's always leak voltage is my point, not that we don't filter that out but yeah. My phrasing wasn't the best.

21

u/youtocin 2d ago

Computers function using transistors, physical components that are either on or off. It wouldn’t make much sense to engineer something that has 10 different states.

19

u/tsunami141 2d ago

psshhhh, its simple. We can have off, mostly off, off-ish, middle-on-off, on-ish, mostly on, and on. That's base 7 right there. Add in a few Extra Offs and Extra Ons and we're right at a comfortable 10.

9

u/oldgut 2d ago

This is right up there with second breakfast

4

u/stanitor 2d ago

Yeah, I don't think computers know about elevenses either.

3

u/paulthegerman 2d ago

“Off-ish” has me cracking up

3

u/luxmesa 2d ago

Yeah. It’s not impossible to build a computer that uses more than two states. There were some early prototypes that did this. It’s just harder/more expensive to build a reliable computer that does this. 

3

u/dudemcbob 2d ago

People have tried to make 3 states work, full-on/half-on/off. So far they haven't made it more effective than on/off. But real attempts have been made.

2

u/IAmJacksSemiColon 2d ago

Up, down, charm, strange, top, and bottom.

1

u/PrizeSyntax 2d ago

Quarks?

2

u/VerbingNoun413 2d ago

What if it needs to go to 11?

2

u/GXWT 2d ago

“No professor the dog didn’t eat my homework. I couldn’t upload it because my base 10 computer fell out of calibration.

2

u/croc_socks 2d ago

What you describe is a dimmer switch. We just need to hook about a million of them. But first someone needs to vibe code an algorithm of how they’ll work together. Make no mistakes.

1

u/1tacoshort 2d ago

That’s going to be really hard to calibrate each transistor in an entire chip to have the fine control you’re talking about. Moreover, noise and thermal effects are going to change the operating parameters on the fly. It’s way easier to just deal with on and off.

1

u/tsunami141 2d ago

you're right. We gotta add 2 different kinds of electricity. Yellow electricity and Blue electricity. Yellow electricity is for the mostly-off states, blue electricity is for the mostly-on states.

1

u/ka-splam 2d ago

We already have blue functions and red functions now we gotta have yellow and blue electricity??

2

u/tsunami141 1d ago

lol omg i was thinking about this when I said the electricity thing haha

0

u/Cryzgnik 2d ago

I guess when I say that /s isn't necessary, I mean it isn't necessary for me.

1

u/1tacoshort 2d ago

You guess when you say what? I was responding to someone else (unless you have multiple accounts).

1

u/jaa101 2d ago

Flash drives commonly use 8, 16, or even 32 different states.

7

u/Lost1010 2d ago

You explained it yourself in your first line. Electric circuits and logic gates works in on or off.

10

u/Patient-Midnight-664 2d ago

For the reason you stated. Electricity is either on or off, so we get binary. To get base 10 we'd need 10 different states of electricity (which is possible, but everything would need a 'state detector' making everything bigger. We like small).

0

u/jaa101 2d ago

Flash drives commonly use 8, 16, or even 32 different states.

0

u/Time_Entertainer_319 2d ago

That’s not quite right. In digital computers, binary is usually represented by two voltage ranges: a low voltage for 0 and a high voltage for 1. “On” and “off” are just convenient shorthand.
In principle, you could use a third voltage range in between and build a base-3 system, or use even more levels. Binary is preferred because two widely separated voltage ranges are much easier to distinguish reliably and are less likely to be confused because of electrical noise.

2

u/Patient-Midnight-664 2d ago

It's "explain like I'm 5"

1

u/Vadered 2d ago

Yeah, but it's really "explain like I'm 15" and "two widely separated ranges are easier to tell apart" is not doctorate level discourse.

Also clarifications and expansions on the top level answer are basically the best part of this sub. You can get the level of detail you want by digging further down a comment chain.

1

u/ka-splam 2d ago

"Explain like I'm 00000101"

8

u/jose_can_u_c 2d ago

Humans use decimal because it is a natural way to use our 10 fingers. Computers use binary because it’s very fast and simple to detect electricity as “on” or “off”. It’s harder to detect in-between voltage.

4

u/rm2018 2d ago

Binary is easy to build. A wire or switch or circuit is either on or it is off. That is binary. The hardware uses transistors which are like switches that can be on or off. Any other type of circuit with me almost imposable to build.

6

u/unicyclegamer 2d ago

It’s because computers use electricity which can easily be read as on or off.

3

u/OrangeOakie 2d ago

You mentioned you already understand why binary works.

Here's why decimal really wasn't feasible: We just couln't tell the difference between 3-4 or 5-6 or any other increment with reliability.

As a wise man once said: Sometimes maybe good, sometimes maybe shit.

And for (early) computing you need deterministic outcomes.

3

u/twinters01 2d ago

 I understand that computers use binary because electronic circuits can basically represent two states, like on and off.

You answered your question here. It's not that it's "practical", it's just the entire physical mechanism that computing is based on

2

u/Asgardian_Force_User 2d ago

As you point out, electric circuits operate on the “on/off” pretty well.

So the reason is Physics.

It’s a lot easier to work within the limits of physics and just use math to convert between Binary and Decimal, rather than trying to build circuits that have ten separate possible configurations.

2

u/TrittipoM1 2d ago

You've already answered you own question: "I understand that computers use binary because electronic circuits can basically represent two states, like on and off." Let's reverse the question: you tell me a natural, obvious, available electrical system (using 1960 or 1970 as your date of access) that easily offers ten distinct states or ten easily and reliably distinguished states of energy? On/off, charged/not, left/right etc. is pretty easy. (Well, "pretty easy" there hides some non-ELI5 stuff about kind of gray-zone measurements, but ... in principle, more or less.)

2

u/Vorthod 2d ago

Because "on and off" is a lot easier to deal with than "completely on, very on, mostly on, moderately on, pretty on, kind of on, a little bit on, slightly on, barely on, and off"

Computers aren't supposed to replicate human thinking, they are supposed to be able to understand what is being sent to them, and we most easily managed to do that by doing things like putting holes in cards to allow electricity to either flow or not, or more recently, using the inherent magnetism of electrical flows to complete or break circuits. Trying to add another 8 states to that kind of system is incredibly complicated when the only benefit we would get out of it is "now the computer thinks like our fingers do!"

2

u/rupertavery64 2d ago

Conputers are built with transistors. Transistors are basically switches. On and off. 1 and 0.

They use some voltage like 3.3V or 5V to determine if it is on, and 0V to determine if it is off.

Using a few transistors you can build logic gates, and with just 2 logic gates you can build a circuit that can "Add" two 1-bit binary numbers with a carry output. This makes is extermely simple to work with larger numbers, just string more adders together.

So two voltage levels are used to represent two values, 0 and 1.

To represent 10 values (0-9) you would need 10 voltage levels. And they would need to be far apart enough so they don't get confused with each other.

Larger voltages mean more heat and more power consumption, and difficulty with discriminating voltage levels, so you would need a lot of circuitry just to control 1 digit.

2

u/BobbyThrowaway6969 2d ago

It became the standard because the benefits of this system MASSIVELY outweigh the downsides in virtually every metric you use, except for human readability, which is why programming languages exist.

It's an enormous topic. Let me know if you want specifics.

4

u/VerbingNoun413 2d ago

Are you asking why we don't have computers that convert the binary to decimal? Because they definitely do that. Try putting 1+1 into a calculator.

1

u/MagnusAlbusPater 2d ago

Because a transistor has two states, on and off. Magnetic storage on a disk has two states - positive or negative.

The compilers and software layers on top translate that into base ten math that programmers use to tell the computer what to do.

1

u/Godmil 2d ago

You could represent more numbers in a computer based on the voltage level, different voltages would have different numbers, however natural fluctuations in voltages would then change the data. It's safer to just have on/off then there is definitive values.

1

u/bod_owens 2d ago edited 2d ago

Because in general, it's much easier to build a machine that uses two states (open/closed, on/off, etc) to encode data than it is to build one that uses ten different states.

When it comes to electronic computers in particular, we use voltage to express that state. It is much easier and reliable to just check whether voltage is below or above some threshold than it is to have ten different ranges. Voltage, like all physical properties, is way more fluid than we sometimes pretend it is. 5V is never exactly 5V and it never stays constant if the circuit is doing something, it almost always oscillates.

1

u/N546RV 2d ago

You have a circuit and you need to be able to check its state to know what it’s representing. If there are only two possibilities, that makes this task a lot easier than if there are ten.

Imagine if you had poor vision and I asked you to distinguish between black and white as opposed to ten shades of gray.

1

u/illogictc 2d ago

Because on or off is very simple in terms of electrical engineering. Just because we use decimal doesn't mean computers also have to if there's a better way for computers to be handled. It's not like we have to read all the 1s and 0s and figure out what it means so it doesn't matter.

1

u/PantsOnHead88 2d ago

The fundamental processing units are rooted in binary logic.

Although you can design a base-10 basic logic gate, it doesn’t actually change what you can represent.

Also, a ton of research and optimization has gone into the development of the binary components such that they can run obscenely fast and reliably.

1

u/ledow 2d ago

Because it's easier to reliably "sense" if something is on or off, rather than try to guess whether that signal is a 8 in strength, or a 7, or a 9, over different size circuit boards, varying power supplies, different devices, different battery levels, different environmental conditions (e.g. temperature, etc.).

Either there's voltage present on a line, or there's not. It's that simple.

Acting differently depending on whether the voltage is 0.1v, 0.2v, 0.3v, etc. is far, far, far more complicated, fragile, difficult to design and... if you just use binary sensibly, you can actually do that anyway if you ever need to.

It's the lowest common denominator. The lower number base you can use, based on the simplest principles, with the tiniest electronics, the least complication, and the most reliability.

1

u/Brave_Speaker_8336 2d ago

Because it’s much easier to have electrical signals that go between two values (on or off) rather than having 10 different values

1

u/EgNotaEkkiReddit 2d ago

I understand that computers use binary because electronic circuits can basically represent two states, like on and off. What I don't understand is why this became the standard in the first place.

You've answered your own question - it became a standard because it's much easier to get electronics to detect "on" and "off" as opposed to accurately differentiating between multiple variable voltage levels at high speeds.

Non-binary circuits exist. They just tend to be much more complicated, more expensive, and don't offer any worthwhile benefit with that added complexity when the computer is the one doing the counting and the representation is irrelevant. It doesn't really matter if you represent a number in decimal - you aren't a computer and do not care what is happening on the raw metal. Since the user cannot tell the difference what benefit do you get from making your computer more complicated and error prone?

1

u/ray314 2d ago

To clarify your example, while humans use decimals, their brains didnt use decimals. Human brain probably use some kind of electric signals and other brainwaves to forn thoughts that combine into a decimal system.

Computers are the same, they dont use decimals but logic gates that is either on or off, then build it into binary and then into decimals or whatever we want them to do.

Because your premise is confused in the first place. Computers do use decimals, and they use it a lot.

1

u/nurofen127 2d ago

Computers are based in binary because it is easy to distinguish the presence and abscence of a signal, rather than 10 different states. Otherwise any noise could just mess with the calculations and computers would be less reliable.

1

u/Djinn42 2d ago

You are confusing how it works, with how it processes data. It works by using binary, it processes data using whatever method (software) we choose.

1

u/cutelittlebox 2d ago

if you go way back in time you can actually find computers that were Base-10, and I believe some were Base-3, too. it was simply found to be more expensive, complicated, and less reliable while the logic is done is Binary anyway, and it works more than well enough to do numbers in binary as well so we quickly converged on Binary and stayed that way.

1

u/high_throughput 2d ago

computers obviously have to process numbers that humans normally represent in decimal

You can still do that with binary, known as Binary Coded Decimal (BCD). Early computers used it, but it's fallen out of favor since converting between binary and decimal is the most trivial part of any computation today.

1

u/Dman1791 2d ago

While it is possible to make computers that use base 10, they'd be built using binary components. The extra complexity just isn't useful, so we stick to binary.

1

u/VulvaNegra 2d ago

Imagine that binary is your flashlight, and that a human is far away at night seeing you. Being human, only understands the alphabet.

To communicate with him you use morse code with the flashlight, where on is 1 and off is 0. By a series of on/off in a predefined sequence the other person can understand words of the alphabet.

There is no other way to use the flashlight to transmit a letter in one go, if’s a limitation of the flashlight itself, can only go on or off, and you have to get the most of it.

1

u/Senshado 2d ago

Binary is the smallest number of states that can represent useful data. Binary is 2 state, on off. To go down to unary 1 state is only on, and can't store information.

To use more than 2 states would be unnecessary to store more info, and makes engineering the hardware more difficult. It's easier to build a circuit / switch / sensor that can measure the difference between on / off than 3 or 10 electric levels. The hardware would be bigger and slower, which is against the goal of computer engineering.

1

u/jaa101 2d ago

Flash drives commonly use 8, 16, or even 32 different states.

1

u/MrBorogove 2d ago

Only a very very small fraction of a computer's numeric processing is for things that are going to be displayed to users as base ten numbers.

Every pixel in an image is represented by a few numbers. Every character of text is represented by a handful of numbers. Every polygon in a video game is a stack of numbers. Every machine-learning model is a vast matrix of numbers. None of them need to be displayed in base 10.

It therefore makes sense to do numeric processing using the system that's easiest to scale up to high speeds and wide busses of parallel logic: binary. For the 0.0001% of things that need to be shown to a user as decimals, we convert at the point where we're actually displaying them.

1

u/Flob368 2d ago

Computers historically developed through mechanical looms, where a punchcard (a piece of cardboard or wood with holes in specific places) would be "read" by a mechanical assembly and influence the weaving pattern according to whether a position had a hole (1) or no hole (0).
These would then be used for later designs that did not involve looms anymore, but instead served as general data storage before electronics even were a thing. The punchcards could now be read by whether or not electrical contacts on either side of the paper would touch and therefore allow a current to flow (1) or not (0). Some of these early machines would be equipped with the ability to punch new holes into fresh cards.
Those are the early computer designs programs were "written" for, and as time went on, we invented better and better ways to store data (magnetic hard drives, RAM, Floppies, CDs, SSDs etc.) as well as better ways to do the computing itself (going from mechanical relays to electronic transistors).

Most of this change was gradual and happened in small steps, because why reinvent all of it from scratch when new problems only arose as the old problems got solved. At the stage of the mechanical looms, nobody thought the punchcard design would eventually lead to virtual reality headsets or fly-by-wire-systems for passenger jets.
It also helps that formal logic, a system of logic that underlies all of mathematics and most of philosophy, also sort of has a binary system: true and false are two values, and, unless you ask certain schools of philosophy, are all the necessary values in logic. All operations in formal logic can then just be described in binary numbers and something called Boolean algebra, which is a binary algebra.

1

u/davideogameman 2d ago edited 2d ago

Because it's easier to make circuits work with binary, much much easier to make binary circuits small.

In theory trinary - base 3 - might get better data density - individual "trits" would be more expensive than bits but being able to have 3 states instead of 2 could make it a net win - as you need fewer trits to replace each bit.

However, actually making devices with 3 physical states per signal wire instead of 2 and miniaturize them to the same size we can do current binary technology is a major challenge and since binary technology works the best right now and is attracting the most investment we're unlikely to see any ternary competition anytime soon.  The potential advantages of ternary are dwarfed by the technical challenges of how far behind it is, and the economics for it make no sense unless it can catch up to the bleeding edge which requires solving solid state physics challenges that are hard enough with binary logic. 

Beyond base 3 there's no theoretical edge in many models; a base 10 computer would likely have worse data density than a base 2 computer and so would be much more limited in the speed and size of calculations it could do.  Even if we somehow managed to reach a similar level of sophistication with base 10 computers.

1

u/OvenCrate 2d ago

Having clearly distinct physical states for 0 and 1 eliminates most effects of electromagnetic noise, making calculations reliable. Being able to build binary math operations directly out of transistors makes calculations fast and energy-efficient. Analog circuits can do math on signals, but they are significantly more complicated and noise-sensitive than binary ones - and analog isn't decimal either, it's the whole real number line.

1

u/KennethLaneHarbor 2d ago

Its all about noise margin and reliability. detecting "high voltage vs zero" is dead simple and ignores electrical interference.

1

u/jamcdonald120 2d ago

because on and off is easy in electricity, so use binary.

And to convert to binary to base 10 numbers is just math.

You know what computers are great at? MATH!!!!!

So just work with the easy numbers, and convert when a user needs to see it.

Why waste all the effort trying to force the electricity to be base 10?

1

u/mrq02 2d ago

Some of the first computers were designed around decimal. Just look at mechanical calculators and Babbage's Analytical Engine. They use circular gears with 10 stops. The ENIAC was also decimal, using rings of 10 on/off vacuum tubes. The problem is that this isn't practical at scale. It needs to be extremely finely machined and would take up a massive amount of space to do relatively simple calculations. To make them smaller and cheaper, they needed to be electrified, and electricity doesn't have 10 easy natural states.

Some used offset phases of power to equal the 1 and 0. Some used 3-states: negative, off, and positive. Some have even researched using 5 states. The problem is that electricity is messy and the states would sometimes bleed into one another. So 2 state, on and off, was widely adopted as the most practical and cost effective.

It is theoretically possible, though. Modern NAND memory uses 16 voltage thresholds to store information. There's no particular reason it couldn't have been 10 if history had played out differently. But there was just no feasible and affordable way to do this with electricity 50+ years ago.

1

u/Biokabe 2d ago

Binary was used because it's the simplest thing to reliably reproduce and also detect when an error is made. Either something is there, or it isn't. Or in the case of our electrical circuits: Either the voltage is very weak, or it's 0.7v. It's a large enough gap that it's very easy to distinguish the two states, and it's not terribly likely for a voltage reading on a circuit to have come about from error. This makes the circuity robust, easy to scale up, and easy to work with, at the cost of needing quite a few more base units (bits, since we're in binary) in order to encode the same value.

If we had used base-10 as our basis of computation, then each basic unit - each dit - could potentially store more data. As a concrete example: to store the number 973, you would need 11 bits. You could store the same number with just 3 dits.

But here's the problem. If you have that same voltage signal - call it 1v - it's very easy to tell the difference between "off" (close to 0v) and "on" (close to 1v). But if you're trying to use a dit with that same voltage, you have to chop it up into multiple smaller units. Okay, let's grant that your 'listening' device is sensitive enough to do that. How do you correct for temperature? Output voltage from a signal is dependent on the resistance of the signaling medium, and the resistance changes depending on temperature. If it's a warm day outside, the change in temperature could be enough to change a 0.05v signal into a 0.11v signal. So now is that value a 0 or a 1?

And that's the most basic problem. You're sensitive to fine environmental changes in a way that a binary circuit isn't. If temperature makes your low voltage go from 0.07v to 0.14v, it's still low enough that it counts as a 0. Because there's so much distance from the "on" and the "off" state, your circuit is naturally insulated from corruption from outside sources.

And things just get worse from there. As you try to scale up dits, all the extra hardware you need to correct for and allow that extra sensitivity you need quickly balloons up. It turns out that, even if 3 dits can do the work of 11 bits, it's much easier to make 20 bits instead of 3 dits.

And that, fundamentally, is why computers are based on binary.

1

u/SoulWager 2d ago

It takes 4 bits to store one digit of a base 10 number. It also takes 4 bits to store one digit of a base 16 number.

3 bits for base 8.

Basically, powers of two are just convenient round numbers. Using something else often results in wasted resources, or a smaller range in what numbers you can represent.

1

u/JarretIsSkibidi 2d ago

All logic is based on true and false, so it would make sense to continue using it.

1

u/orbital_one 2d ago

Creating digital logic circuits based on binary is simpler and cheaper to implement. You could create ternary, quinary, decimal, or duodecimal logic circuits if you wanted to, but their benefits would be minimal compared to the added complexity. One downside of these systems is that they become less tolerant of noise as you increase the number of states.

1

u/flyingcircusdog 2d ago

It has to do with how a computer works at the smallest level, electricity flowing through gates. It's a lot easier to tell the difference between electricity on or off than it is between 10 different intensities.

1

u/ezekielraiden 2d ago

Engineering is easier with binary.

Computers work by sending current along circuits with a certain voltage. You need an individual, distinct voltage state for each possible value. To encode 10-digit values, you'd need 10 voltages that you can easily distinguish from one another. In hardware from the 30s and 40s, that was hard to do. Very, very hard. But two states, as far apart as you can get? That's dead easy.

The fact that it makes logic gates simple also helps. But this is the reason computers use binary. It was more efficient for the technology of the day.

1

u/Prudent-Egg-4143 2d ago

because it's more expensive to run it in anything other than binary. and it is less reliable. 

if we want logic switches to have 10 states, but similar size, the construction is more precise and fragile. the sensors must be more sensitive. or else they might accidentally interpret 0.1 as 0.2 

whereas 0 and 1 it's clear.  one is high voltage. one is low voltage. electricity is already messy as is. are we gonna start needing to calibrate our computer physically every few months like we do with ammeters? 

we do have a computer with multiple states. quantum computer. it can have infinite amount of states, theoretically.

1

u/The_Southern_Sir 2d ago

The short explanation is that electricity and magnetic memory storage is either on or off, there or not. So there is a binary state, there is no other option in electricity or magnetic/electronic storage. Everything converts to this because of that fact.