42

The IBM 650, announced in 1953, was the world's first mass-produced computer. It represented numbers in decimal, which is understandable, both because it needed to work with exact money amounts, and because converting from binary to decimal for output would have been computationally demanding by the standards of the time.

It represented decimal numbers in bi-quinary form, which requires seven bits per digit, as compared to BCD which requires only four bits per digit. the technical limitations of the time make this choice more rather than less surprising; when bits are implemented with vacuum tubes, three extra bits per digit is a highly nontrivial cost.

What was the reason for using bi-quinary?

  • Doesn't bi-quinary use four bits? "4" = 0100, "5" = 1000, "9" = 1100 – Whit3rd Apr 15 at 8:50
  • 3
    @Whit3rd Nope, 4 is 01 10000. 5 is 10 00000. 9 is 10 10000 – Wilson Apr 15 at 8:58
  • 7
    Excuse me, 5 is not 10 00000. 5 is 10 00001. – Wilson Apr 15 at 9:10
  • 10
    That's SO wierd; it's llike a digital logic abacus register. – Whit3rd Apr 15 at 10:10
  • 2
    @Whit3rd That is exactly it! I hope you don't mind. I took that comparison and included it in my answer. – Wilson Apr 15 at 10:17
19

Quibbling about the right meaning of "bit" aside, some advantages of the 2-of-7 biquinary representation are:

  • Simpler circuits. In a quinary adder circuit, the output of each of the 5 output lines becomes just a 5-way OR of binary ANDs of input lines. To implement this with primitive logic building blocks such as resistor-transistor-logic (or its vacuum-tube analogue) you can probably make do with one active component (tube or transistor) per output if you select your resistances carefully. This counts in an age where tubes and transistors are expensive discrete components of dubious reliability!

  • Faster operation -- with 10 biquinary digits there will be fewer gate delays in an arithmetic operation than with 36 binary digits -- especially when logic is still expensive and spending more logic on accelerating carry propagation is a science-fiction dream.

  • Error checking. If you don't really trust your logic building blocks, you want error checking everywhere. With 2-of-7 you can apply error checking to each intermediate digit in the computation. Any single component failure will lead to either too many or too few lines being active, so you can immediately pinpoint pretty exactly where you need to replace a part.

These advantages are not governing anymore, since transistors are pretty reliable and individually cheap. On the other hand, memory (whether in the form of register files, caches, or conventional) has come to dominate the hardware budget compared to ALUs, which means that the greater compactness of base-2 is a much larger consideration.

  • Also just came across medium.com/@bellmar/the-land-before-binary-cc705d5bdd70 - "So while 2 out of 5 code and bi-quinary can both do error checking, it is easier to look at a bi-quinary number and understand what its meaning is in decimal. The experience ends up being a little more user friendly." – rwallace yesterday
39

I will just explain what a bit is. It's a binary digit. 0 is numerically zero, 1 is numerically one. If you want to add 1 and 1, in binary it overflows. the result is 0, and a carry out. As you understand, other arithmetic operations can be done on bits. They takes a fair bit of logic to implement. Binary is positional. That means that a 1 which is 4 places from the right is worth 24 = 16.

Biquinary is not based on this idea. Biquinary is based on the idea "let's count from zero to four and then also flipflop to another state where we're counting instead from 5 to 9". Just like we humans count to five on one hand, and then count to ten on another hand. Or an abacus, that has five beads on one part of the rod, and one more bead on the other part. Now, how that's implemented in the IBM 650 is with binary states (not binary digits!) to say which of {0,1,2,3,4} is true, and which of {range(0..4), range(5..9)} is true. This implementation of biquinary is two "one-hot" signals. That means that a 1 which is 4 places from the right is worth either 0+4 = 4 or 5+4 = 9.

A binary state is different from a bit, as it is one of true or false. true and false cannot be added. true and false are just the values represented in some way, often by whether or not a current is flowing.

It represented decimal numbers in bi-quinary form, which requires seven bits per digit, as compared to BCD which requires only four bits per digit.

Not so; just think about the nixies: A single vacuum tube which has ten cathodes that glow. They share a common ground, so a further ten electrical connections, one per digit, can each light up one of the digits inside the tube. These electrical connections are not really bits though. These electrical connections are binary states, so that if the nixie is showing a particular number, you've got one true and nine falses.

A nixie tube ZM1210

The biquinary tubes in the IBM 650 have a similar arrangement. So don't think about it as "seven bits", but as "one decimal digit", whose implementation involves seven electrical contacts which are very cheap. The tube stores or treats one decimal digit. And it is the tube which incurs the cost.

So the biquinary system is not really seven bits representing a decimal system. It is more like a "thing which counts from 0 to 4" (five possible states) plus a "thing which can flip between high and low" (two possible states). The numbers 2 and 5 were chosen since they are the prime factors of ten. So here are the numbers from 0 to 9:

    high   low    zero     one    two    three    four
    ----------------------------------------------------
 0: false  true   true     false  false  false    false
 1: false  true   false    true   false  false    false
 2: false  true   false    false  true   false    false
 3: false  true   false    false  false  true     false
 4: false  true   false    false  false  false    true
 5: true   false  true     false  false  false    false
 6: true   false  false    true   false  false    false
 7: true   false  false    false  true   false    false
 8: true   false  false    false  false  true     false
 9: true   false  false    false  false  false    true

Can you see? These are not bits because the word bit actually means "treat me as a base-2 digit". They are more like selectors. One selector says "I am one of zero, one, two, three and four". Another selector says "I am whatever the other guy said plus either zero or five". You can't add or subtract these selectors, or do any arithmetic on them, so these "selectors" are much, much cheaper than a bit in something like a modern computer.

These seven electrical signals together make up a decimal digit. And they correspond to seven "legs" on the bottom of the vacuum tube.

If you look at the table above, you can see that if you want to (for example) add two numbers, the process will naturally yield some kind of carry. It will flip the high/low pair between true false and false true, and will tell you which way it flipped. Now you know whether you've got to carry one to the next digit.

That arrangement is much simpler to implement than BCD which you mentioned it your question, where to figure out if you have a carry, you have to check if the (binary) addition got a carry, and if not, compare with 1001, and if higher carry one and then subtract 1001, otherwise carry 0. Biquinary addition is much cheaper. Especially if you use the vacuum tube that counts to five and flipflops between high and low.

  • 2
    I thought a nixie was 10 tubes stacked behind each other? The 650 front panel looks like 7 bits per digit. How does one tube handle a decimal digit? It can't be sensitive to 10 voltage levels? – rwallace Apr 15 at 9:03
  • 2
    There were some Nixie tubes that worked directly with biquinary inputs; instead of having ten individually-connected digit cathodes and a single anode, they had five cathode pins, each connected to two digits (one each in the front and back halves of the tube), and two anodes (one in each half), only one of which was powered at a time. (There was also a wire screen between the halves, held at an intermediate voltage level, to prevent interference between the halves.) I believe that all of these used the two anodes to select between even/odd rather than 0-4/5-9, but it's the same basic idea. – jasonharper Apr 15 at 11:48
  • 3
    A technical term that describes how the two signal groups are being used in the bi-quinary encoding is that each signal group encodes a number in one-hot fashion. – njuffa 2 days ago
  • 2
    @rwallace It's ten cathodes inside of one tube, wired up to six inputs (plus ground). No bits involved, that just wasn't how the tech worked - just like when counting with your fingers. Ten cathodes, the first signal told you which five of those the second signal selects. Digital doesn't imply binary - the 650 was a decimal (or more correctly, bi-quinary - two * five) digital computer. Don't try finding binary digits there. – Luaan 2 days ago
  • 1
    @rwallace: Addition can be done with a combination of counters that have "value is zero" outputs and a couple of latches each. To add the value in one set of counters to the value in another set, clear all the latches and then repeat the following sequence ten times for all digits in parallel: increment one addend. If the result is zero, set the "active" latch for that digit. On each cycle where the active latch is, or becomes set, increment the destination. If it is becomes zero when incremented, set the carry output. Then starting with the ones' place, increment each digit if the... – supercat 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.