Grade 10 Notes Printed - 05 - 2010 - Logic Gates

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

LOGIC GATES

Many electronic circuits operate using binary logic gates. Logic gates basically process
signals which represent true or false or the equivalent i.e. ON or OFF, 1 or 0
Whilst there are a number of logic gates, only the six simplest are covered in this booklet:
AND gate, OR gate, NOT gate, NAND gate, NOR gate and XNOR gate.
The following notes describe the function of all six gates, how to produce truth tables, how
to design networks using logic gates, and how to determine the output from a logic
network.
The six main logic gates
The most common symbols used to represent logic gates are shown below. To avoid
confusion the graphical representations will be used in exam questions but candidates may
use either set of symbols when answering questions.
Truth tables are used to show logic gate functions (refer to next section). The NOT gate has
only one input (and one output) but the other four gates have two inputs (but still only one
output).

Description of the function of the six logic gates

Input A Output X
1. NOT GATE 1 0
0 1

A X

The output (called X) is true (i.e. 1 or ON) when the INPUT A is NOT TRUE (i.e. 0 or OFF).

Input A Input B Output X


2. OR GATE 1 1 1
A 1 0 1
X 0 1 1
B 0 0 0

The output (called X) is true (i.e. 1 or ON) if the (INPUT A OR INPUT B) are true (i.e. 1 or ON).

Input A Input B Output X


3. AND GATE 1 1 1
A 1 0 0
X 0 1 0
B 0 0 0
The output (called X) is only true (i.e. 1 or ON) if the (INPUT A AND INPUT B) are both true
(i.e. 1 or ON).

©AIS LOGICS GATES COMPUTER SCIENCE Page 1 of 4


4. NOR GATE (NOT OR)
Input A Input B Output X
1 1 0
A
X 1 0 0
B 0 1 0
0 0 1
This is basically an OR gate with the output X inverted.
The output (called X) is true (i.e. 1 or ON) if NOT (INPUT A OR INPUT B) are true (i.e. 1 or
ON).

Input A Input B Output X


5. NAND GATE (NOT AND)
1 1 0
A 1 0 1
X 0 1 1
B 0 0 1
This is basically an AND gate with the output X inverted.
The output (called X) is true (i.e. 1 or ON) if (INPUT A AND INPUT B) are NOT both true (i.e. 1
or ON).

Input A Input B Output X


6. XOR GATE (EXCLUSIVE OR)
1 1 0
A 1 0 1
X 0 1 1
B
0 0 0
This is basically an OR gate with the output X as 1 only if
inputs are 0 and 1.
The output (called X) is true (i.e. 1 or ON) if (INPUT A is 0 OR INPUT B IS 1) or (INPUT A is 1
OR INPUT B IS 0)

©AIS LOGICS GATES COMPUTER SCIENCE Page 2 of 4


1. Producing the truth table from a given logic network
Example: R
P
A

In the above case first write the output at each gate and finally find when X is on.
Give names to the gates as P, Q and R
This makes it easy to find the output using the truth table.
P = A OR B
Q = A AND B
R = NOT P
X = R OR Q

Use the formula 2n to know the total number of combinations of 0s and 1s.
2 represents the two binary values 0 and 1.
n is the number of devices / sensors / inputs (A, B, C….). In this case n=2.
So 22 = 4.
A B P = A OR B Q = A AND B R = NOT P X = Q OR R
1 1 1 1 0 1
1 0 1 0 0 0
0 1 1 0 0 0
0 0 0 0 1 1

That is the method of drawing a truth table when a logic diagram with various gates is given.
Note: If the logic diagram consists of three devices A, B and C then the combinations would
be 23 = 8
A B C
1 1 1
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0

©AIS LOGICS GATES COMPUTER SCIENCE Page 3 of 4


2. Producing the Logic Diagram and truth table for a given situation.

Example:
A power station has a safety system based on three inputs to a logic network. A warning
signal (S = 1) is produced when certain conditions occur based on these 3 inputs:

Input Binary Value Plant Status


1 Temperature > 120C
T
0 Temperature < 120C
1 Cooling Water > 100 l/hr
W
0 Cooling Water < 100 l/hr
1 Pressure > 10 bar
P
0 Pressure < 10 bar

A warning signal (S = 1) will be generated if:


either (a) Temperature > 120C and Cooling Water <100 l/hr
or (b) Temperature < 120C and (Pressure > 10 bar or Cooling Water <100 l/hr)
 Draw a logic network and truth table to show all the possible situations when the
warning signal could be received.

STEP 1: Deriving the logic statement


S=1
IF
T = 1 AND W = NOT 1 (0)
OR
T = NOT 1 (0) AND (P = 1 OR W = NOT 1(0))

STEP 2: Draw the truth table STEP 3: Draw the Logic Diagram
No need for intermediate gates;
Just read the statement and fill values.
T W P S
1 1 1 0 NOT
T
1 1 0 0
1 0 1 1 AND S
1 0 0 1 W NOT OR

0 1 1 1 AND
OR
0 1 0 0
0 P
0 0 1
0 0 0 1

©AIS LOGICS GATES COMPUTER SCIENCE Page 4 of 4

You might also like