Electronics > Beginners

Why binary is represented by two bits 0 and 1 and not three bits?

<< < (5/16) > >>

tooki:

--- Quote from: MosherIV 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.

--- End quote ---
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.

Nominal Animal:
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.)

GeorgeOfTheJungle:

--- Quote from: radiolistener on October 26, 2019, 10:45:53 pm ---A binary digit is represented by one bit. Not two. :)

--- End quote ---

A decimal digit is represented by 3.321928095 bits  :)

tggzzz:

--- Quote from: tooki on October 27, 2019, 12:09:16 am ---
--- Quote from: MosherIV 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.

--- End quote ---
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.

--- End quote ---

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.

Canis Dirus Leidy:

--- Quote from: tggzzz on October 27, 2019, 08:52: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.

--- End quote ---
And real programmers use water: https://en.wikipedia.org/wiki/Water_integrator :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod