Why binary is represented by two bits 0 and 1 and not three bits? - Page 1
Forum section: electronics / beginners

author: tip.can19
author_rank: Contributor
timestamp: October 25, 2019, 08:51:34 am
content: 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,

author: sleemanj
author_rank: Super Contributor
timestamp: October 25, 2019, 08:55:00 am
content: Google ternary computing (trits are usually represented -1, 0, 1).

author: tszaboo
author_rank: Super Contributor
timestamp: October 25, 2019, 08:58:13 am
content: 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.

author: Raj
author_rank: Frequent Contributor
timestamp: October 25, 2019, 09:04:17 am
content: 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.

author: tip.can19
author_rank: Contributor
timestamp: October 25, 2019, 09:20:43 am
content: 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?

author: srce
author_rank: Regular Contributor
timestamp: October 25, 2019, 09:27:49 am
content: 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.

author: tip.can19
author_rank: Contributor
timestamp: October 25, 2019, 09:36:58 am
content: 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.

author: tggzzz
author_rank: Super Contributor
timestamp: October 25, 2019, 09:53:46 am
content: Quote from: srce on October 25, 2019, 09:27:49 amTwo-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.QuoteJust because you can't see an advantage, doesn't mean there aren't any.OTOH, theproofis more interesting, and leads to significantly deeper understanding.

author: Raj
author_rank: Frequent Contributor
timestamp: October 25, 2019, 11:29:09 am
content: Quote from: tip.can19 on October 25, 2019, 09:20:43 amyup, can call it a transistor (https://en.wikipedia.org/wiki/Multi-level_cell)

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 25, 2019, 04:43:52 pm
content: 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

author: Canis Dirus Leidy
author_rank: Regular Contributor
timestamp: October 25, 2019, 05:17:52 pm
content: Quote from: tip.can19 on October 25, 2019, 08:51:34 amYou accidentallySetun. 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).

author: rstofer
author_rank: Super Contributor
timestamp: October 25, 2019, 08:04:13 pm
content: Quote from: T3sl4co1l on October 25, 2019, 04:43:52 pmI 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/

author: Old Printer
author_rank: Frequent Contributor
timestamp: October 25, 2019, 08:21:26 pm
content: Pioneer and Personality, that's a graceful way of putting it

author: tooki
author_rank: Super Contributor
timestamp: October 25, 2019, 09:00:36 pm
content: And I would add that therearesituations 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.

author: Bud
author_rank: Super Contributor
timestamp: October 25, 2019, 09:08:54 pm
content: This is to meet political correctness requirement to include idiot people, because....

author: tip.can19
author_rank: Contributor
timestamp: October 26, 2019, 04:42:58 am
content: Thank you! This is really good.

author: IDEngineer
author_rank: Super Contributor
timestamp: October 26, 2019, 06:09:39 am
content: 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 actuallyremove noisefrom 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.

author: tggzzz
author_rank: Super Contributor
timestamp: October 26, 2019, 08:56:33 am
content: Quote from: IDEngineer on October 26, 2019, 06:09:39 amAnd with that we are getting closer to the fundamentalsNext 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.

author: MosherIV
author_rank: Super Contributor
timestamp: October 26, 2019, 09:07:56 am
content: 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.

author: radiolistener
author_rank: Super Contributor
timestamp: October 26, 2019, 10:45:53 pm
content: Quote from: tip.can19 on October 25, 2019, 08:51:34 amBinary digit is represented by one bit. Not two.

author: tooki
author_rank: Super Contributor
timestamp: October 27, 2019, 12:09:16 am
content: Quote from: MosherIV on October 26, 2019, 09:07:56 amSome 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 performingmathematical operations.

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 27, 2019, 12:41:44 am
content: Bitis short forBinary Digit. Each binary digit, or bit, has one of exactlytwostates, or values.Tritis short forTernary Digit. Each trit has one of exactly three states, or values.AB-base digit has exactlyBstates, or values.An unsigned (nonnegative) integer value consisting ofNdigitsd1,d2,..,dNof baseBhas valuev,$$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 implementBoolean logicandBoolean 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 areundefined, 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 calledlogic gates.It is interesting to note thatLeibnizrealized 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 byBoolein 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.Setunmentioned by Canis Dirus Leidy was a ternary computer originally developed in 1958 at Moscow University. It usedbalanced ternaryfor the numerical operations, andternary logicinstead 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.)

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: October 27, 2019, 07:20:17 am
content: Quote from: radiolistener on October 26, 2019, 10:45:53 pmA decimal digit is represented by 3.321928095 bits

author: tggzzz
author_rank: Super Contributor
timestamp: October 27, 2019, 08:52:49 am
content: Quote from: tooki on October 27, 2019, 12:09:16 amAnalogue 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.

author: Canis Dirus Leidy
author_rank: Regular Contributor
timestamp: October 27, 2019, 09:02:49 am
content: Quote from: tggzzz on October 27, 2019, 08:52:49 amAnd real programmers use water:https://en.wikipedia.org/wiki/Water_integrator

author: tggzzz
author_rank: Super Contributor
timestamp: October 27, 2019, 09:41:07 am
content: Quote from: Canis Dirus Leidy on October 27, 2019, 09:02:49 amAnd real electronic engineers use gas for their logic circuits:https://www.symscape.com/blog/fluidic-logicI 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.

author: tooki
author_rank: Super Contributor
timestamp: October 27, 2019, 05:56:35 pm
content: I think the take-home message here is that often, when people ask "why isxalways done like this?" or "why don't we dox[some unusual way]?", they are blithely unaware that all the other ways typicallyhavebeen tried before, and the reasonxbecame 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!

author: konzill
author_rank: Newbie
timestamp: October 27, 2019, 07:50:56 pm
content: 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.

author: Syntax Error
author_rank: Frequent Contributor
timestamp: October 27, 2019, 09:15:41 pm
content: @tip.can19 - Binary and it's associated Boolean logic also fits ourstatefullview 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 likewhatever, dunnoandBrexit, don't work when making decisions as they are notfinitestates.Being caught between finite states is beingin 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 algebrahttps://en.wikipedia.org/wiki/Boolean_algebraGeek out on Hysteresishttps://en.wikipedia.org/wiki/HysteresisGeek out on the Finite State Machinehttps://en.wikipedia.org/wiki/Finite-state_machineP.S. Thinking about this, in data analysis, it is possible for an outcome to havethreestates; an outcome can be none, one ormany. I believe this none/one/many concept was created by Australian Aboriginal people tens of thousands of years ago. Clever dudes.

author: Vtile
author_rank: Super Contributor
timestamp: October 27, 2019, 11:07:45 pm
content: Why binary not ternary.. I suppose one interesting reason is that all widely used number systems are even based, 2,8,10,16,60.

author: Canis Dirus Leidy
author_rank: Regular Contributor
timestamp: October 28, 2019, 05:24:47 am
content: Quote from: tggzzz on October 27, 2019, 09:41:07 amРусские физики выбираютSlackwareАВК-6!(The most remarkable thing is that this is a page from anadvertising catalog ofconsumerproducts).

author: tggzzz
author_rank: Super Contributor
timestamp: October 28, 2019, 08:24:51 am
content: Quote from: Syntax Error on October 27, 2019, 09:15:41 pmNot 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.

author: paulca
author_rank: Super Contributor
timestamp: October 28, 2019, 08:26:09 am
content: 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.

author: tggzzz
author_rank: Super Contributor
timestamp: October 28, 2019, 08:44:23 am
content: Quote from: paulca on October 28, 2019, 08:26:09 amAll "digital" circuits are actually analogue; that's most obvious with ECL and derivatives. Some CMOS logic gates can be used as linear amplifiers.Logic gatesinterpretinput 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.

author: Syntax Error
author_rank: Frequent Contributor
timestamp: October 28, 2019, 09:56:17 am
content: Quote from: tggzzz on October 28, 2019, 08:24:51 amIn 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.

author: paulca
author_rank: Super Contributor
timestamp: October 28, 2019, 10:05:49 am
content: QuoteAs a paraglider pilot from a windy country, the bigger the span the more likely you'll be dragged like a rag doll up the hillKite 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.

author: tggzzz
author_rank: Super Contributor
timestamp: October 28, 2019, 10:12:25 am
content: Quote from: Syntax Error on October 28, 2019, 09:56:17 amFalse, in every respect.YourFSM 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 yearshttp://www.inf.ed.ac.uk/teaching/courses/seoc/2005_2006/resources/statecharts.pdfbut there are many other formalisms.

author: BrianHG
author_rank: Super Contributor
timestamp: October 28, 2019, 10:17:38 am
content: Quote from: Vtile on October 27, 2019, 11:07:45 pmThat's only after the invention of '0'.

author: tggzzz
author_rank: Super Contributor
timestamp: October 28, 2019, 10:19:11 am
content: Quote from: paulca on October 28, 2019, 10:05:49 amYeah, 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)

author: paulca
author_rank: Super Contributor
timestamp: October 28, 2019, 11:04:48 am
content: Quote from: tggzzz on October 28, 2019, 10:19:11 amLOL. 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 fieldWho needs to go faster than 25knots anyway, it's much easier staying in small thermals when you can orbit inside 10 meters

author: tggzzz
author_rank: Super Contributor
timestamp: October 28, 2019, 11:21:21 am
content: Quote from: paulca on October 28, 2019, 11:04:48 amNasty. 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.QuoteOooh, picky picky pickyI'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 woodwormMore 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 headThat was anewexperience for an instructor that had been instructing for half a century.

author: paulca
author_rank: Super Contributor
timestamp: October 28, 2019, 01:11:28 pm
content: Quote from: tggzzz on October 28, 2019, 11:21:21 amOnly an electronics engineer would report 3400ft as 3k4ftI'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.

author: pwlps
author_rank: Frequent Contributor
timestamp: October 28, 2019, 01:35:52 pm
content: 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).

author: TomS_
author_rank: Frequent Contributor
timestamp: October 28, 2019, 07:40:37 pm
content: Quote from: tip.can19 on October 25, 2019, 08:51:34 amOne 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.

author: TimFox
author_rank: Super Contributor
timestamp: October 28, 2019, 08:00:07 pm
content: Quote from: tggzzz on October 28, 2019, 08:44:23 amRelay logic uses truly discrete binary signals

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: October 28, 2019, 08:11:55 pm
content: Trits? Qbits it where it's at

author: Vtile
author_rank: Super Contributor
timestamp: October 28, 2019, 08:28:41 pm
content: Quote from: BrianHG on October 28, 2019, 10:17:38 amDo you refer zero as logical or numerical operator or both.

author: tggzzz
author_rank: Super Contributor
timestamp: October 28, 2019, 08:30:00 pm
content: Quote from: TimFox on October 28, 2019, 08:00:07 pmNo.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 ismarginallyless than the latch in (or hold) currents, the relay will not reliably be in the expected state.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 29, 2019, 01:11:57 am
content: 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

author: tggzzz
author_rank: Super Contributor
timestamp: October 29, 2019, 08:06:04 am
content: Quote from: T3sl4co1l on October 29, 2019, 01:11:57 amIndeed. I considered mentioning that, but thought it an unnecessarily "complex" version of the simpler point.I also considered mentioning metastabilityQuotePhoton counting applications with, say, an APD?Sure the pulse out of an APD is analogue, but the photon signal is digital.QuoteIt 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.

author: golden_labels
author_rank: Super Contributor
timestamp: October 29, 2019, 09:06:13 am
content: 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 werenegabinary computers. Anecdotal story is that the guys misunderstood a joke and implemented the machine, approaching the subject with complete seriousness.____(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 lawquickly 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)HistoricallyKarnaugh mapshave been used, and those can be solved by children in kindergarten.

author: paulca
author_rank: Super Contributor
timestamp: October 29, 2019, 09:25:04 am
content: Quote from: golden_labels on October 29, 2019, 09:06:13 amIn 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.

author: tggzzz
author_rank: Super Contributor
timestamp: October 29, 2019, 09:37:28 am
content: Quote from: golden_labels on October 29, 2019, 09:06:13 amThat'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.

author: mariush
author_rank: Super Contributor
timestamp: October 29, 2019, 12:07:31 pm
content: because i didn't see someone else linking to them

author: wraper
author_rank: Unknown
timestamp: October 29, 2019, 12:17:14 pm
content: Quote from: Raj on October 25, 2019, 09:04:17 amAlmost 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.QuoteALL SSD have controller chip. And it does not convert anything. NAND flash chip outputs binary data.

author: TheUnnamedNewbie
author_rank: Super Contributor
timestamp: October 29, 2019, 12:23:16 pm
content: 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)

author: TheUnnamedNewbie
author_rank: Super Contributor
timestamp: October 29, 2019, 12:25:42 pm
content: Quote from: wraper on October 29, 2019, 12:17:14 pmNo need tohere. 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.

author: tggzzz
author_rank: Super Contributor
timestamp: October 29, 2019, 12:46:32 pm
content: Quote from: TheUnnamedNewbie on October 29, 2019, 12:23:16 pmThat 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.QuoteIt 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.

author: tooki
author_rank: Super Contributor
timestamp: October 29, 2019, 04:53:06 pm
content: 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 29, 2019, 06:14:24 pm
content: Quote from: tggzzz on October 29, 2019, 08:06:04 amNot 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

author: TomS_
author_rank: Frequent Contributor
timestamp: October 29, 2019, 07:04:09 pm
content: Quote from: paulca on October 29, 2019, 09:25:04 amI 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.

author: TheUnnamedNewbie
author_rank: Super Contributor
timestamp: October 30, 2019, 10:42:14 am
content: Quote from: tooki on October 29, 2019, 04:53:06 pmI 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...

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 30, 2019, 01:01:49 pm
content: Quote from: TheUnnamedNewbie on October 29, 2019, 12:23:16 pmMulti-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).ForN-level logic, there areNNunary andNN2binary 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 doinefficientmulti-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.

author: tggzzz
author_rank: Super Contributor
timestamp: October 30, 2019, 01:25:25 pm
content: Quote from: Nominal Animal on October 30, 2019, 01:01:49 pmHowever theinternalcomplexity 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.Plusifprocesses continue to shrink, soon the number of electrons/holes in a transistor will be come a problem

author: wraper
author_rank: Unknown
timestamp: October 30, 2019, 04:48:42 pm
content: 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.

author: tggzzz
author_rank: Super Contributor
timestamp: October 30, 2019, 05:00:27 pm
content: Quote from: wraper on October 30, 2019, 04:48:42 pmNo longer true in the latest semiconductor processes. Reducing static leakage currents is a hot topic.

author: wraper
author_rank: Unknown
timestamp: October 30, 2019, 05:50:22 pm
content: Quote from: tggzzz on October 30, 2019, 05:00:27 pmThere is always some leakage. But calling it "no longer true" is nonsense. That leakage is somewhere in femto-picoamps range per single transistor.

author: tggzzz
author_rank: Super Contributor
timestamp: October 30, 2019, 06:35:16 pm
content: Quote from: wraper on October 30, 2019, 05:50:22 pmThen multiply that by the number of transistorsThe 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.

author: Mr. Scram
author_rank: Super Contributor
timestamp: October 30, 2019, 06:55:00 pm
content: Quote from: srce on October 25, 2019, 09:27:49 amTernary 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.

author: wraper
author_rank: Unknown
timestamp: October 30, 2019, 06:59:57 pm
content: Quote from: tggzzz on October 30, 2019, 06:35:16 pmThen 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.

author: paulca
author_rank: Super Contributor
timestamp: October 30, 2019, 07:40:27 pm
content: Is the OP sorry he asked yet?

author: tooki
author_rank: Super Contributor
timestamp: October 31, 2019, 11:00:29 am
content: Quote from: TheUnnamedNewbie on October 30, 2019, 10:42:14 amI 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.

author: Vtile
author_rank: Super Contributor
timestamp: November 01, 2019, 04:02:12 pm
content: Quote from: paulca on October 30, 2019, 07:40:27 pmDon't be the party pooper.

author: SL4P
author_rank: Super Contributor
timestamp: November 01, 2019, 09:53:36 pm
content: Two states is all an EE can understand.BEER or NO BEERPIZZA or NO PIZZAand so on.Imagine if you threw in BEER, CIDER or NO BEER... what happens if you wanted WINE ?

author: Vtile
author_rank: Super Contributor
timestamp: November 01, 2019, 10:55:03 pm
content: You select "No beer" and go next step of sequence!!

author: Syntax Error
author_rank: Frequent Contributor
timestamp: November 02, 2019, 03:58:48 pm
content: @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:IF NOT THIS ONE THEN GET THE NEXT ONE AND ITERATEIf 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?

author: Mr. Scram
author_rank: Super Contributor
timestamp: November 02, 2019, 04:09:18 pm
content: Quote from: Syntax Error on November 02, 2019, 03:58:48 pmWhy explain why it's wrong when you already know why?

author: SL4P
author_rank: Super Contributor
timestamp: November 02, 2019, 06:11:48 pm
content: BOOLsh|t