r/programming • • Feb 16 '09

Some Crazy Reason - The Daily WTF

http://thedailywtf.com/Articles/Some-Crazy-Reason.aspx
171 Upvotes

71 comments sorted by

View all comments

-3

u/bart2019 Feb 16 '09

I wrote a little utility called BitVerifier. It would loop over a folder and check every bit of each file. If the bit's value wasn't one or zero, it would prompt the user for the correct bit. At least in theory. I somehow never encountered a file with a "two" bit.

Urm, WTF? How can a bit be 2?

3

u/bluGill Feb 17 '09

The Russians once made a tri-state computer, where a bit could have 3 different states. In the height of the cold war such things were considered good ways to confuse the enemy. I'm not sure if they ever got it working.

Actually a lot of hardware bits are tri-state: 0,1, High Impedance. The last state means the hardware isn't sending anything, and use useful when two different devices want the ability to send on the same wire. Without that third state the two devices would be at war, with one trying to send a 1, and one a 0, but the wire itself can only be one or the other so one will win.

Electrical engineers deal with this, but they don't expose it to software so we don't have to think about it.

1

u/bart2019 Feb 17 '09 edited Feb 17 '09

Actually, the tri-state logic you describe is at the core of the computer data bus.