Robotics C++ Physics II AP Physics B Electronics Java Astronomy Other Courses Summer Session  

Basic Logic Gates

 

Introduction

The Inverting Circle

AND Gate

NOR Gate

Videos

Logic Gate Symbols

Truth Tables

NAND Gate

EX-OR Gate

Inputs and Outputs

NOT Gate (Inverter)

OR Gate

EX-NOR Gate

 

 

 

Introduction

A logic gate performs a logical operation on one or more logic inputs and produces a single logic output. The logic normally performed is Boolean logic and is most commonly found in digital circuits. Logic gates are primarily implemented electronically using diodes or transistors, but can also be constructed using electromagnetic relays (relay logic), fluidic logic, pneumatic logic, optics, molecules, or even mechanical elements.

In electronic logic, a logic level is represented by a voltage or current, (which depends on the type of electronic logic in use). Each logic gate requires power so that it can source and sink currents to achieve the correct output voltage. In logic circuit diagrams the power is not shown, but in a full electronic schematic, power connections are required.

Logic gates process signals which represent true or false. Normally the positive supply voltage +Vs represents true and 0V represents false. Other terms which are used for the true and false states are shown in the table on the right. It is best to be familiar with them all.

Gates are identified by their function: NOT, AND, NAND, OR, NOR, EX-OR, and EX-NOR. Capital letters are normally used to make it clear that the term refers to a logic gate.

Note that logic gates are not always required because simple logic functions can be performed with switches or diodes: 

 

Logic Gate Symbols



Inputs and Outputs

Gates have two or more inputs, except a NOT gate which has only one input. All gates have only one output. Usually the letters A, B, C and so on are used to label inputs,
and Q is used to label the output. On this page the inputs are shown on the left and the output on the right.

The inverting circle (o)

 Some gate symbols have a circle on their output which means that their function includes inverting of the output. It is equivalent to feeding the output through a NOT gate. For example the NAND (Not AND) gate symbol shown on the right is the same as an AND gate symbol but with the addition of an inverting circle on the output.

 

 

Truth Tables

 

A truth table is a good way to show the function of a logic gate. It shows the output states for every possible combination of input states. The symbols 0 (false) and 1 (true) are usually used in truth tables. The example truth table on the right shows the inputs and output of an AND gate.

NOT gate (inverter)

The output Q is true when the input A is NOT true, the output is the inverse of the input: Q = NOT A. A NOT gate can only have one input. A NOT gate is also called an inverter.

 

AND gate

The output Q is true if input A AND input B are both true: Q = A AND B. An AND gate can have two or more inputs, its output is true if all inputs are true.

 

 

NAND gate (NAND = Not AND)

This is an AND gate with the output inverted, as shown by the 'o' on the output. The output is true if input A AND input B are NOT both true: Q = NOT (A AND B)
A NAND gate can have two or more inputs, its output is true if NOT all inputs are true.

 

 

OR gate

The output Q is true if input A OR input B is true (or both of them are true): Q = A OR B. An OR gate can have two or more inputs, its output is true if at least one input is true

 

 

NOR gate (NOR = Not OR)

This is an OR gate with the output inverted, as shown by the 'o' on the output. The output Q is true if NOT inputs A OR B are true: Q = NOT (A OR B)
A NOR gate can have two or more inputs, its output is true if no inputs are true.

 

 

EX-OR (EXclusive-OR) gate

The output Q is true if either input A is true OR input B is true, but not when both of them are true: Q = (A AND NOT B) OR (B AND NOT A). This is like an OR gate but excluding both inputs being true. The output is true if inputs A and B are DIFFERENT. EX-OR gates can only have 2 inputs.

 

 

EX-NOR (EXclusive-NOR) gate

This is an EX-OR gate with the output inverted, as shown by the 'o' on the output. The output Q is true if inputs A and B are the SAME (both true or both false): Q = (A AND B) OR (NOT A AND NOT B). EX-NOR gates can only have 2 inputs.
 

Videos

 

Binary Numbers, 6 minutes

http://www.youtube.com/watch?v=ajNVKA3TDzA&feature=related 

 

Binary Numbers and Binary Logic, 7 minutes

http://www.youtube.com/watch?v=rXirCAesLrQ&feature=related

 

Logic Gates, 9 minutes

http://www.youtube.com/watch?v=W8Lni-8NKNQ

 

And Or Gates, 6 minutes

http://www.youtube.com/watch?v=8DnyirbCEjA&feature=related