Transcript Document

Lab 1:Logic Gate Systems :
Slide #2
Binary Number System:
Slide #3
Decimal Numbers:
Slide #4
Binary Number Conversion:
Slide #5
Switches and LED’s:
Slide #6
The NOT gate:
Slide #7
The OR gate:
Slide #8
The AND gate:
Slide #9
NOR Gate:
Slide #10
NAND Gate:
Slide #11
XOR and XNOR Gate:
Slide #12
NOR / NAND Alternate Symbols:
Slide #13
Rule for using alternate symbols:
Slide #14
Logic Gate Equations:
Slide #15
Vending Machine System:
Lab 1 : Binary Number System:
We will use a car odometer to learn about the binary number system. A car
odometer (non-digital) consists of a series of plastic discs that rotate to track
the distance traveled by a car.
A decimal odometer has the outer edge of
each disc numbered from 0 … 9. Three
discs will allow the odometer to record a
maximum distance traveled of 999 Km’s.
A binary odometer has the outer edge of
each disc numbered with only 0 and 1.
Using 3 discs will allow the odometer to
record a maximum distance traveled of 111
binary Km’s … or … 7 km’s. Proceed to
watch the odometer in action.
0
0
0
1
0
1
0
1
0
3 Bit Binary
From the odometer example, you can place
the 3 bit numbers in a table and see the
order of the first 8 binary numbers.
Slide #2
Decimal
Equivalent
0
0
0
0
0
0
1
1
0
1
0
2
0
1
1
3
1
0
0
4
1
0
1
5
1
1
0
6
1
1
1
7
Driver
Viewing
Window
Lab 1 : Decimal Numbers :
Reviewing some fundamental facts about the decimal number system will help you
learn the binary number system.
The decimal positional weight chart (PWC).
Each numeral of a decimal number occupies a position that has a weight. Here is the decimal PWC.
Hundreds
Tens
Thousands
103
102
101
100
2
3
5
One’s
10-1
10-2
5 one’s
3 tens
2 Hundreds
The weight of each position have been given names.
A decimal point is used to separate the whole part and the fractional part of a number.
Here is the decimal number 235 placed in the PWC.
Slide #3
Lab 1 : Binary Number Conversions :
Digital systems process data in binary format. It is important to know how to
convert back and forth from binary to decimal.
Binary numbers are part of a base 2 number system. Only two numerals exist: 1 and 0.
Converting binary to decimal:
Drop the binary number into the binary PWC to convert it to decimal. Example convert 11012 to decimal.
23
22
21
20
… Or …
Binary PWC
8
4
2
1
1
1
0
1
= 1x8 + 1x4 + 0x2 + 1x1 = 8+4+0+1 = 1310
Converting decimal to binary: Example: convert 2510 to binary
Write down a binary PWC which the MSB (most significant bit) surpasses the number you are trying to convert.
Work from MSB and use a 1 to include the bit position and a 0 to exclude it. The included bits should have their
weight add up to the number being converted.
Exclude
Include
because
because
16
16
+
+does
+does
124will
will
Include
Exclude
because
because
16
16
+
+8888+
+not
will
not
Exclude
because
it
would
make
exceed
equal
25.
25.
32 16
8
4
2
1
exceed
25.
number larger than 25
0
Slide #4
1
1
0
0
1
Lab 1 : Switches and LED’s:
Students can create and test digital systems by using switches to represent binary
input data and using LED’s (light emitting diode) to represent binary output data.
Digital systems have an input side and an output side. Each arrow is a connection wire.
The inputs of a digital system are binary digits (bits). You either input a binary 1 (logic 1) or a
binary 0 (logic 0). The digital system processes the signals you have applied to the input and
responds with binary 1 or binary 0 at the output(s).
5 volts represents a logic 1 and a 0 volts (also called GROUND or Gnd) represents a logic 0.
The digital system is powered up by a 5 Volt power supply.
A switch can be used to input a logic 1 and logic 0. An LED can be connected to the output to
see the digital system’s response. Continue and you will see the switch and LED in action.
5v
5v
Input
Logic 1
Logic 0
Slide #5
Output
Digital
System
ON
OFF
Lab 1:The NOT Gate (inverter):
The NOT gate is the first of the three fundamental logic gates. You will learn
its operation using Truth Table analysis and an animation.
Truth Table: Is a chart that lists the input condition on the left and the
gate’s output response on the right. The table shows that the NOT gate
responds at the output with the inverse of the signal applied to the input.
A
X
0
1
1
0
Animation: In order to see how it works, the gate has been connected to a switch and LED.
Continue to see the system in action…
5v
Input A
Logic 1
Logic 0
Slide #6
Output X
OFF
ON
Lab 1: The OR Gate:
The OR gate is the second of three fundamental logic gates. You will learn its
behaviour using a Truth Table analysis and an animation.
Truth Table: The table shows that the OR gate responds with a high at the output if
the signal applied to the input A or B is high.
Animation: In order to see how it works, the gate has been connected to 2 switches and LED.
Continue to see the system in action…
5v
OR
Logic 1
0
5v
Input A
Input B
5v
Logic 1
0
Slide #7
Output X
Logic 1
0
A
B
X
0
0
0
0
1
1
1
0
1
1
1
1
Lab 1: The AND Gate:
The AND is the last of the remaining fundamental logic gates. You will learn its
behaviour using a Truth Table analysis and an animation.
Truth Table: The table shows that the AND gate responds with a high at the output if
the signal applied to the input A and B are both high.
Animation: In order to see how it works, the gate has been connected to 2 switches and LED.
Continue to see the system in action…
5v
Logic 1
0
AND
Input A
Input B
5v
Logic 1
0
Slide #8
5v
Output X
Logic 1
0
A
B
X
0
0
0
0
1
0
1
0
0
1
1
1
Lab 1 : NOR Gate
The NOR gate is equivalent to an OR gate with a NOT gate connected to its output.
NOR comes from the words Not OR. Continue to see the standard symbol for NOR.
NOR Symbol
Truth Table: The table shows that the NOR gate responds with a low at the output if
the signal applied to the input A or B is high.
System animation: In order to see how it works, the gate has been connected to 2 switches
and LED. Continue to see the system in action…
5v
NOR
Logic 0
1
5v
Input A
Output X
Input B
5v
Logic 1
0
A
B
X
0
0
1
0
1
0
1
0
0
1
1
0
Logic 0
1
Boolean Equation: here is the equation for the NOR gate.
Slide #9
X AB
Lab 1 : NAND Gate
The NAND gate is equivalent to an AND gate with a NOT gate connected to its
output. NAND comes from the words Not AND. Continue to see the standard symbol
for NAND.
NAND Symbol
Truth Table: The table shows that the NAND gate responds with a low at the output
if the signal applied to the input A and B is high.
System animation: In order to see how it works, the gate has been connected to 2 switches
and LED. Continue to see the system in action…
5v
NAND
Logic 0
1
5v
Input A
Output X
Logic 1
0
Input B
5v
A
B
X
0
0
1
0
1
1
1
0
1
1
1
0
Logic 0
1
Boolean Equation: here is the equation for the NAND gate.
Slide #10
X  AB
Lab 1 : XOR Gate
The XOR gate is an exclusive OR gate. It will output a logic 1 if there is an exclusive
logic 1 at input A or B. Exclusive means: Only one input can be high at one time.
Truth Table: The table shows that the XOR gate responds with a high at the output
if the signal applied to the input A or B is high (but not both high).
XOR
Input A
Output X
Input B
A
B
X
0
0
0
0
1
1
1
0
1
1
1
0
XOR Boolean Equation:
X  AB
The XNOR gate is an exclusive OR gate with an NOT gate at the output. It will output
a logic 0 if there is an exclusive logic 1 at input A or B.
XNOR
Input A
Input B
Slide #11
Output X
A
B
X
0
0
1
0
1
0
1
0
0
1
1
1
XOR Boolean Equation:
X  AB
Lab 1 : NOR and NAND Gate Alternate Symbols:
The NAND and NOR logic gate symbols you have studied are called the
“standard” symbols. Each gate also has an “alternate” symbol.
NOT
The “standard” logic symbols
for the NAND and NOR gates
indicates a gates response to
“logic 1” at the input.
NOR
A B
X
A B
X
0
0
1
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
0
NAND
Alternate NOR GATE: The bubbles at the input
of the NOR gate implies that a “logic 0” at input A
and a “logic 0” at input B are required to produce
a “logic 1” at output X (NO bubble at output).
Alternate NAND GATE: The bubbles at the input of the NAND gate implies
0 =to1produce a
that a “logic 0” at input A or a “logic 0” at input B 0
areAND
required
0 OR 0 = 1
“logic 1” at output X (NO bubble at output).
Slide #12
Alternate NOR
Alternate NAND
Lab 1 :Rule for Using the Alternate symbols :
The basic logic gates AND, OR, and NOT have standard logic symbols and alternate
logic symbols. A general rule for using alternate symbols exists. The rule is a guide and
not a strict rule. Some designers do not use the rule but many do.
=
=
Standard
Alternate
The rule is simple : Active high device connects to active high symbol : Active low device connects to the active
low symbol.
Example: Connect an LED to an AND gate:
There are two types of LED connections.
5V
A logic 1 lights the LED
1
Active High
LED
A logic 0 lights the LED
0
Active Low
LED
Active high device connects to active high symbol (standard).
Active low device connects to the active low symbol (alternate).
Slide #13
Lab 1 : Logic Gate Equations :
Each logic gate has a Boolean equation to represent its operation.
Input A
NOT
Output X
Boolean Equation:
XA
Boolean Equation:
Input A
AND
Output X
Input B
Input A
Input B
Slide #14
OR
X  AB
Boolean Equation:
Output X
X AB
Lab 1 : Vending Machine System:
Design a logic system for a vending machine that will dispense a 75 cent surprise gift
package if any of the following conditions occur… Three quarters are inserted. A dollar is
inserted. The machine can only accept quarters and a dollar coin / note.
Step 1: Declare Inputs and Outputs:
Inputs : Quarters (Q1, Q2, Q3). Dollar (L). Logic 1 = currency present.
Outputs : Package (P). Quarter Change (C). Logic 1 = dispense item.
1
Q3 0
1
Q2 0
0
Q1 1
0
1
L
1 Q1 • Q2• Q3
0
1
0
L
0
1
0
1
P =•+ L
0
1
C
1
Step 2: Generate Equation for the system:
1
1
Dispense Package if Quarter1 and Quarter2 and Quarter3 OR Dollar is inserted.
Dispense change if dollar is inserted.
C2
Once the system diagramP is=complete
it can
Q1 • Q2•
Q3be+used
L to test the operationCof=the
L system.
Here is what happens when someone inserts 3 quarters.
Here is what happens when someone inserts
P-Term
a dollar.
: thus : P = • + L
Here is what happens when someone searches their pocket finds a quarter and inserts it into the machine.
Then they realize that they do not have 2 more quarters! If they insert a dollar what would be the result?
Step
Draw
thepackage
Digital and
System
Diagram
: be dispensed. The un-happy user of the machine would have paid
The 3:
result
: The
the change
would
$1 ($1.25
- $0.25
To resolve
this
problem
extra This
change
output
could
be added.
Group
variables
thatchange).
are ANDed
together
into
a singleanblock.
block
is called
product
term (P-Term).
Work from output towards input. P must be connected to an OR gate.
Slide #15
Re-insert the P-Term (Q1 • Q2• Q3). A 3 input AND gate is required.
Connect L to OR gate and connect C to L (C=L).