## Introduction to Binary Logic Circuits - by Nick Fletcher (2006)

home | page 1 | page 2 | page 3 | page 4 | page 5 | page 6

Getting back to our lights and switches, lets look at another wiring scheme. Imagine a wire with two switches on it. One switch follows the other and there is a lamp at the end. The lamp then connects back to a battery. Which switch(s) need(s) to be 'on' for power to light the lamp? Of course, the answer is both. If either switch is off(or it could be an input value of 0 remember) the lamp will not be able to receive power from the battery(ouput of 0). So, the first switch AND the second switch must be on/closed/input of 1 for any output/lit lamp/TRUE. This gate is of course the AND GATE.

Below, is the AND GATE's truth table for your viewing pleasure:

The AND Truth Table | ||
---|---|---|

input 1 | input 2 | output |

0 | 0 | 0 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 1 |

Once again, the AND GATE may have two or more inputs and one output. In an AND GATE arrangement, all the inputs must be 1/voltage/TRUE for there to be any output.

What has this got to do with a machine being able to add numbers you ask? Well, machines cannot add numbers! Machines
don't consider numbers or anything else. BUT... Machines can respond to mechanical signals, and electronic machines like a computer
can respond to electronic signals. Inside a CPU and all over the motherboard, voltages are constantly flying around. It is a common
mis-conception that zero volts is considered FALSE or ZERO and 5 volts is considered TRUE or ONE. Computers actually work with
threshold voltages. This means there are cut off points where a meaning is implied. For instance, anything below say .2 volts is
considered OFF/ZERO/FALSE; or anything above say, 3.2volts, is considered TRUE/ON/ONE etc. The only catch is that certain
components inside the computer operate at different threshhold levels! This is overcome by using amplifiers to interface modules
that differ in threshhold ratings.

I've gotten a bit off track there. Back to our GATES. By the way, the correct name for these GATES is LOGIC GATES.
Imagine a bank of three lamps. We can say that the three lamps can represent a three bit binary number. Note that **people**
are the ones who interpret what the meanings of a pattern of bits are. This is a vital point to note. If we interpret
the three lamps as binary digits, we would call the 'bit' on the right the LEAST SIGNIFICANT BIT
or LSB and the 'bit' on the left the MOST SIGNIFICANT BIT or MSB. The bit in the middle doesn't get a
special moniker! Well, the bit/lamp in the middle of three would be called bit one. The numbering starts at the right at zero.
Using only the on/off quality of the lamps, we can make 8 different codes and then map those codes to numbers. We **chose** to
interpret the lamp codes as numbers. Here is a table of the code:

Lamps as codes! | |||
---|---|---|---|

lamp2(MSB) | lamp1 | lamp0(LSB) | numeric value(Decimal) |

Off | Off | Off | 0 |

Off | Off | On | 1 |

Off | On | Off | 2 |

Off | On | On | 3 |

On | Off | Off | 4 |

On | Off | On | 5 |

On | On | Off | 6 |

On | On | On | 7 |

Using the above table, we can set our bank of lights to any number between 0 and 7. Now, to save me some
nasty HTML table work, just trust me that adding one more light to our existing three will allow us to increase
the combinations by 2. Thus, we could have 16 combinations if we introduced a four lamp panel. The combinations
could be mapped to the numerals from 0 to 15. And, you guessed it, this pattern continues ad-infinitum.

That is how electricity thresholds can be used to store and manipulate data! Simple eh? You've heard of a byte, well a
byte has eight bits. It's just like a bank of eight lamps, but instead of lamps, we have voltage thresholds that we humans
map to numbers. Think about that for a minute, then move on to the good stuff.

home | page 1 | page 2 | page 3 | page 4 | page 5 | page 6

`nickeax AT gmail.com`