Author Topic: Why binary is represented by two bits 0 and 1 and not three bits?  (Read 7862 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: 3028
  • 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: 7407
  • 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: 694
  • 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: 19611
  • 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: 694
  • 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

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21728
  • 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: 214
  • 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: 9892
  • 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: 747
  • 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: 11622
  • 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

Offline Bud

  • Super Contributor
  • ***
  • Posts: 6927
  • 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: 1926
  • 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: 19611
  • 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.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3430
  • Country: ua
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: 11622
  • 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: 6295
  • 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: 19611
  • 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: 214
  • 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

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #25 on: October 27, 2019, 09:41:07 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 :)

And real electronic engineers use gas for their logic circuits: https://www.symscape.com/blog/fluidic-logic

I once had a job assessing whether to replace fluidic logic with a microprocessor; I recommended against it.

The logic was on unmanned offshore oil rigs with zero electricity for safety reasons. Adding electricity was possible but had no advantages and many disadvantages.
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 tooki

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: ch
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #26 on: October 27, 2019, 05:56:35 pm »
I think the take-home message here is that often, when people ask "why is x always done like this?" or "why don't we do x [some unusual way]?", they are blithely unaware that all the other ways typically have been tried before, and the reason x became the dominant way is because it has clear advantages.

Ideas aren't nearly as unique and special as people think they are. It's implementations that are difficult!
 

Offline konzill

  • Newbie
  • Posts: 7
  • Country: au
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #27 on: October 27, 2019, 07:50:56 pm »
Looking at the Wikipedia page on trinary logic, it turns out that there isn't even a consensus on how to build a trinary truth table. The page lists half a dozen different trinary logic systems. So yes it goes back to, its rarely done because it adds complexity. 

Even at a basic level having to differentiate three voltage levels, instead of two would make a circuit more suceptable to noise.
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #28 on: October 27, 2019, 09:15:41 pm »
@tip.can19 - Binary and it's associated Boolean logic also fits our statefull view of the world; states such as yes-no, up-down, on-off, in-out, high-low, push-pull, mark-space, set-reset, left-right, true-false. Alternate states like whatever, dunno and Brexit, don't work when making decisions as they are not finite states.

Being caught between finite states is being in the noise. A transition between two finite states is the hysteresis. In digital, this is the rate of change of voltage to what is regarded as a stable logic 0 or 1. Real-world, this might involve the thinking time about which shirt to wear on a date; the flowery one or the clean one?

Geek out on Boolean algebra https://en.wikipedia.org/wiki/Boolean_algebra
Geek out on Hysteresis https://en.wikipedia.org/wiki/Hysteresis
Geek out on the Finite State Machine https://en.wikipedia.org/wiki/Finite-state_machine

P.S. Thinking about this, in data analysis, it is possible for an outcome to have three states; an outcome can be none, one or many. I believe this none/one/many concept was created by Australian Aboriginal people tens of thousands of years ago. Clever dudes.

« Last Edit: October 27, 2019, 09:19:44 pm by Syntax Error »
 

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #29 on: October 27, 2019, 11:07:45 pm »
Why binary not ternary.. I suppose one interesting reason is that all widely used number systems are even based, 2,8,10,16,60.
« Last Edit: October 27, 2019, 11:11:27 pm by Vtile »
 
The following users thanked this post: BrianHG

Offline Canis Dirus Leidy

  • Regular Contributor
  • *
  • Posts: 214
  • Country: ru
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #30 on: October 28, 2019, 05:24:47 am »
And real programmers use water: https://en.wikipedia.org/wiki/Water_integrator :)
And real electronic engineers use gas for their logic circuits: https://www.symscape.com/blog/fluidic-logic
Русские физики выбирают Slackware АВК-6!

(The most remarkable thing is that this is a page from an advertising catalog of consumer products).
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #31 on: October 28, 2019, 08:24:51 am »
@tip.can19 - Binary and it's associated Boolean logic also fits our statefull view of the world; states such as yes-no, up-down, on-off, in-out, high-low, push-pull, mark-space, set-reset, left-right, true-false. Alternate states like whatever, dunno and Brexit, don't work when making decisions as they are not finite states.

Not true. The value of a state is usually not binary, and in any case is orthogonal to the mechanism used to implement it.

A very simple example might be the state of an electrically opened door with possible states {open, closed, opening, closing, broken}.

I can't be bothered to point out the flaws in your other points.
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
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4074
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #32 on: October 28, 2019, 08:26:09 am »
Almost all information can be recorded as a serious of Yes, No answers to questions.  As long as you keep the questions and the answers that information can be reconstructed.

Although, be careful, when you look at the analogue side of digital circuits they are very often tri-state.  1, 0 and floating.  The later is sometimes a burden, but sometimes can be used to your advantage.  You might have a chip which has a 0 or a 1 (high or low) on it's outputs, but when you pull the "chip enable" low they disconnect the the outputs which gives you a third state which you can pull high or low with a resistor for your purposes.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #33 on: October 28, 2019, 08:44:23 am »
Although, be careful, when you look at the analogue side of digital circuits they are very often tri-state.  1, 0 and floating.  The later is sometimes a burden, but sometimes can be used to your advantage.  You might have a chip which has a 0 or a 1 (high or low) on it's outputs, but when you pull the "chip enable" low they disconnect the the outputs which gives you a third state which you can pull high or low with a resistor for your purposes.

All "digital" circuits are actually analogue; that's most obvious with ECL and derivatives. Some CMOS logic gates can be used as linear amplifiers.

Logic gates interpret input voltages/currents as digital signals. When those inputs are within defined limits, the gate's outputs will (eventually) be within limits that other gates can interpret as a digital signal.

The few digital circuits that you might encounter include photon counting devices and femtoamp circuits.
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 Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #34 on: October 28, 2019, 09:56:17 am »

Not true.
...
I can't be bothered to point out the flaws in your other points.

In binary logic the door has an exclusive true state for IsClosing or IsOpening and then, a true state for IsClosed or IsOpen. And only if HasFailed is false (not true). You might need to know the open angle, but that's not a state, it's a property.

 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4074
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #35 on: October 28, 2019, 10:05:49 am »
Quote
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".

As a paraglider pilot from a windy country, the bigger the span the more likely you'll be dragged like a rag doll up the hill :)  Kite surfers tell me they have a 9m2 wing... mine is 29m2 and in a 15mph wind, in it's power zone will pull a family car.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #36 on: October 28, 2019, 10:12:25 am »

Not true.
...
I can't be bothered to point out the flaws in your other points.

In binary logic the door has an exclusive true state for IsClosing or IsOpening and then, a true state for IsClosed or IsOpen. And only if HasFailed is false (not true). You might need to know the open angle, but that's not a state, it's a property.

False, in every respect.

Your FSM might have that and the states might be encoded in that way, and such an FSM might work in your case. But that's all.

You should start by understanding the various at the low-level techniques used to implement the state in an FSM, e.g. https://www.allaboutcircuits.com/technical-articles/encoding-the-states-of-a-finite-state-machine-vhdl/

You should continue by understanding the concepts of how to design and express FSMs in a technology independent way. Clearly FSMs can be implemented in hardware, software or frequently in a combination of the two. Harel's StateCharts have become popular in the last 30 years http://www.inf.ed.ac.uk/teaching/courses/seoc/2005_2006/resources/statecharts.pdf but there are many other formalisms.
« Last Edit: October 28, 2019, 10:21:11 am by tggzzz »
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
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7789
  • Country: ca
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #37 on: October 28, 2019, 10:17:38 am »
Why binary not ternary.. I suppose one interesting reason is that all widely used number systems are even based, 2,8,10,16,60.
That's only after the invention of '0'.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #38 on: October 28, 2019, 10:19:11 am »
Quote
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".

As a paraglider pilot from a windy country, the bigger the span the more likely you'll be dragged like a rag doll up the hill :)  Kite surfers tell me they have a 9m2 wing... mine is 29m2 and in a 15mph wind, in it's power zone will pull a family car.

Yeah, but you can't go at 150kt, nor up to 37k ft (intentionally at least!), and there is the noticable possibility that the oversized handkerchief might collapse. Me biassed? Shurely shome mishtake.

(In the absence of hills, I was towed aloft under a 'chute behind a car on an airfield a couple of times, and have landed in a light aircraft 1/7 of the times I took off in one :) )
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
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4074
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #39 on: October 28, 2019, 11:04:48 am »
Quote
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".

As a paraglider pilot from a windy country, the bigger the span the more likely you'll be dragged like a rag doll up the hill :)  Kite surfers tell me they have a 9m2 wing... mine is 29m2 and in a 15mph wind, in it's power zone will pull a family car.

Yeah, but you can't go at 150kt, nor up to 37k ft (intentionally at least!), and there is the noticable possibility that the oversized handkerchief might collapse. Me biassed? Shurely shome mishtake.

(In the absence of hills, I was towed aloft under a 'chute behind a car on an airfield a couple of times, and have landed in a light aircraft 1/7 of the times I took off in one :) )

LOL.  Unfortunately paraglider pilots have found themselves up there before.  Found unconscious, hypoxic and covered in hail storm bruises, but alive.

I suppose the only advantage I have is that I can carry my glider to the top of the hill and launch and don't need a trailer to get it out of a farmers field :P  Who needs to go faster than 25knots anyway, it's much easier staying in small thermals when you can orbit inside 10 meters :)
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #40 on: October 28, 2019, 11:21:21 am »
Quote
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".

As a paraglider pilot from a windy country, the bigger the span the more likely you'll be dragged like a rag doll up the hill :)  Kite surfers tell me they have a 9m2 wing... mine is 29m2 and in a 15mph wind, in it's power zone will pull a family car.

Yeah, but you can't go at 150kt, nor up to 37k ft (intentionally at least!), and there is the noticable possibility that the oversized handkerchief might collapse. Me biassed? Shurely shome mishtake.

(In the absence of hills, I was towed aloft under a 'chute behind a car on an airfield a couple of times, and have landed in a light aircraft 1/7 of the times I took off in one :) )

LOL.  Unfortunately paraglider pilots have found themselves up there before.  Found unconscious, hypoxic and covered in hail storm bruises, but alive.

Nasty. I suppose the hypothermia partially offset the effects of hypoxia.

I do remember a report of a competition in the Phillipines(?) where about 40 competitors were carried up by a cumulonimbus and turned into corpsicles.

But competitors always push the envelope (ho ho), and long may it remain so. ISTR that about 10% of the top glider pilots have died in competitions.

Quote
I suppose the only advantage I have is that I can carry my glider to the top of the hill and launch and don't need a trailer to get it out of a farmers field :P  Who needs to go faster than 25knots anyway, it's much easier staying in small thermals when you can orbit inside 10 meters :)

Oooh, picky picky picky :)

I've flown (just) solo at 29kt, and tandem at about 20kt in an old "barge" trainer. I've also watched the latter loop with a noticeably small radius; must have scared the bejasus out of the woodworm :)

More entertainingly, I've been in a updraft (can't have been a thermal with unbroken stratus at 3k4ft), at 10kt up, banking at 70degrees, pulling 3G for a minute or so until cloudbase. We kept an eye on the other glider at the same height by looking upwards at the top of his head :) That was a new experience for an instructor that had been instructing for half a century.
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
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4074
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #41 on: October 28, 2019, 01:11:28 pm »
3k4ft), at 10kt up, banking at 70degrees, pulling 3G for a minute or so until cloudbase. We kept an eye on the other glider at the same height by looking upwards at the top of his head :) That was a new experience for an instructor that had been instructing for half a century.

Only an electronics engineer would report 3400ft as 3k4ft :)

I'm fairly green and to be honest I haven't been doing it for a few years, but my first experience of a proper thermal under my hanky really freaked me.  The lines stretched, pinged and sung, I was pinned down into the seat, vario screaming faster and higher pitched beeping, I could visibly see the hill in front of me drop away...  then I shot straight through it and the instructor was like "Turn Paul, Turn, you gotta turn in lift."  I was like, "F... that, I'm going back into that beast.", the vario measured 3m/s vertical peak.  Just a little hill side thermal, but a fun ride.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #42 on: October 28, 2019, 01:35:52 pm »
From yet another perspective: many fast algorithms are based on two-way branching (e.g. binary search) and these can often be implemented more efficiently with binary number arithmetic.  See e.g. https://en.wikipedia.org/wiki/CORDIC  (often used in FPGA implementations).
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 835
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #43 on: October 28, 2019, 07:40:37 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?

Is there a specific reason behind this? Just curious.

Thank you,

One way you might be able to understand would be to look at the construction of a binary adder circuit, and then compare it to a circuit that could add various other levels or values of voltages or signals, and compare the complexity.

Its very easy to add and subtract in binary (and in relation to binary only having two states, the key is "bi" which means "two") with minimal circuitry. Once you can add and subtract you can also, with some repetition, multiply and divide quite easily too.

You might also take a look at Ben Eater on YouTube. He has a series where he builds a small "CPU" out of logic chips, of which part is an ALU. He goes in to some detail about how various functions in an ALU work.

Analogue computers were available, and Dave has a video about opamps with some information about how they can be used to do certain functions like add or multiply. But, there is usually always a reason one technology surpasses all others that do the same job - and its usually always lower cost. And you dont normally get lower cost from more complex things.
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7963
  • Country: us
  • Retired, now restoring antique test equipment
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #44 on: October 28, 2019, 08:00:07 pm »
Although, be careful, when you look at the analogue side of digital circuits they are very often tri-state.  1, 0 and floating.  The later is sometimes a burden, but sometimes can be used to your advantage.  You might have a chip which has a 0 or a 1 (high or low) on it's outputs, but when you pull the "chip enable" low they disconnect the the outputs which gives you a third state which you can pull high or low with a resistor for your purposes.

All "digital" circuits are actually analogue; that's most obvious with ECL and derivatives. Some CMOS logic gates can be used as linear amplifiers.

Logic gates interpret input voltages/currents as digital signals. When those inputs are within defined limits, the gate's outputs will (eventually) be within limits that other gates can interpret as a digital signal.

The few digital circuits that you might encounter include photon counting devices and femtoamp circuits.

Relay logic uses truly discrete binary signals
 

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #45 on: October 28, 2019, 08:11:55 pm »
Trits? Qbits it where it's at  ;)
 

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #46 on: October 28, 2019, 08:28:41 pm »
Why binary not ternary.. I suppose one interesting reason is that all widely used number systems are even based, 2,8,10,16,60.
That's only after the invention of '0'.
Do you refer zero as logical or numerical operator or both.  :wtf:
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #47 on: October 28, 2019, 08:30:00 pm »
Although, be careful, when you look at the analogue side of digital circuits they are very often tri-state.  1, 0 and floating.  The later is sometimes a burden, but sometimes can be used to your advantage.  You might have a chip which has a 0 or a 1 (high or low) on it's outputs, but when you pull the "chip enable" low they disconnect the the outputs which gives you a third state which you can pull high or low with a resistor for your purposes.

All "digital" circuits are actually analogue; that's most obvious with ECL and derivatives. Some CMOS logic gates can be used as linear amplifiers.

Logic gates interpret input voltages/currents as digital signals. When those inputs are within defined limits, the gate's outputs will (eventually) be within limits that other gates can interpret as a digital signal.

The few digital circuits that you might encounter include photon counting devices and femtoamp circuits.

Relay logic uses truly discrete binary signals

No.

You are halfway there but your are conflating/equating digital signals with the analogue variables (voltage/current) used to represent digital signals.

Consider, for example, that if the current is marginally less than the latch in (or hold) currents, the relay will not reliably be in the expected state.
« Last Edit: October 28, 2019, 08:32:55 pm by tggzzz »
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

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21728
  • 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 #48 on: October 29, 2019, 01:11:57 am »
Or even worse, what if a relay starts chattering, or a contact starts arcing at a rate faster than subsequent coils can respond?  How could those conditions possibly be expressed purely in relay logic states? :)

Everything is fundamentally analog, because the flow of charge and electromagnetic fields are continuous and not quantized (at least, not to any degree we care about, and even then, not in nearly the same way).

I'll add this just because it's a common retort -- shot noise proves the electric charge is quantized as electrons, but it doesn't mean charge or current is quantized in bulk.  If I move a charged comb around sufficiently slowly, I will affect the field in its vicinity by less than an electron's worth of charge -- when charges are able to move freely, there is no shot noise (or not as much), and so it is perfectly meaningful to speak of continuum charge.

(I would make similar arguments regarding quantum mechanics as well, but I doubt it would be very productive to do so.)

Tim
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: tooki

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #49 on: October 29, 2019, 08:06:04 am »
Or even worse, what if a relay starts chattering, or a contact starts arcing at a rate faster than subsequent coils can respond?  How could those conditions possibly be expressed purely in relay logic states? :)

Indeed. I considered mentioning that, but thought it an unnecessarily "complex" version of the simpler point.

I also considered mentioning metastability :)

Quote
Everything is fundamentally analog, because the flow of charge and electromagnetic fields are continuous and not quantized (at least, not to any degree we care about, and even then, not in nearly the same way).

Photon counting applications with, say, an APD?

Sure the pulse out of an APD is analogue, but the photon signal is digital.

Quote
I'll add this just because it's a common retort -- shot noise proves the electric charge is quantized as electrons, but it doesn't mean charge or current is quantized in bulk.  If I move a charged comb around sufficiently slowly, I will affect the field in its vicinity by less than an electron's worth of charge -- when charges are able to move freely, there is no shot noise (or not as much), and so it is perfectly meaningful to speak of continuum charge.

It looks like you are conflating "electric field" with "charge". Analogy: if I have a 1kg weight on a balanced lever, moving the pivot changes the counterbalancing force by less than (or more than) 1kg.
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
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1224
  • Country: pl
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #50 on: October 29, 2019, 09:06:13 am »
IDEngineer has given the first half of the answer. The second is: the Boolean algebra with related concepts. While the Boolean algebra was not getting much attention before second quarter of 20th century, it was quickly recognized as a perfect tool for the job. It is deeply connected with prepositional logic, finds its place in multiple branches of mathematics, uses a tiny number of elements in implementation(1), allows super easy synthesis of circuits.(2)(3) and everyone knew how to prove the circuits to be right.

Trivia: there also were negabinary computers. Anecdotal story is that the guys misunderstood a joke and implemented the machine, approaching the subject with complete seriousness. :D

____
(1) Any expression can be represented with only NANDs or only NORs, in the past also only a set of AND/OR/NOT gates. Each of those are trivial and robust circuits.
(2) E.g. De Morgan’s law quickly turns any messy expression into simple, conventional form of OR-of-ANDs or AND-of-ORs, which is a circuit consisting of at most 3 layers of digital gates (optional NOTs, a bunch of ANDs, a single multi-input OR).
(3) Historically Karnaugh maps have been used, and those can be solved by children in kindergarten.
« Last Edit: October 29, 2019, 09:11:04 am by golden_labels »
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4074
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #51 on: October 29, 2019, 09:25:04 am »
Any expression can be represented with only NANDs

In uni we were given an assignment to build a logic circuit to run a 7 segment display from a 4 bit binary bus input.  We were only allowed to use NAND gates.  Was quite challenging and quite interesting to do.  Think it ended up being about 50 gates.

These days you just google it.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #52 on: October 29, 2019, 09:37:28 am »
IDEngineer has given the first half of the answer. The second is: the Boolean algebra with related concepts. While the Boolean algebra was not getting much attention before second quarter of 20th century, it was quickly recognized as a perfect tool for the job. It is deeply connected with prepositional logic, finds its place in multiple branches of mathematics, uses a tiny number of elements in implementation(1), allows super easy synthesis of circuits.(2)(3) and everyone knew how to prove the circuits to be right.

Trivia: there also were negabinary computers. Anecdotal story is that the guys misunderstood a joke and implemented the machine, approaching the subject with complete seriousness. :D

____
(1) Any expression can be represented with only NANDs or only NORs, in the past also only a set of AND/OR/NOT gates. Each of those are trivial and robust circuits.
(2) E.g. De Morgan’s law quickly turns any messy expression into simple, conventional form of OR-of-ANDs or AND-of-ORs, which is a circuit consisting of at most 3 layers of digital gates (optional NOTs, a bunch of ANDs, a single multi-input OR).
(3) Historically Karnaugh maps have been used, and those can be solved by children in kindergarten.

That's too simplistic. The key is in the phrase in your footnote: "robust circuits", even if they weren't trivial.

For the first quarter century of logic-based machines, up until the 60s, active devices were very expensive (cost, power, volume) and could only be used very sparingly. To illustrate that, some commercially important general purpose computers were serial machines, i.e. the data paths were one bit wide.

So why weren't semi-analogue techniques (e.g. dividing by 10 with three active devices) used more frequently?

Shannon's theorm provides a big clue.
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
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5048
  • Country: ro
  • .
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #53 on: October 29, 2019, 12:07:31 pm »
because i didn't see someone else linking to them





 

Offline wraper

  • Supporter
  • ****
  • Posts: 16885
  • Country: lv
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #54 on: October 29, 2019, 12:17:14 pm »
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.
Almost all SSD. Even expensive industrial stuff is usually MLC, nowadays often even TLC. Cheap stuff is QLC with 4 bits per cell (16 voltage levels). SLC (1 bit per cell) is very niche nowadays.
Quote
They do have additional circuitry next to the storage chip to convert them back into zeros/ones.
:palm: ALL SSD have controller chip. And it does not convert anything. NAND flash chip outputs binary data.
 
The following users thanked this post: tooki

Offline TheUnnamedNewbie

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #55 on: October 29, 2019, 12:23:16 pm »
There has actually been some revival in multi-level logic recently. With the excess SNR we often see in digital circuits, you could say that you are wasting potential intermediate levels.

Sure, the gates become more complicated, but I don't think that is such a big issue - after all, I think few digital designers still manually do the gates, this is all for the logic synthesis tool to deal with (so you just make the logic synth 'smarter' and nobody has to know about any of this).

I don't think Shannon's theorems provide a big clue - if anything, they really do make you wonder 'why not?'. Just look at the PAM4 digital stuff coming to high-speed interconnects - 112 gigabit/s with very low error rates. And sometimes errors are actually acceptable - think neural nets or signal processing, where there is already a error band on the signal anyways. Does a tiny additional error form an issue here? I've already seen examples of this being used on DFEs in communication systems where you have multi-level data (EG, QAM 16 which has 2 4-level streams) and where using 4-level logic provided very elegant and low-power filtering.

I would not be surprised if multi-level computation is more common-place in the future.

(note - I'm not necessarily talking true analog computation with differentiators and integrators - rather multi-level digital, similar to PAM4 etc)



The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline TheUnnamedNewbie

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #56 on: October 29, 2019, 12:25:42 pm »
They do have additional circuitry next to the storage chip to convert them back into zeros/ones.
:palm: ALL SSD have controller chip. And it does not convert anything. NAND flash chip outputs binary data.

No need to :palm: here. The converter that goes back to binary could easily be on a separate die within the package - esp given how floating-gate non-volatile storage uses vertical stacking on specialized processes. There is obviously a need to turn your multilevel signal back into a nice digital stream, which has to be somewhere - be it on a special controller or in package or on die.
The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #57 on: October 29, 2019, 12:46:32 pm »
There has actually been some revival in multi-level logic recently. With the excess SNR we often see in digital circuits, you could say that you are wasting potential intermediate levels.

That isn't new; it has been the centrepiece of digital comms systems for over 50 years!

The key is to understand the difference between "baud rate" and "bit rate"; too many people don't.

Quote
I would not be surprised if multi-level computation is more common-place in the future.

It will indeed.

With modern and future high speed comms links, multipath effects in on-board and in-cabinet comms links will become problematic. Such comms links will then have to re-use techniques from current "long distance" (i.e. 10m to 100km) comms links. Many of those will be multi-level, to minimise the baud rate.
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 tooki

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: ch
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #58 on: October 29, 2019, 04:53:06 pm »
Indeed, a substantial percentage of the digital signaling we use does not rely on encoding a 1 as a high voltage and 0 as a low one. Manchester encoding/NRZ for example is very common.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21728
  • 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 #59 on: October 29, 2019, 06:14:24 pm »
It looks like you are conflating "electric field" with "charge". Analogy: if I have a 1kg weight on a balanced lever, moving the pivot changes the counterbalancing force by less than (or more than) 1kg.

Not so much the field as its effect upon materials, which are polarized as a consequence.  Polarization is a displacement of charge, and that displacement is continuous.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 835
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #60 on: October 29, 2019, 07:04:09 pm »
In uni we were given an assignment to build a logic circuit to run a 7 segment display from a 4 bit binary bus input.  We were only allowed to use NAND gates.  Was quite challenging and quite interesting to do.  Think it ended up being about 50 gates.

I built a clock and calendar using nothing but NOR logic. It really makes you appreciate having the other logic functions and prepackaged circuits for various purposes.

My 7 segment decoders were much simpler than 50 gates though. I used k-maps to figure out the logic required for them which helped a lot.
 

Offline TheUnnamedNewbie

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #61 on: October 30, 2019, 10:42:14 am »
Indeed, a substantial percentage of the digital signaling we use does not rely on encoding a 1 as a high voltage and 0 as a low one. Manchester encoding/NRZ for example is very common.

I think Manchester/NRZ was not what we were pointing to, it still uses only two levels. Rather things like PAM4/6/8, BPOOK, multi-level ASK/FSK etc...
The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6295
  • Country: fi
    • My home page and email address
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #62 on: October 30, 2019, 01:01:49 pm »
There has actually been some revival in multi-level logic recently. [...] Sure, the gates become more complicated, but I don't think that is such a big issue
Multi-level logic is simple to implement for storage and communications, but the complexity in computational logic (number of possible operators) blows through the roof.  The possible configuration space for even just a handful of interconnected gates gets too large to brute-force through, and there has not been much research in the last few decades into multivalue logic (as a subfield of mathematics).

For N-level logic, there are NN unary and NN2 binary operators.  For 4-level logic, that is 256 unary operators, and 4,294,967,296 binary operators.  Depending on the gate types, there are usually more possible gate configurations than the operators, although a tiny subset of the operators is needed for Boolean/binary algebra.  The issue is optimization: even with a handful of operators, the space of possible configurations is too wide to effectively search.

So, I would claim that it is precisely the complexity that is the issue.

Someone would have to see what the electrical components for multi-level logic gates are, then do inefficient multi-level logic gates, then combine a few to implement the standard operators for binary algebra, then implement some kind of search across the huge possible operator space to look for efficient configurations (perhaps do it in reverse, looking at what kind of operators one can implement the easiest, using the basic components available)... A very interesting research project, and probably will be done at some point, but will take a while to get into real-world products, methinks.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #63 on: October 30, 2019, 01:25:25 pm »
So, I would claim that it is precisely the complexity that is the issue.

However the internal complexity of logic gates/functions is much less of an issue that it used to be. Interconnections (cross-chip and external), noise/crosstalk, and power consumption are more problematic.

Plus if processes continue to shrink, soon the number of electrons/holes in a transistor will be come a problem :)
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
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16885
  • Country: lv
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #64 on: October 30, 2019, 04:48:42 pm »
Introducing multiple levels in logic would mean hugely increased power consumption. To keep it reasonable with CMOS, you would need to do something like multiple power voltages. CMOS consumes barely any current when staying in stable state, current flow happens only during changing state. To keep it in intermediate state, current would need to flow all of the time.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #65 on: October 30, 2019, 05:00:27 pm »
CMOS consumes barely any current when staying in stable state, current flow happens only during changing state.

No longer true in the latest semiconductor processes. Reducing static leakage currents is a hot topic.
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
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16885
  • Country: lv
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #66 on: October 30, 2019, 05:50:22 pm »
CMOS consumes barely any current when staying in stable state, current flow happens only during changing state.

No longer true in the latest semiconductor processes. Reducing static leakage currents is a hot topic.
There is always some leakage. But calling it "no longer true" is nonsense. That leakage is somewhere in femto-picoamps range per single transistor.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19611
  • 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 #67 on: October 30, 2019, 06:35:16 pm »
CMOS consumes barely any current when staying in stable state, current flow happens only during changing state.

No longer true in the latest semiconductor processes. Reducing static leakage currents is a hot topic.
There is always some leakage. But calling it "no longer true" is nonsense. That leakage is somewhere in femto-picoamps range per single transistor.

Then multiply that by the number of transistors :)

The figures I've seen are that the leakage power dissipation can be 30% of the total power dissipation. That will, of course, be dependent on the specific process.
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
 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #68 on: October 30, 2019, 06:55:00 pm »
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.
Ternary computers can apparently be faster or more efficient in both energy consumption and transistor count. We just ended up using binary but it's not the only valid solution.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16885
  • Country: lv
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #69 on: October 30, 2019, 06:59:57 pm »
Then multiply that by the number of transistors :)

The figures I've seen are that the leakage power dissipation can be 30% of the total power dissipation. That will, of course, be dependent on the specific process.
Then make it into microamps to make intermediate levels and multiply by transistor count. 30% on leakage for modern CPU in completely unreal. Unless you mean when it runs at 5% of it's maximum clock speed.
« Last Edit: October 30, 2019, 07:03:00 pm by wraper »
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4074
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #70 on: October 30, 2019, 07:40:27 pm »
Is the OP sorry he asked yet?
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 
The following users thanked this post: MosherIV

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: ch
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #71 on: October 31, 2019, 11:00:29 am »
Indeed, a substantial percentage of the digital signaling we use does not rely on encoding a 1 as a high voltage and 0 as a low one. Manchester encoding/NRZ for example is very common.

I think Manchester/NRZ was not what we were pointing to, it still uses only two levels. Rather things like PAM4/6/8, BPOOK, multi-level ASK/FSK etc...
I know. My thought process was actually regarding the baud ≠ bitrate issue. So many people think digital simply means "voltage on = logic 1, voltage off = logic 0", yet that's really not true much of the time, even in systems using only 2 voltage levels. Phase shift keying is another (perhaps better) 2-level example of the disconnect between voltage level and the logical bits being sent.
 

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #72 on: November 01, 2019, 04:02:12 pm »
Is the OP sorry he asked yet?
Don't be the party pooper.  >:D
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #73 on: November 01, 2019, 09:53:36 pm »
Two states is all an EE can understand.
BEER or NO BEER
PIZZA or NO PIZZA
and so on.

Imagine if you threw in BEER, CIDER or NO BEER... what happens if you wanted WINE ?
Don't ask a question if you aren't willing to listen to the answer.
 

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #74 on: November 01, 2019, 10:55:03 pm »
You select "No beer" and go next step of sequence!!
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #75 on: November 02, 2019, 03:58:48 pm »
@Vtile: Agreed. Just because there are more than two outcomes, doesn't mean there are more than two states. As you say, most things in life are a chain of binary states ( NOT wine NOT beer NOT gin NOT NOT cider ). Even the CASE statement is just a posh way of saying:
Code: [Select]
IF NOT THIS ONE THEN GET THE NEXT ONE AND ITERATE If someone wants ( NOT any of this ), then the state falls out-of-scope but, is still a binary state; the question is either resolved or it is NOT resolved.

Binary state is agnostic; it doesn't care if it's a voltage, a flux polarity or a whole constellation of phase angles. In fact binary state doesn't even care if it's a 0 or 1. Those are just our numbers. State just is or just isn't. What a load of Boolean.

So is someone not going to bother to explain why they think this is wrong?
 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #76 on: November 02, 2019, 04:09:18 pm »
@Vtile: Agreed. Just because there are more than two outcomes, doesn't mean there are more than two states. As you say, most things in life are a chain of binary states ( NOT wine NOT beer NOT gin NOT NOT cider ). Even the CASE statement is just a posh way of saying:
Code: [Select]
IF NOT THIS ONE THEN GET THE NEXT ONE AND ITERATE If someone wants ( NOT any of this ), then the state falls out-of-scope but, is still a binary state; the question is either resolved or it is NOT resolved.

Binary state is agnostic; it doesn't care if it's a voltage, a flux polarity or a whole constellation of phase angles. In fact binary state doesn't even care if it's a 0 or 1. Those are just our numbers. State just is or just isn't. What a load of Boolean.

So is someone not going to bother to explain why they think this is wrong?
Why explain why it's wrong when you already know why?
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Why binary is represented by two bits 0 and 1 and not three bits?
« Reply #77 on: November 02, 2019, 06:11:48 pm »
BOOLsh|t
Don't ask a question if you aren't willing to listen to the answer.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf