Logic - eduBuzz.org

Download Report

Transcript Logic - eduBuzz.org

Gary Plimer 2005
Logic
Making decisions
Although it may not always seem like it, electronics and electronic systems
are very logical in the way that they work. In the simplest form, if you want
a light to come on, then you press a switch. Of course, it gets more
complicated than that. Most technological systems involve making more
complicated decisions: for example, sorting out bottles into different sizes,
deciding whether a room has a burglar in it or not, or knowing when to
turn a central heating system on or off.
Gary Plimer 2005
Logic Gates
Logic gates are very useful in dealing with and processing a combination of
different inputs. This switching logic can be applied to electrical switches and
sensors, pneumatic valves or hydraulic systems. Switching logic uses logic
gates to perform decisions. In previous work you have already seen NOT,
AND and OR logic gates.
A
Z
NOT
A
B
Z
AND
A
B
Z
OR
Gary Plimer 2005
Integrated Circuits
Although logic gates have electronic symbols, they are not discrete components:
they are contained in integrated circuits. A typical example is the TTL7400 IC
shown below.
Your data book is useful tool to help identify Ics. Have a look now!
Gary Plimer 2005
Nand Logic Gate
A
0
0
1
1
B
0
1
0
1
AND NAND
Construct the circuit shown using Croc
Clips and then complete the Truth
Table.
Gary Plimer 2005
NOR Logic Gate
A
Z
B
A
0
0
1
1
B
0
1
0
1
OR
NOR
Construct the circuit shown using Croc
Clips and then complete the Truth
Table.
Gary Plimer 2005
Boolean Expressions
Each logic gate has a
corresponding Boolean
mathematical formula or
expression. The use of
these expressions saves
us having to draw symbol
diagrams over and over
again.
The name Boolean is
taken from an English
mathematician, George
Boole, who founded
symbolic logic in the
nineteenth century
Z= A
NOT
Z = A.B
AND
Z = A +B
OR
Z = A.B
NAND
Z = A +B
NOR
Gary Plimer 2005
Building up a Truth Table
Decimal equivalent 4
Say we have 3 inputs to a logic
system, using powers of 2 we
can calculate the number of
possible combinations of input to
the circuit as follows,
No. of combinations = 23 = 8
2
1
A
B
C
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
Gary Plimer 2005
Combinational Logic
So far in this unit of work we have only looked at simple logic systems on their
own. In reality, most logic systems use a combination of different types of logic
gates in one system. This type of logic control is known as combinational logic.
LIGHT
SENSO R
Lig ht
Se nso r
PRESSURE
PAD
BUZZER
SWITCH
In ve rte r
Questions
Po wer
Co nn ec tio n
Push
Switc h
OR
Ga te
Pre ssure
Pa d
AND
Ga te
Tra nsd uc e r
Drive r
Bulb
Unit
1. What is this system designed
for?
2. What is the purpose of the AND
gate?
3. Why is the inverter (NOT gate)
included?
Gary Plimer 2005
Worked Example
A
D
B
Z
C
Draw up the truth table and fill up
to point D
A
B
C
D
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
0
1
1
1
1
1
Z
Gary Plimer 2005
Worked Example
A
A
B
C
D
Z
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
1
1
0
1
1
0
0
0
0
1
0
1
0
1
1
1
0
1
1
1
1
1
1
1
D
B
Z
C
Draw up the results for point Z.
(This is the output from the OR
gate, being fed by output D and
input C only.)
Gary Plimer 2005
Pupil Assignment
C
A
Z
B
A
D
B
Draw up a truth table for each of
the following logic systems.
E
Z
C
A
D
B
A
B
C
Z
E
C
D
E
Z
Gary Plimer 2005
Logic Diagrams from T. Tables
The truth table below shows two inputs, A and B, and one output, Z.
A
B
Z
0
0
0
0
1
0
1
0
1
1
1
0
The output Z is at logic 1 in the third row
down, and we can see that for this to
happen A must be at logic 1 and B must be
at logic 0. In other words
Z = A. B
Z = A. B
Z = A AND NOT B
A
B
B
.
A B
Gary Plimer 2005
Worked Example
A
B
C
Z
0
0
0
0
0
0
1
0
1
0
0
0
1
1
1
1
0
0
0
1
0
1
0
1
1
0
1
1
1
1
0
0
Copy down the truth table into your
workbook.
Your teacher will work through the solution
with you.
Z = A. B. C
Z = A. B. C
Gary Plimer 2005
Pupil Assignments
Copy down the truth table,
then draw the logic
diagrams for each of the
following truth tables.
A
0
0
1
1
B
0
1
0
1
Z
0
1
0
0
A
0
0
1
1
B
0
1
0
1
(a)
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
(d)
Z
1
0
1
0
A
0
0
1
1
B
0
1
0
1
(c)
(b)
Z
0
0
0
0
0
1
0
1
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
(e)
Z
0
1
1
0
Z
0
1
0
0
0
1
0
0
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
(f)
Z
1
0
0
1
0
0
0
1
Gary Plimer 2005
Logic Diagrams from a Spec
Worked example
A burglar alarm system is to sound if a master switch is on and either a light beam
is broken or a pressure pad is stood on.
Draw a logic diagram and a truth table for this system.
Read the specification carefully. You should notice that it has three inputs. These
are:
a master switch (M)
a light sensor (L), and
a pressure pad (P).
It has one output, an alarm bell (B).
The bell should go to logic 1 if the master switch is at 1 and either the light beam
goes to logic 0 or the pressure pad goes to logic 1. This can be written in Boolean
as:
B
=
M . (L + P )
Gary Plimer 2005
Logic Diagrams from a Spec
M
L
P
B
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
1
1
0
1
1
1
1
0
0
1
1
1
1
M
B
P
L
L
The truth table for this system is
shown below. Again, all you have to
do is read the specification carefully
and then read across each row, one
at a time, and decide whether the
bell should be ringing or not.
Gary Plimer 2005
Pupil Problems
1) A house doorbell is to ring if a push button at the front door, a push
button at the back door or both buttons are operated. Draw a logic
diagram and write a Boolean equation.
2) A lift motor is to start only when by closing the door, a switch is
actuated and a passenger has pressed a button. Prepare a truth
table, a logic diagram and a Boolean equation for this system.
3) The driver of a dustcart is to be able to operate the loading claw by
pressing a button, but only when the senior loader at the rear of the
cart has pressed a button to give the ‘all clear’. Draw a logic diagram
and write a Boolean equation for this system.
4) An automatic central heating system is to heat the radiators (R) if
the mains switch (M) is on, the timing control switch (T) is closed
and the override button (O) is not selected. Draw a logic diagram,
truth table and Boolean statement for this system.
Gary Plimer 2005
Pupil Problems
5) A drill is to operate if an isolator is closed, a guard is in
place (closing a micro switch), either ‘HI’ or ‘LOW’ speed is
selected and a foot pedal is operated. Draw a suitable
logic diagram for this system. Write the Boolean
Expression.
6) A large hall has three temperature sensors. A logic system
is to operate the radiator when any two of the temperature
sensors fall below a preset level. Draw up a truth table for
this system and draw a logic diagram.
7) A burglar alarm will operate if the mains switch is on and
either an electronic beam is broken, a pressure pad is stood
on or a window is opened. Draw a logic diagram for this
system.
Gary Plimer 2005
SOLUTIONS
1)
2)
3)
Gary Plimer 2005
SOLUTIONS
4)
(O.T).M = R
Gary Plimer 2005
SOLUTIONS
5)
I
G
H
L
FP
Gary Plimer 2005
SOLUTIONS
6)
S1
S2
S3
Gary Plimer 2005
SOLUTIONS
7)
M
EB
PB
W
Gary Plimer 2005
Logic Gate Integrated Circuits
Integrated circuits consist of plastic cases filled with electronic circuitry. There
are many resistors, transistors and other components packed into the chips.
There are literally thousands of ICs on the market, all designed to do different
jobs – logic gates, amplifiers, timers, etc
Gary Plimer 2005
TTL Integrated Circuits
There are two main types of Integrated Circuit, (IC)
 TTL (Transistor - Transistor Logic)
TTL Advantages
- Very fast switching speed.
- Unused pins can be left to float, unattached.
TTL Disadvantages
- Low fan out (number of subsequent gates it can
drive).
- Requires a stabilised voltage supply, (5V).
Gary Plimer 2005
CMOS Integrated Circuits
 CMOS (Complementary Metal Oxide Semiconductor)
CMOS Advantages
- High fan out (number of subsequent gates it can
drive).
- Works on a wide supply voltage, (5 – 15V)
CMOS Disadvantages
- Slower response / switching time.
- Unused pins must be tied to supply rails.
Gary Plimer 2005
TTL Integrated Circuits
In our work we will only consider TTL. However, you need to remember the
advantages / disadvantages of each type.
All TTL chips have a four-digit code number, which always starts with 74.
For example, a 7400 is a quad two-input NAND chip.
Although the chip contains complex circuitry, the internal wiring can be
shown as simple logic circuits with the inputs and outputs of each logic
gate shown. This is called a pin-out diagram. Your Data book lists the
most common IC’s
+Vcc
14
13
12
11
10
9
8
1
2
3
4
5
6
7
Pin 14 is connected to the 5volt stable supply and pin 7
to 0 volts
Gnd
(0V)
Gary Plimer 2005
Prototype Board
Prototype board is used to
build prototype circuits.
5 volts
It is much better to test a
circuit on prototype board
before mass producing the
circuit.
7400
220R
LED
Why do you think this
might be?
0 volts
Gary Plimer 2005
Pin Out Diagrams
+Vcc
ICs are impossible to use
without the manufacturer’s
data sheets to show what
facilities are available on the
chip and how the pins are to
be connected.
These data sheets contain
pin-out diagrams. A pin-out
diagram is a graphical layout
of the chip and its contents.
+Vcc
14
13
12
11
10
9
1
2
3
4
5
6
8
14
13
12
11
10
9
7
1
2
3
4
5
6
Gnd
(0V)
7404
+Vcc
8
7
Gnd
(0V)
7400
+Vcc
14
13
12
11
10
9
1
2
3
4
5
6
8
14
13
12
11
10
9
7
1
2
3
4
5
6
Gnd
(0V)
7421
+Vcc
8
7
Gnd
(0V)
7420
+Vcc
14
13
12
11
10
9
1
2
3
4
5
6
7427
8
14
13
12
11
10
9
7
1
2
3
4
5
6
Gnd
(0V)
7432
8
7
Gnd
(0V)
Gary Plimer 2005
Pin Out Diagrams
+Vcc
The description of each pinout diagram gives details of
the chip.
For example, a ‘dual fourinput NOR’ means the chip
has two (dual) NOR gates
on it, each having four
inputs.
A ‘quad two-input AND’
means the chip has four
AND gates, each gate
having two inputs.
+Vcc
14
13
12
11
10
9
1
2
3
4
5
6
8
14
13
12
11
10
9
7
1
2
3
4
5
6
Gnd
(0V)
7404
+Vcc
8
7
Gnd
(0V)
7400
+Vcc
14
13
12
11
10
9
1
2
3
4
5
6
8
14
13
12
11
10
9
7
1
2
3
4
5
6
Gnd
(0V)
7421
+Vcc
8
7
Gnd
(0V)
7420
+Vcc
14
13
12
11
10
9
1
2
3
4
5
6
7427
8
14
13
12
11
10
9
7
1
2
3
4
5
6
Gnd
(0V)
7432
8
7
Gnd
(0V)
Gary Plimer 2005
Pin-out and wiring diagrams
INPUT A
OUTPUT
INPUT B
Your teacher will show you how to convert this logic circuit into a pin
out diagram
Gary Plimer 2005
Pupil Assignment
INPUT A
OUTPUT
INPUT B
Draw a pin out diagram for each of
the following combinational logic
circuits.
A
Z
B
A
Z
B
A
Z
B
Gary Plimer 2005
Pupil Assignment
A
B

Copy each of the
shown logic diagrams
into your workbook.
C

Construct a truth table
for each.
A

Construct a Boolean
equation for each.

Draw a pin out diagram
for each.

Simulate using Croc
Clips to confirm your
truth table.
B
Z
Z
C
A
Z
B
Gary Plimer 2005
Test Equipment
PULSE
RUBBISH
RUBBISH
LO
HI
When trying to establish logic levels within a complex system or to monitor
a logic output without using an LED, we use a digital logic probe.
The logic probe is powered from the same supply as the logic circuit being
tested and the needle point is pushed against the various pins on the IC
to test their logic level. Normally the logic probe gives out a high-pitched
sound and a red LED lights if the pin being tested is at logic 1. If the point
tested is at logic 0, a low-pitched sound is emitted and a green LED lights.
Your teacher will allow you to test a simple circuit using the logic probe.