Bill's Computer Circus
Don't get caught with your system down.
NOTICE: This web site may not render correctly in older browers like Internet Explorer 5.2 for the Mac. May the gods help you if you are using Internet Explorer on any machine! Otherwise, if this site does not look right on your browser, please let me know what browser you are using (and what version and on what computer). Thanks!
"Visual Basic makes the easy things easier. Delphi makes the hard things easy."
-- unknown
Thursday, July 15, 2004
 
I've had a hell of a time with the PIC16F87 chips.  I don't know if they're major flakes, or if it is my programmer.  But I have had a hell of a time.  I'm not even going to go into it.
 
I have ONE critical item remaining on my list.  One.  But it eludes me at the moment.  It's that last major deal that I have to conquer.  The one last great challenge.  But then I also just noticed that my RC4 device does not seem to be responding properly with channels configured in R/C Fixed mode.  Oh, well - I'll not it in my journal and move on.  That's the nature of this thing.  I fix one thing, and something else breaks.  I sometimes think I am running around in a circle, fixing this, breaking that, until I find myself back at the same problem I started with.
 
Anyway, I was thinking about programming last night and how the digital realm maps to real life.  I have heard analog people claim that they don't like digital, because nothing in real life is digital.  I would beg to differ, because it is the digital realm that has revealed a perspective of life, the universe, and everything to me that I would not have seen from a strictly analog perspective.
 
If I were to teach an introductory class in computer science, I would begin by spending an entire class session on one elementary, fundamental topic: the bit.  I think the power of the bit - and the meaning it can be associated with - is overlooked.  "Bit" - in its most literal translation - is short for "binary digit" and represents either a value of 0 or a value of 1.  But I think it is much more than that, from a conceptual perspective.
 
I define a "bit" as "a purely conceptual entity that can represent exactly one of only two possible states at any given time."  A bit has no gray area.  There is nothing in between.  There is either one state, or there is the other state, of the two possible states it can represent.
 
Now the interesting thing about bits is that combining them results in an entity that is greater than the sum of their parts.  One bit by itself can represent two states.  Two bits together can represent four states.  So far, they break even.  But add a third bit and what happens?  Instead of now representing six possible states, they can represent eight possible states.  Add another bit and now the four can represent sixteen possible states.  The effect of their accumulation is exponential.

This idea has led me to see that everything in this [seemingly complex] universe can be broken down into simple, fundamental components.  Look at DNA for example.  It has four basic components, but simply due to the sequence in which they are arranged in the strands that they form, we get plants and animals and people.  Well, people are animals, too, but you know what I mean.
 
The bit - or rather the concept of the bit - is fundamental to the universe.  Look at the greatest question mark of all: existence.  Things either exist, or they don't.  There really is no gray area.  One might argue that things change and mutate, but from the perspective of the bit, they are changing to become something else.  The moment one thing changes - so much as a single atom - what was once a certain thing before has now become something different - the previous state no longer exists.
 
Take photons for example.  They are either present, or they are not.  Light and dark is an example of a bit.  One might argue that there is infinite gray area here, but if you really think about it, there isn't.  There is either light in the room, or there is not.  If there is one photon in the room, there is light.  If that photon disappears, then there is no light in the room.
 
And there is a threshold there - some invisible, infinitesimally thin dividing line where the photon is considered to be out of the room or in the room.  The photon is either inside, or it is outside.  The moment the outer edge of the photon (if it has one) crosses over that line, its state changes from in to out, or from out to in, depending on the direction it is travelling.

A door can be either latched or unlatched.  Turn the door knob slowly as you pull on the door and there will be one point - one instantaneous moment - where the last atom of the latch clears the last atom of the jamb and the door opens.
 
I think the existence/non-existence, light/dark example has given me the greatest influence on my perspective of the universe.  It has made me think about everything to consider if there is an opposite to the things I observe.  I kind of look at the universe and everything in it as this state of existence - as one side of a bit.  And within that state of existence there are other bits - like matter and anti-matter.  I have heard it theorized that the total of all energy in the universe is exactly zero.  I tend to believe that.  I perceive the universe as this temporary state of existence, and that everything in it exists because the original state of nothingness has been split into two and stretched out like a balloon.  We exist in this universe in a state of tension, with that endpoint of non-existence trying to pull it all back.
 
Bring matter and anti-matter together and it ceases to exist.  There is a violent release of energy as the matter returns to its state of nothingness.  There's another bit: matter and anti-matter.  This thing we call matter can exist in one of those two states.  Anything in between and it is something else entirely.
 
Anyway, the bit is immensely useful in logic.  If you can break down a problem into its constituent bits, you can then represent it entirely in binary.  I think if I were to teach an introductory digital electronics class, I would expound upon the bit as well.  Digital electronics is an ideal playground for playing with bits.
 
One thing they teach you is about gates.  AND gates, OR gates, etc.  But what I don't remember ever being taught is a thing I refer to as "negative logic" or "inverse logic".  It's the other side of logic - the other state of the bit that represents logic. 
 
We tend to look at things from one perspective - one side.  When dealing with logic, it seems for some reason there is a great interest in the "1" (or the "true") state.  In fact, there is a little thing called "truth tables" that digital electronics students learn to make.  It illustrates what pattern of bits on logic inputs results in a 1 or true state on the output.
 
"True" is often associated with "1", and "false" with "0".
 
So, for example, a Truth Table for a two-input OR gate would look like this:
 A B : X
-----+---
 0 0 : 0 
 0 1 : 1
 1 0 : 1
 1 1 : 1
 
And a Truth Table for a two-input AND gate would look like this:
 A B : X
-----+---
 0 0 : 0
 0 1 : 0
 1 0 : 0
 1 1 : 1
 
For the OR gate, whenever any input is true, the output is true.  For the AND gate, only when both inputs are true is the output also true.
 
Then there is the inverter.  This simply takes an input and, well, inverts it.  If the input is true, the output is false.  If the input is false, the output is true.  One way to represent an inverted value is to put a bar over the input name, or put a slash in front of it - like /A.  So, if A=0, then /A=1.  Following this, if you invert all the inputs AND the output of an OR gate or an AND gate, you invert its function - the OR gate essentially becomes an AND gate, and the AND gate becomes an OR gate.
 
Here is an inverted OR gate Truth Table:
/A /B : /X
------+---
 1  1 :  1
 1  0 :  0
 0  1 :  0
 0  0 :  0
 
And here is an inverted AND gate Truth Table:
/A /B : /X
------+----
 1  1 :  1
 1  0 :  1
 0  1 :  1
 0  0 :  0
 
You can see that the inverted OR gate spits out a true only when the inverted inputs are both true, and the inverted AND gate spits out a true whenever any input is true.
 
But is this really inverting the function of the gate?  Well, yes.  But what about negative logic?  Look at the inverted gates again.  If you look at the zeros now instead of the ones, the gates haven't changed.  The OR gate is still an OR gate, and the AND gate is still an AND gate...but for "false" conditions!  The inverted gates have not so much inverted the logic operations they represent, rather they have inverted the focus from "true" to "false".
 
In negative logic, we're interested in the false conditions - the zeros.  So, when inverted, a truth table becomes a false table.
 
Anyway, I have some theories - or formulas - whatever you would call them - that I use to help me understand logic and maintain an understandable perspective on it.  If I could draw some diagrams here, I would.  But oh well.  There is one strange gate in particular, called the "exclusive OR" gate.  Again, there is the focus on "true", since in inverse logic, it is really an "inclusive AND" gate (where both the false-false and true-true conditions result in a false output).  I consider this gate to be one that straddles the line between positive and negative logic, kind of like the inverter that translates between the two.
 
I'm not sure where all this is going, but I was just thinking about all this stuff and thought I would write it down.  It is useful to have the concept of the bit in mind (in a more general sense) when looking at the universe...or at our small little corners of it.  I contend that what we see is not all there is, and try to look for the flip side of things, asking myself, "is this a bit I'm looking at?"  After all, where would our understanding of the universe and mathematics be if no one ever discovered "imaginary numbers?"  There's a bit: real and imaginary.
 
See, this really is a digital world we live in. 

 
Although, there are some analog advantages that might be spoiled if you try to break them down into bits.  Take my wife, for example...
 

 
She wouldn't like it one bit!
 

posted by Bill  # 6:14 PM