Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Wikipedia:Reference desk/Archives/Computing/2026 June 7

From Wikipedia, the free encyclopedia
Computing desk
< June 6 << May | June | Jul >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


June 7

[edit]

Similarities between coding on the Internet and editing wikis

[edit]

Why do computers still use binary?

[edit]

Modern computers are incredibly powerful and can perform trillions of operations per second. Given this, why do computers still fundamentally use binary (0s and 1s) rather than a more complex numbering system such as decimal (base 10) or ternary (base 3)? What advantages does binary provide in electronic hardware design? ArcadeFair (talk) 07:36, 7 June 2026 (UTC)reply

It's a matter of practicality. Binary transistors and storage medium are profoundly easy to make - you just have to define 2 different states for them, which happens to be a perfect fit for electric circuitry - on and off. And since we can chain multiple binary bits together to represent any other base, from base-16 (4bit) to base-16777216 (24bit, you can go crazy with increasing bits here), we just hold a decimal value inside 4 binary transistors (with state 11-16 being either naively ignored, or utilized by making every character base-16) instead of trying to make 1 single transistors with 10 different states. 海盐沙冰 / aka irisChronomia / Talk 08:03, 7 June 2026 (UTC)reply
tl;dr: imagine a binary switch; then imagine four of the same switches, one next to another.
then, imagine a switch with 10 possible states. that would be much, much more expensive to make; it'll also be much easier to break than four binary switches. if a binary switch gets clunky, and it can't stay perfectly stable at some peculiar angle, it doesn't matter - you only care if it's up or down, and being "not close to perfect up position enough" doesn't bother you at all: as long as it's still on the same side, no information is lost.
now imagine a 10-state switch shifting its angle for some 30 degrees. that'll be much worse, because now it's probably going from one state to another, and you lose the information held in that switch in the process. 海盐沙冰 / aka irisChronomia / Talk 08:11, 7 June 2026 (UTC)reply
Also note that many algorithms are much simpler when working with binary numbers, e.g. multiplication or addition. You have much fewer cases to consider. It may seem simpler to do in in decimal, but that is just because we are used to it. There are 9+8+7+6+5+4+2+1 ways to create an underflow when subtracting two decimal digits, with 9 different possible underflows. There is just one way (0-1) to create one when subtracting binary digits. And so on. --Stephan Schulz (talk) 22:55, 7 June 2026 (UTC)reply
There are other practicality concerns for non-binarynot a gender noun[Humor] systems. Let's use base-10 as an example here.
Say if you want to store a bunch of Yes/No values (aka. booleans). We can dumbify our hyper-futuristic 10-state transistor into a lame, binary one, by only defining two meaningful states, such as "state 0-4 for No, and 5-9 for Yes".
We can also pay some respect to the true potential of this engineering miracle by holding 3 different Yes/No values in it simultaneously. For example, we may define state 0 to state 9 as follows:
0 NNN 4 YYN
1 YNN 5 YNY
2 NYN 6 NYY
3 NNY 7 YYY
With the state 8 and 9 left unused.
This creates another problem: in order to use the decimal transistors to its full potential, you need to do operations (read/store/compute) on booleans in batches of 3, and also have to create some complex logic for the computer to be able to treat a decimal as if it were 3 booleans fused together (and to do it efficiently). This likely has devastating implications on how computer codes are written and optimized, and the inefficiency of said computer when running unoptimized codes. I know this last sentence requires some explaining, but I struggle to formulate my thoughts on this here for now. If someone'd like to pickup for me, I'd start with the example / comparisons to Netburst and VLIW. 4:43p, edited 5:24p (+8) 海盐沙冰 / aka irisChronomia / Talk 08:43, 7 June 2026 (UTC)reply
Related articles: decimal computer and ternary computer and perhaps unconventional computing. Matt Deres (talk) 21:25, 7 June 2026 (UTC)reply
As explained or implied above, implementing the arithmetic operations in "decimal logic" instead of binary would use up more space and energy. But, furthermore, this would not even result in faster operation.  ‑‑Lambiam 13:46, 8 June 2026 (UTC)reply
Ternary would probably use a little less but it is hardly worthwhile for the bother, binary is so much simpler. If you're willing to spend some money you can get yourself an IBM mainframe which implements decimal packed and floating point arithmetic. Just what COBOL programmers want ;-) Many early machines used decimal but it has just worked out cheaper and more convenient to use binary so they won out financially. It wasn't just the arithmetic - for instance the Singer System Ten machines had decimal memory addressing as well but it was implemented by ignoring 24 lines in every 1024. NadVolum (talk) 14:35, 8 June 2026 (UTC)reply
Engineering tradeoffs, isn't it? :)
Reminds me of the No free lunch theorem; it states that one can never gain any efficiency in one use case without losing efficiency in some others. Processor design is basically the art of identifying your chip's use cases and then... pile all the lunch onto them.
A funny thought passed my mind: running CPU codes with GPGPU and place indirect jumps all over it, then realizing this is exactly how a Raspberry Pi 4 bootstraps. 海盐沙冰 / aka irisChronomia / Talk 17:11, 8 June 2026 (UTC)reply
Thanks, that's a clever reuse of bits of the chip! I'm quite impressed and vaguely worried about what other tricks they've used 😀NadVolum (talk) 06:56, 9 June 2026 (UTC)reply
Working in binary internally is simpler, faster, and cheaper. Only a very few of the results of calculations made in almost all applications will ever be shown to the user anyway, making it simpler to convert the internal binary to decimal when it is needed to display the result. AndyTheGrump (talk) 23:36, 9 June 2026 (UTC)reply
There are places in modern computer systems that do indeed use different "bases" for better efficiency in communication or storage, where an earlier version of the same technology used binary. For example, flash memory with multi-level cells that store N bits by charging the cell to one of 2^N voltage levels, or 1000BASE-T Ethernet that uses five distinct voltage levels. Adam Sampson (talk) 23:25, 9 June 2026 (UTC)reply
I was thinking about MLCs previously when writing, and think it's a interesting example of "specific implementations that are storing binary data despite not being binary in its fundamental level". It actually feels like the decimal transistor thing, instead we're having base-16 cells for 4-bit MLCs.
I hope we can have an article or subsection on SLC-mode caches; don't know if there'd be enough stuff to cite, though. 海盐沙冰 / aka irisChronomia / Talk 23:28, 9 June 2026 (UTC)reply
I don't see anything about visible record computers on Wikipedia. Basically systems using punch cards and drums which worked in decimal for small businesses. I think some early sci-fi films have them producing the results of queries for 'hi tech' agencies ;-) The title of this discussion is a bit wrong - Zuse machines used binary from the start but any business machines used decimal. NadVolum (talk) 06:53, 11 June 2026 (UTC)reply