Вы находитесь на странице: 1из 25

Digital Design

Lecture 4

LOGIC GATES & FUNCTIONS


Dr. PO Kimtho
Department of Computer Sciences
Norton University (NU)

Binary and Logic


All digital systems use the binary numbering system
Hardware implementation of switches (ON / OFF)
With hardware there will be input and output nodes
Nodes are variables which represent bits in binary numbers

n number of input variables will tell the system that there are
2n possible conditions to perform
eg : 4 variables = 24 = 16 conditions
Truth tables are developed to list the output result

Binary and Logic


Example :
2 variables will have 4 possible input condition for a system to
respond

Logic Truth Table


INPUT

OUTPUT

Input nodes

Output nodes

A
System
B

Binary and Logic


Switching systems in digital or logic circuits are

called gates
Basic gate elements :
Inverter

AND
OR
NAND
NOR
XOR
XNOR

Logic Gate : Inverter


The inverter performs the Boolean

NOT operation. When the input is


LOW, the output is HIGH; when the
input is HIGH, the output is LOW.

The NOT operation is shown with a

Input

Output

bar on top of the variable. Thus, the

Boolean expression for an inverter

0
1

1
0

is X = A

A bar or not A

Known also as complement operation

Logic Gate : Inverter


Example waveforms:

A
X

Signed binary number


Can be used to form
the 1s complement of a
binary number / data

1s complement

Logic Gate : AND Gate


The AND gate produces a HIGH
output when ALL INPUTS are HIGH;

otherwise, the output is LOW. For a

2-input gate, the truth table is

Inputs

Output

0
0
1
1

0
1
0
1

0
0
0
1

Can be written with a dot between


the variables but it may be implied

(no dot). Thus, the AND operation is


written as X = A .B or X = AB.

Logic Gate : AND Gate


Example waveforms:
A
B
X

1
0

Can be used in computer


programming as a mask
selector.

0
0

1
0

1
1

Logic Gate : OR Gate


The OR gate produces a HIGH
output when ANY INPUTS are HIGH;

otherwise, the output is LOW. For a

2-input gate, the truth table is

Inputs

Output

0
0
1
1

0
1
0
1

0
1
1
1

Written with a plus sign (+) between


the variables. Thus, the OR

operation is written as X = A + B.

Logic Gate : OR Gate


Example waveforms:

A
B
X

ASCII code for A


1
0
0
0

Can be used in computer


programming as a data
converter.

ASCII code for a

0
0

0
0

1
0

Logic Gate : NAND Gate


The NAND gate produces a LOW
output when ALL INPUTS are HIGH;

otherwise, the output is HIGH. For

a 2-input gate, the truth table is

Inputs

Output

0
0
1
1

0
1
0
1

1
1
1
0

Can be written with a dot between


the variables with an overbar along

both variables. Thus, the NAND


operation is written as X = A .B
or alternatively X = AB.

Logic Gate : NAND Gate


Example waveforms:
A
B
X

The NAND gate is particularly useful because it is a


universal gate all other basic gates can be constructed
from NAND gates.
Example : An inverter

Logic Gate : NOR Gate


The NOR gate produces a LOW
output when ANY INPUTS are HIGH;

otherwise, the output is HIGH. For

a 2-input gate, the truth table is

Inputs

Output

0
0
1
1

0
1
0
1

1
0
0
0

Written with a plus sign (+) between


the variables with an overbar along

both the variables. Thus, the NOR


operation is written as X = A + B.

Logic Gate : NOR Gate


Example waveforms:

A
B
X

Can be used in computer programming to control active low operations.

Example : Activating water flows when water tanks are low

Logic Gate : XOR Gate


The Exclusive OR or XOR gate only
produces a HIGH output only when

BOTH INPUTS ARE ON OPPOSITE

LEVEL. For a 2-input gate, the truth


table is

Inputs

Output

0
0
1
1

0
1
0
1

0
1
1
0

Written with a circled plus sign ( + )


between the variables. Thus, the

XOR operation is written as


X = A + B.

Logic Gate : XOR Gate


Example waveforms:
A
B

Logic Gate : XNOR Gate


The Exclusive NOR or XNOR gate
only produces a HIGH output when

BOTH INPUTS ARE THE SAME

LEVEL. For a 2-input gate, the truth


table is

Inputs

Output

0
0
1
1

0
1
0
1

1
0
0
1

Written with a circled plus sign ( + )


between the variables and an

overbar. Thus, the XNOR operation


is written as X = A + B.

Logic Gate : XNOR Gate


Example waveforms:
A
B

Logic Integrated Circuits


Combinations of basic gates lead to the development of

integrated circuits, ICs.


Two types
Fixed function logic ICs

Programmable Logic ICs

Technology evolution
TTL (transistor-transistor logics using Bipolar Junction Transistor)
CMOS (complementary metal oxide semiconductor)
BiCMOS (Bipolar + CMOS)

Logic Integrated Circuits


Fixed Function Logic

0.335 0.334 in.


0.740 0.770 in.
14 13 12 11 10 9

14 13 12 11 10

0.228 0.244 in.

7
1

Pin no.1
identifiers

0.250 0.010 in.


1

Lead no.1
identifier

14
1

14
1

DIP package

SOIC package

Logic Integrated Circuits


Fixed Function Logic
VCC

VCC

14 13 12 11 10 9

7
GND

VCC

14 13 12 11 10 9

'00

7
GND

7
GND

14 13 12 11 10 9

7
GND

'27

7
GND

7
GND

'30

7
GND

7
GND

7
GND

14 13 12 11 10 9

7
GND

'21
VCC

14 13 12 11 10 9

VCC

14 13 12 11 10 9

'08

VCC

14 13 12 11 10 9

14 13 12 11 10 9

'20

VCC

14 13 12 11 10 9

'11

VCC

VCC

'10

'04

VCC

14 13 12 11 10 9

VCC

14 13 12 11 10 9

' 02

VCC

'32

7
GND

14 13 12 11 10 9

'86

7
GND

Logic Integrated Circuits


Programmable Logic

Logic Integrated Circuits


Programmable Logic

SRAM
cell

SRAM
cell

SRAM
cell

SRAM
cell

SRAM
cell

SRAM
cell

SRAM
cell

SRAM
cell

X = AB

Logic Integrated Circuits


Programmable Logic

In general, the required logic for Programmable Logic


Devices (PLDs) is developed with the aid of a computer.
Logic can be specified either as a schematic diagram, a
text file in a particular hardware description language
(HDL) or a state diagram.

Logic Integrated Circuits


Programmable Logic

Вам также может понравиться