## 2: Digital Logic Gates

TOPIC 1: The Basic Logic Element (Audio)

The basic logic element or gate is an electronic device that has one or more digital inputs and one digital output.  Each gate has a rule by which it operates.  The inputs and outputs we discuss in logic gates are digital and will either be on or off, a 1 or a 0, true or false, 5V or 0V.

The AND gate follows the rule, “If input A AND input B are both a 1 then the output is a 1 otherwise the output is a 0.”  The AND gate can have more than two inputs.  When it does, all inputs must be a 1 before the output is a 1. (Audio) The OR gate follows the rule, “If either input A OR input B is a 1 then the output is a 1 otherwise if both inputs are a 0 then the output is a 0.”  The OR gate can also have more than two inputs.  When it does only one input has to be a 1 before the output will be a 1. (Audio) The NOT gate, or inverter, has only one input and follows the rule, “If the input is a 1 then the output is a 0 and if the input is a 0 then the output is a 1.”  The NOT gate cannot have more than one input. (Audio) The NAND gate follows the rule based on where it gets its name, NOT AND.  “If both inputs are a 1 then the output is a 0, otherwise the output is a 1.”  The NAND gate can have more than two inputs.  When it does the output will be a 1 unless all inputs are a 1. (Audio) The NOR gate follows the rule based on where it gets its name, NOT OR.  “If either input A OR input B is a 1 then the output is a 0, otherwise if both inputs are a 0 the output is a 1.”  The NOR gate can have more than two inputs.  When it does the output will be a 0 unless all inputs are a 0. (Audio) The XOR gate follows the rule based on where it gets its name, Exclusive OR.  The XOR excludes one state from the OR gate, that is when both inputs are a 1, no longer is the output a 1 as it was in the OR gate but it is a 0.  Therefore our rule for the XOR gate is, “If the two inputs differ, that is if one input is a 1 and the other is a 0, then the output is a 1 otherwise the output is a 0.  The XOR can have more than two inputs but this is rare and is normally considered as a cascaded set of gates.  When this occurs the output is a 1 when there are an odd number of inputs that are a 1 and a 0 when there are an even number of inputs that are a 1. (Audio) There are other gates, namely the XNOR (opposite of the XOR) drawn like the XOR with a circle on the output.  The truth table is the opposite of that of the XOR.

TOPIC 3:  Other Information on Gates

The inputs and outputs in a gate behave as follows.  If the voltage is anywhere between 0 and the logic 0 threshold the gate interprets it as a 0.  If the voltage is anywhere between the maximum voltage and the logic 1 threshold the gate interprets it as a 1.  If the voltage is anywhere in between the thresholds, it is considered floating and will produce unexpected and inconsistant results.  The voltages labeled as threshold are only examples and shouldn’t be understood as standard.  (Audio) Just like an operational amplifier, the logic gate has connections to a power supply and ground as shown below.  (Audio) Again just like an operational amplifier, the logic gate includes more than one gate inside each chip and has a pin diagram.  Pin 1 on any logic chip is the bottom left pin when the orientation indicator (dot, indentation, or notch) is on the left. You should now be prepared to begin the assessment game.  If you hit a score of 2000 you are guaranteed an 80%, after that you are competing with your peers.  The highest score gets 100%. To determine other grades (if your score is greater than 2000) I will take 80+ (your score-2000) x (20/((the highest score) – 2000)).  If your score is less than 2000 your grade will be (80/2000)x(your score).