Author Topic: Why binary is represented by two bits 0 and 1 and not three bits?  (Read 9516 times)

0 Members and 1 Guest are viewing this topic.

Offline tip.can19Topic starter

  • Contributor
  • Posts: 10
  • Country: ca
  • Researcher
I was wondering if digital systems work in binary 0 and 1, why is it so? Why not have 0, 1 and 2 (or some other constant/variable to make it three) and let three numbers represent a digital system?

Is there a specific reason behind this? Just curious.

Thank you,
Thanks
Tip
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3051
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #1 on: October 25, 2019, 08:55:00 am »
Google ternary computing (trits are usually represented -1, 0, 1).
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 
The following users thanked this post: tip.can19

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 8218
  • Country: nl
  • Current job: ATEX product design
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #2 on: October 25, 2019, 08:58:13 am »
On a very abstract level, digital system represents a bunch of switches. The switch is either on or off. It is the minimum number of states to represent any number. And it makes designing circuits easy.

What you describe is, for example fuzzy logic, where any variable can be 0, 1 or anything in-between. But if you are just learning electronics, learn basic digital, since it is the basis of every computer.
 
The following users thanked this post: tip.can19

Offline Raj

  • Frequent Contributor
  • **
  • Posts: 701
  • Country: in
  • Self taught, experimenter, noob(ish)
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #3 on: October 25, 2019, 09:04:17 am »
Cause it's easier that way.
it's harder to define your logic levels on multi logic level circuits. They did have analogue computers back in the days,mainly for ballistic measurements but they were disposed of asap due to digital being better.
 Btw cheap Solid state hard drives do store more than just on/off or 0/1 per cell, they are like 0/1/2/3 per cell. They do have additional circuitry next to the storage chip to convert them back into zeros/ones.
 
The following users thanked this post: tip.can19

Offline tip.can19Topic starter

  • Contributor
  • Posts: 10
  • Country: ca
  • Researcher
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #4 on: October 25, 2019, 09:20:43 am »
I just glanced this more and had a theory about it, maybe this might not be the exact case but just sharing. I will further research your suggestions and inputs. Thank you all.

A - It does not make sense to have a 3rd bit for some systems. For example a Geyser type electrical system with a two way switch or any threshold system. Having a threshold of say 180V 1A, anything below would be off and above would turn it on. So a third level will not make sense as it will lie on either side. anything <180V will be off and >180 will be on. This might be the case for many.

B - Like as @NANDBlog suggested it might be minimum and efficient to use 3 bits rather than a third variable in case system works on 3 levels like maybe a rotary fan with three levels. Here it needs some kind of third level from transistors which is less efficient than using two levels in two bits. Eg - 000, 001, 010 2 bits (0 and 1) better than 0 ,1 2 (two at 3rd level). I guess ternary is not preferred maybe because of this reason. Thanks @Sleemanj, I never explored that, will look into ternary systems.

@Raj, thanks for that. Is there any further resources on those? I suppose you are talking transistor level 0/1/2/3 per cell?
Thanks
Tip
 

Offline srce

  • Regular Contributor
  • *
  • Posts: 175
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #5 on: October 25, 2019, 09:27:49 am »
Trying thinking how you would create any sort of logic gate or arithmetic circuit that isn't based on binary. There's not a benefit to doing so.
 
The following users thanked this post: tip.can19

Offline tip.can19Topic starter

  • Contributor
  • Posts: 10
  • Country: ca
  • Researcher
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #6 on: October 25, 2019, 09:36:58 am »
My guess it might be possible from design level (not at least from the term binary), but like your suggestion including others, definitely there should not be any benefit.
Thanks
Tip
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21227
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #7 on: October 25, 2019, 09:53:46 am »
Trying thinking how you would create any sort of logic gate or arithmetic circuit that isn't based on binary.

Two-value Boolean logic is not the only type of logic.

For one practical example, look at how (professional) digital logic simulators represent signals, and why.

Quote
There's not a benefit to doing so.

Just because you can't see an advantage, doesn't mean there aren't any.

OTOH, the proof is more interesting, and leads to significantly deeper understanding.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: tip.can19

Offline Raj

  • Frequent Contributor
  • **
  • Posts: 701
  • Country: in
  • Self taught, experimenter, noob(ish)
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #8 on: October 25, 2019, 11:29:09 am »

@Raj, thanks for that. Is there any further resources on those? I suppose you are talking transistor level 0/1/2/3 per cell?

yup, can call it a transistor (https://en.wikipedia.org/wiki/Multi-level_cell)
 
The following users thanked this post: tip.can19

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #9 on: October 25, 2019, 04:43:52 pm »
Binary is more or less optimal for what it is.

It isn't hard to make digital circuits that support more voltage levels, or which represent state through other means (current, or charge, say).  But they do take up more transistors, and most important, they take more than 3/2 times as many.

So the amount of information gained per symbol, by using trinary rather than binary, is not larger than the number of transistors needed to implement it.

It is provable that higher number systems are less efficient.  Simply: while a number in say, base 10, requires fewer digits than in base 2 or 3, the number of bits required to implement each digit is large (~log(10)), so the system is inefficient.  If we formalize this, we get a solution for the most compact number system: it turns out this is base e; the digits are often called nits (natural bits).

e ~= 2.78 is very close to 3, so trinary is very attractive as a number system.  Given the implementation challenge, we use binary instead, but we can see it's still pretty efficient as number systems go.


So what about multi-level memory?  Memory doesn't need to perform logic, it just needs to remember state.  We can use much "larger" digits (more bits stored per cell), and resolve the logic levels around the periphery of the memory array.  Instead of N-ary logic for each cell, we only need it for sqrt(cells), say; a huge savings.

Tim
« Last Edit: October 25, 2019, 04:45:51 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: tip.can19

Offline Canis Dirus Leidy

  • Regular Contributor
  • *
  • Posts: 222
  • Country: ru
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #10 on: October 25, 2019, 05:17:52 pm »
I was wondering if digital systems work in binary 0 and 1, why is it so? Why not have 0, 1 and 2 (or some other constant/variable to make it three) and let three numbers represent a digital system?
You accidentally Setun. It was developed in the late fifties as an inexpensive minicomputer, so ferrite-diode cells (AKA magnetic amplifiers) were chosen as the element base (vacuum tubes were too unreliable, germanium transistors too expensive and scarce). And when studying the three-cycles shift register (base block of magnetic logic) schematic revealed that small changes in ferrite cores coupling circuits can provide possibility to parallel (but not simultaneous) transmission of two series of pulses. As a result, the machine used a balanced ternary system (-1, 0, 1).
 
The following users thanked this post: tip.can19

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #11 on: October 25, 2019, 08:04:13 pm »
It is provable that higher number systems are less efficient.  Simply: while a number in say, base 10, requires fewer digits than in base 2 or 3, the number of bits required to implement each digit is large (~log(10)), so the system is inefficient.  If we formalize this, we get a solution for the most compact number system: it turns out this is base e; the digits are often called nits (natural bits).

e ~= 2.78 is very close to 3, so trinary is very attractive as a number system.  Given the implementation challenge, we use binary instead, but we can see it's still pretty efficient as number systems go.

I remember reading an article about this analysis a long time ago.  The optimum number system, based on cost, was base 'e'.  I don't think I would care to work with such a system but if the compiler writers could implement C I guess it would work out fine.

Base two is simple because anybody can count to 1.

https://www.autodesk.com/products/eagle/blog/bob-widlar-life-engineering-legend/
 
The following users thanked this post: tip.can19

Offline Old Printer

  • Frequent Contributor
  • **
  • Posts: 796
  • Country: us
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #12 on: October 25, 2019, 08:21:26 pm »
Pioneer and Personality, that's a graceful way of putting it :)
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13157
  • Country: ch
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #13 on: October 25, 2019, 09:00:36 pm »
And I would add that there are situations where we use non-binary encodings for data, like in some types of data transmission (e.g. ADSL). But it's due to very specific constraints (like the frequency bandwidth of a standard copper phone line, in the case of DSL), where the complexity of nonbinary encodings is outweighed by the benefits.
 
The following users thanked this post: Siwastaja, tip.can19

Online Bud

  • Super Contributor
  • ***
  • Posts: 7276
  • Country: ca
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #14 on: October 25, 2019, 09:08:54 pm »
This is to meet political correctness requirement to include idiot people, because....
« Last Edit: October 25, 2019, 09:19:46 pm by Bud »
Facebook-free life and Rigol-free shack.
 

Offline tip.can19Topic starter

  • Contributor
  • Posts: 10
  • Country: ca
  • Researcher
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #15 on: October 26, 2019, 04:42:58 am »
Thank you! This is really good.
Thanks
Tip
 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1951
  • Country: us
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #16 on: October 26, 2019, 06:09:39 am »
A snarky answer to the question in the subject line is "Because the prefix 'bi' means 'two' and not 'three'".

In addition to the other answers given, there's this: A binary (two state) system is inherently more noise resistant. You can tolerate a lot of noise when there are only two valid signal levels. As you add more "legal" levels, noise is more likely to create false transitions. The end game of that is, of course, pure analog which has an infinite number of valid signal "levels" but is always, in every real-world system, plagued by some amount of noise. And while in an analog signal chain noise errors accumulate, a digital system with discrete levels can reproduce an original signal with zero degradation. In fact, a digital system can actually remove noise from a noisy signal (think Schmitt Triggers, to say nothing of error detecting and correcting encodation). All of these features are enhanced by having just two legitimate signal levels.
 
The following users thanked this post: Simon, tooki

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21227
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #17 on: October 26, 2019, 08:56:33 am »
A snarky answer to the question in the subject line is "Because the prefix 'bi' means 'two' and not 'three'".

In addition to the other answers given, there's this: A binary (two state) system is inherently more noise resistant. You can tolerate a lot of noise when there are only two valid signal levels. As you add more "legal" levels, noise is more likely to create false transitions. The end game of that is, of course, pure analog which has an infinite number of valid signal "levels" but is always, in every real-world system, plagued by some amount of noise. And while in an analog signal chain noise errors accumulate, a digital system with discrete levels can reproduce an original signal with zero degradation. In fact, a digital system can actually remove noise from a noisy signal (think Schmitt Triggers, to say nothing of error detecting and correcting encodation). All of these features are enhanced by having just two legitimate signal levels.

And with that we are getting closer to the fundamentals :)  Next step is to understand and apply Shannon's theorem.

N.B. Shannon's theorem isn't the be-all and end-all consideration; sometimes implementation technology characteristics are more important. But as the implementation technologies are refined over time, there is a tendency to approach the limits defined by Shannon's theorem.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: tooki

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #18 on: October 26, 2019, 09:07:56 am »
I like to explain from a different perspective.
Yes, the answer is that it is easier to represent values with simple switch on or off.
This was driven by the technology of the day.
The very first computers were build with valves. It is difficult to get them to store an 'analogue' or voltage but it was easy to get them to store an on or off.
So early computers developed binary computer system and the development carried on from there.
This is also true for transistors.

At the time of the first computers people did try different configurations. There is a true decimal computer, the Harwell Deckatron, which has true decimal memory - using decktron tube as memory.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 4135
  • Country: 00
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #19 on: October 26, 2019, 10:45:53 pm »
Why binary is represented by two bits 0 and 1 and not three bits?

Binary digit is represented by one bit. Not two. :)
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13157
  • Country: ch
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #20 on: October 27, 2019, 12:09:16 am »
I like to explain from a different perspective.
Yes, the answer is that it is easier to represent values with simple switch on or off.
This was driven by the technology of the day.
The very first computers were build with valves. It is difficult to get them to store an 'analogue' or voltage but it was easy to get them to store an on or off.
So early computers developed binary computer system and the development carried on from there.
This is also true for transistors.

At the time of the first computers people did try different configurations. There is a true decimal computer, the Harwell Deckatron, which has true decimal memory - using decktron tube as memory.
Some of the earliest computers were analog. I remember reading a quote in some very old computer book to the effect of “analog computers are faster, but digital computers are more accurate”.

Analog computers weren’t load-and-store, but rather programmed by rewiring. Actual operation was nearly instantaneous. Think of things like calculating projectile trajectories: the inputs go in via dials, and then the output is shown on analog meters. But the thing is configured for that one task only. Any change in the algorithm means rewiring. (Such computers have patch panels of jacks, via which the various functional groups are connected.)

Here’s a little tidbit for you: the reason the star of the analog electronics world, the op-amp, is called that is because it was invented for performing mathematical operations.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7198
  • Country: fi
    • My home page and email address
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #21 on: October 27, 2019, 12:41:44 am »
Bit is short for Binary Digit.  Each binary digit, or bit, has one of exactly two states, or values.
Trit is short for Ternary Digit.  Each trit has one of exactly three states, or values.
A B-base digit has exactly B states, or values.

An unsigned (nonnegative) integer value consisting of N digits d1,d2,..,dN of base B has value v,
$$v = \sum_{i=1}^{N} d_i B^{i-1}$$
Two is the smallest number of states you can use to represent unsigned integer values like this.  If you had only one possible state, the value they represent is always their count (i.e, the number of one-state elements you have); pretty useless.

Two is also the number of states you need to implement Boolean logic and Boolean algebra.  (It is the field of mathematics that among other things, tells you how you can transform one set of operations into another, often much easier and simpler one, when using Boolean or binary logic.)

In digital logic, there are several ways each binary digit can be represented.  The most common is by voltage; with one voltage range representing zero, and another one.  Voltages beyond those two ranges are undefined, i.e. they can be interpreted as either zero or one.

(Another extremely common method to represent the states is to use a voltage or current pulse, with the duration of the pulse describing the state: a short pulse describing one state, and a long pulse describing the other.  This is used to transfer a sequence or stream of digit states, rather than in computational logic, though.  This is because describing each state takes an agreed upon time.)

It turns out that if you use voltage levels to describe the two states, you can use transistors to implement all the operators needed in Boolean logic.  These constructs are called logic gates.

It is interesting to note that Leibniz realized as early as 1705 that using binary, one can combine logic and arithmetic (although the logic side took another 150 years to be formalized into Boolean logic by Boole in 1854).  If you look above in this message, you'll see how multiple binary digits can be organized to describe nonnegative numbers -- signed numbers and rational numbers are a simple extension of that --; and digital logic gates suffice to implement all mathematical operations on them; that's the beauty here.

Setun mentioned by Canis Dirus Leidy was a ternary computer originally developed in 1958 at Moscow University.  It used balanced ternary for the numerical operations, and ternary logic instead of Boolean logic.  (A ternary-emulating programming language, DSSP, with Forth-like syntax, still exists today, but I know nothing about it.)

In some ways, ternary is better than binary.  The main downside in ternary logic compared to binary/Boolean logic is added complexity.  In binary/Boolean logic, there are only 4 unary operators (functions that operate on a single binary value) and 16 distinct binary operators (functions that operate on two binary values); in ternary logic, there are 27 unary operators and 19683 distinct binary operators.  We know well the logic gates needed for the binary/Boolean logic, but a large "space" of the possible ternary logic gates have not been studied much yet (and a lot of existing research has not been translated from Russian).  It is quite possible there is some undiscovered beauty there that allows a significant leap forwards in terms of engineering and efficiency, but we really don't know yet; binary has at least a full century more of mathematical and logical research behind it, and currently, interest in ternary logic is quite low.

Personally, I haven't used ternary (except when describing some combinatoric solutions with three-valued components), but I suspect the inherent complexity in ternary logic has made them the "quaternions" of logic: disliked/rejected for their perceived complexity.  (If you have ever used Euler angles or Tait-Bryan or Cardan angles in three dimensions, you've almost certainly done work that you could have avoided by using unit quaternions -- also known as versors.)
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #22 on: October 27, 2019, 07:20:17 am »
A binary digit is represented by one bit. Not two. :)

A decimal digit is represented by 3.321928095 bits  :)
« Last Edit: October 27, 2019, 06:39:51 pm by GeorgeOfTheJungle »
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21227
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #23 on: October 27, 2019, 08:52:49 am »
I like to explain from a different perspective.
Yes, the answer is that it is easier to represent values with simple switch on or off.
This was driven by the technology of the day.
The very first computers were build with valves. It is difficult to get them to store an 'analogue' or voltage but it was easy to get them to store an on or off.
So early computers developed binary computer system and the development carried on from there.
This is also true for transistors.

At the time of the first computers people did try different configurations. There is a true decimal computer, the Harwell Deckatron, which has true decimal memory - using decktron tube as memory.
Some of the earliest computers were analog. I remember reading a quote in some very old computer book to the effect of “analog computers are faster, but digital computers are more accurate”.

Analog computers weren’t load-and-store, but rather programmed by rewiring. Actual operation was nearly instantaneous. Think of things like calculating projectile trajectories: the inputs go in via dials, and then the output is shown on analog meters. But the thing is configured for that one task only. Any change in the algorithm means rewiring. (Such computers have patch panels of jacks, via which the various functional groups are connected.)

Here’s a little tidbit for you: the reason the star of the analog electronics world, the op-amp, is called that is because it was invented for performing mathematical operations.

Analogue computers work by solving differential equations.

Electronic analogue computers use opamps to integrate, add, and multiply.

Mechanical analogue computers use cogs, wheels, motors, wires.

There were general purpose mechanical analogue computers; see Vannevar Bush's pre WW2 (and pre Memex) work.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: tooki

Offline Canis Dirus Leidy

  • Regular Contributor
  • *
  • Posts: 222
  • Country: ru
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #24 on: October 27, 2019, 09:02:49 am »
Analogue computers work by solving differential equations.
Electronic analogue computers use opamps to integrate, add, and multiply.
Mechanical analogue computers use cogs, wheels, motors, wires.
And real programmers use water: https://en.wikipedia.org/wiki/Water_integrator :)
 
The following users thanked this post: iMo


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf