We need to be thoroughly familiar with a few basic gates seen at the left before moving on. The electronic circuits shown with a simple lamp and battery illustrates that both switches must be closed before the lamp can lite for the AND gate. The OR gate circuit will lite the lamp if either of the switches close. The inverting buffer is used many places to invert a HIGH logic to LOW logic and vise-versa. The multiplexer uses this sort of switch logic to select and input to be placed on the output. Take note of the "truth tables" that spec-out what the gate does. This may seem oversimplified, but as we build on these concepts, we want to be clear on the basics. Notice the inversion idea can be moved around with just a circle symbol. Therefore an AND gate with a circle on the output becomes a NAND gate, meaning if both inputs are HIGH, the output is LOW and if the inputs are not both HIGHs, the output will remain HIGH, basically inverting the logic. This is an abstraction of the physical switch idea with the battery and lamp. We have to get confident with swimming in abstractions or drown. Think like a Greek.

These logic gates beg the question, "What is logic HIGH or LOW?" At this point, there is a flood of information that is implied, like computers using binary numbering or two levels to operate, a HIGH is represented by +5V and a LOW by 0V, also "true" logic is also represented by a HIGH and "false" by a LOW, and on-and-on. Since we live in the computer age, we already know about this, but when all of this was notional, none of this had been established yet. In recent years, these levels have shifted ever downward, i.e., logic highs were reduce to +3.3V then to 1.8V reducing power consumption and speeding up the response.

Lets stave off the reasons behind use of various precise levels of voltage and just realize we need two levels to be defined what represents a switch being either on of off. That's all we need to make digital logic work. This two-level system can be represented mathematically via binary numbers, which allows us to manipulate all sorts of models of the real world - abstraction. In fact, we can abstract logic HIGH to be 0V and LOW to be +5V, etc., creating virtual circuit logic and this has been done, although so confusing it is rarely used, but is possible, further supporting the idea of abstraction making it necessary to precisely define or spec how our circuits are expected to perform.

Here are a few more fundamental gates before we move on: At this point, we move straight into abstraction and away from lamp circuits, but as you will see, these more abstract logic gates provide a lot of useful logic and can be built into electronic hardware. The picture shows how the XOR or exclusive-OR gate is used and the truth table that spec's it. The flip-flop is a little more complex in that a logic level is clocked into the circuit as one of two stable states. If a HIGH is on pin D and a clock pulse is invoked, the Q output goes HIGH from a quiescent state of logic LOW, which is done by "clearing" the flip-flop. What may not be apparent right away is the state of Q is held there even after the HIGH on D (or LOW) goes away. The Q value only changes with a clock input and follows what is on pin D. Thus, a bit can be "memorized" in this sort of device. There are many styles of flip-flops. The name comes from describing these two states the device can be in. As logic became more in the abstract than physical, a man named Boolean came up with a way to turn all this into equations that could be worked via algebraic manipulation and made it possible to construct all sorts of complex logic using Boolean Algebra. This approach demanded the concept of "true" or "false" being defined. The most common selection was a logic HIGH was equivalent to true and a logic LOW equivalent to false. This will only make sense as you use logic or in programs where asking if something is true or false is used to make decisions. This true and false pair brings the circuit of two state switching in line with Boolean concepts. We won't get bogged down in Boolean Algebra. It's main use is in reducing complex logic down to the essential combinations or minimum chips needed to fullfil the logic requirements. But it's there if we want to check out the optimum circuit combos. Most of the time the chips available from manufactures dictate how the logic is going to ultimately be arranged and that may not be the optimized solution.

Let's tackle some circuits and see how all this works. It becomes more clear when you start gluing a bunch of combinational logic gates together and seeing, yes they really can do magic.