basic digital logic: nand and nor gates technician series ©paul godin last update dec 2014

37
Basic Digital Logic: NAND and NOR Gates Technician Series ©Paul Godin Last Update Dec 2014

Upload: merryl-walker

Post on 13-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Basic Digital Logic:NAND and NOR Gates

Technician Series

©Paul Godin

Last Update Dec 2014

The Universal Gates:NAND and NOR

Combinational logic

◊ How would your describe the output of this combinational logic circuit?

A

B

Z

Basic Gates 2.3

NAND Gate

◊ The NAND gate is the combination of an NOT gate with an AND gate.

The Bubble in front of the gate is an inverter.

A

B

Z

Basic Gates 2.4

NAND Gate

◊ IEEE Symbol

◊ Boolean equations for the NAND gate:

&

A●B = x

AB = x

The triangle is the same as the bubble.

Basic Gates 2.5

Combinational logic

◊ How would your describe the output of this combinational logic circuit?

B

AZ

Basic Gates 2.6

NOR gate

◊ The NOR gate is the combination of the NOT gate with the OR gate.

The Bubble in front of the gate is an inverter.

B

AZ

Basic Gates 2.7

NOR Gate

◊ IEEE Symbol for a NOR gate:

◊ Boolean equation for a NOR gate:

≥1

A+B = x

Basic Gates 2.8

Exercise 1

Complete the Truth Table for the NAND and NOR Gates

Input Output

0 0

0 1

1 0

1 1

Input Output

0 0

0 1

1 0

1 1

NAND NOR

Hint: Think of the AND and OR truth tables. The outputs for the NAND and NOR are inverted.

Basic Gates 2.9

Exercise 2

◊ Turn the NAND and NOR gates into inverter (NOT) gates. Hint: Look at the Truth Table.

Basic Gates 2.10

Exercise 3

◊ Draw the following circuit: AB + BC

Basic Gates 2.11

Exercise 4

◊ Describe the function of a NAND gate, starting with the term “If any input...”

◊ Describe the function of a NOR gate, starting with the term “If any input...”

Basic Gates 2.12

DeMorgan

DeMorgan Theorem

◊ The DeMorgan Theorem describes a method for converting between AND/NAND and OR/NOR operations.

◊ The theorem states:

A ● B = A + B

A + B = A ● B

“Break the bar and change the sign”Basic Gates 2.14

DeMorgan

An example of DeMorgan:

AB + BC

ABC

1

2

3

4

Original Equation

DeMorgan applied to NOR expression

Double inversions cancel

Simplified expression

AB ● BC

AB ● BC

Basic Gates 2.15

DeMorgan Exercise 1

Use DeMorgan to simplify the following expressions

A+B+C

AB

AB + C+D

“Break the bar and change the sign”Basic Gates 2.16

Universal Gates

◊ The NAND and NOR gates are considered Universal Gates. They can be used to create any other gate.

◊ Using universal gates is an important aspect of digital logic design.

Examples provided in class.

Basic Gates 2.17

NAND and NOR as NOT

ZA

VccA Z

Method 1

A Z

Method 1

A Z

Method 2

A

Z

Method 2

Basic Gates 2.18

NAND and NOR as AND

ZB

A

ZB

A

AB = AB = A+B (DeMorgan)

A

ZB

Basic Gates 2.19

NAND and NOR as OR

A+B = A+B = AB (DeMorgan)

ZB

A

A

ZB

ZB

A

Basic Gates 2.20

Universal Gates Exercise 1

◊ Convert NAND as NOR

◊ Convert NOR as NAND

Basic Gates 2.21

Example: Universal Gates

Convert the following circuit to NAND only:

Convert each of the gates in the circuit to its NAND equivalent and progressively re-draw the circuit.

Additional Examples given in class

Basic Gates 2.22

Active Input States

Digital 1’s and 0’s

◊ In a binary system, the logic 1’s are as important as the logic 0’s. A “0” is a signal also.

◊ When the “0” forces a change it is called Active Low (the low causes the action).

◊ When the “1” forces a change it is called Active High (the high causes the action).

Basic Gates 2.24

Active Low State

◊ Many, many devices use the logic low to cause something to change.◊ Resets and presets on digital devices◊ Communication systems

◊ Active low inputs are indicated with either an overbar on the input label, and/or a bubble in front of the output.

Basic Gates 2.25

Reset

Comparison of Active States

A logic 0 causes the LED

to light up

A logic 1 causes the LED

to light up

Vcc

Basic Gates 2.26

Alternate Gate Representations

Comparison of Active Inputs

A ZB

Active Low InputsActive High Output

Active High InputsActive Low Output

ZBA

Basic Gates 2.28

Bubble to Bubble

◊ Alternate gate representations can make circuit analysis faster.

◊ A bubble attached to a bubble means the bubbles cancel.

Basic Gates 2.29

=Bubbles Cancel

Bubble to Bubble Cancellation Example

Basic Gates 2.30

2 Z1ABC

In this example with bubble-to-bubble representation, the output bubble from gate 1

cancels with the input bubble from gate 2.

This makes it easy to quickly determine that if either A or B inputs are low, outcome Z is low.

2 Z1ABC

Alternate Representations

◊ The “bubble” on a gate represents inversion.

◊ In many cases it is easier to follow the circuit logic if “bubble” outputs are linked to “bubble” inputs

◊ Cancelled bubbles helps make the active input state more easily visible for troubleshooting

Basic Gates 2.31

Example use of Alternate Representation

◊ The output is active when the input state is a 101

◊ Note how much easier it is to see the active input at a glance using a bubble instead of a NOT gate.

Z

CBA

Basic Gates 2.32

Example of Alternate Representation

A

ZB

ZB

A

A

ZB

Equals

Equals

A+B = AB (DeMorgan)

Basic Gates 2.33

Alternate Representation

ZBA

Z

A Z A Z

AZB

AB

ZBA

ZBA Z

A ZB

AB

ZBA

Basic Gates 2.34

Alternate Representation Exercise

Z

A ZB

AB

Z

A ZB

AB

Identify the gate that is alternately represented

Basic Gates 2.35

Alternate Representation Exercise ANSWERS

Z

A ZB

AB

Z

A ZB

AB

Identify the gate that is alternately represented

Basic Gates 2.36

END©Paul R. Godin

prgodin°@ gmail.com

Demorgan!

Quit changing the signs!

Basic Gates 2.37