Download ppt - Logic Gates

Transcript
Page 1: Logic Gates

Logic Gates

Informatics INFO I101

February 3, 2003

John C. Paolillo, Instructor

Page 2: Logic Gates

Items for Today

• Last week– Digitization– Graphic, audio and video data sizes

• This time– Digital logic, Boolean algebra, and circuits– Logic gates and truth tables

Page 3: Logic Gates

A Fundamental UnitySet Theory

&Logic

UnionIntersectionComplement

BooleanAlgebra

ORANDNOT

ElectricCircuits

ParallelSeries

Inversion

Binary Arithmetic

AdditionMultiplication

Twos Complement

Page 4: Logic Gates

Binary Arithmetic

+ 0 1

0 00 01

1 01 10

0 1

0 0 0

1 0 1

Means zero, carry 1(two distinct outputs)

Page 5: Logic Gates

Boolean Algebra

+ 0 1

0 0 1

1 1 1

0 1

0 0 0

1 0 1

OR AND

0 1

0 0 1

1 1 0

Exclusive ORBinary addition:ExOR (for one’s place)plus AND (for carry)

Page 6: Logic Gates

Electric Circuits

+ off on

off off on

on on on

off on

off off off

on off on

Parallel Series

Page 7: Logic Gates

A Fundamental Unity

• Any logical or mathematical problem may be formulated in set theoretic terms

• Boolean logic may be used to represent any set-theoretic operation

• The fundamental elements of Boolean logic may be implemented in electric circuits

• Therefore, any logical or mathematical problem may be implemented in electrical circuits!

Page 8: Logic Gates

Logic Gates

Page 9: Logic Gates

What are Logic Gates?

• Logic gates are conventional arrangements of switches that are treated as units

• They abstract away from the details of individual switches– They may be implemented in any number of

ways– Only their function is important

Page 10: Logic Gates

Symbols for Logic Gates

AND OR

XOR Not

Buff

Page 11: Logic Gates

Functions of Logic Gates

and 0 1

0 0 0

1 0 1

or 0 1

0 0 1

1 1 1

xor 0 1

0 0 1

1 1 0

nand 0 1

0 1 1

1 1 0

nor 0 1

0 1 0

1 0 0

xnor 0 1

0 1 0

1 0 1

A ¬A

0 1

1 0

A Buff

1 1

0 0

Page 12: Logic Gates

Boolean Logic Hints

AND: if you know that one input is 0, it doesn’t matter what the other input is, the output will be 0

OR: if you know that one input is 1, it doesn’t matter what the other input is, the output will always be 1

XOR: if you know that the inputs are the same, then the output will always be 0

Page 13: Logic Gates

Some Example Circuits

Page 14: Logic Gates

Synthesizing XOR

E

A0101

B0011

C0111

D1110

E0110

D

A C

B

Page 15: Logic Gates

Synthesizing OR from NAND

E

A0101

B0011

C1010

D1100

E0111

A C

BD

Page 16: Logic Gates

Encoding Position in a 2-by-2 Board

01 11

00 10

r1

r2

c1 c2

row

col

black

red

Page 17: Logic Gates

01 11

00 10

r1

r2

c1 c2

col

row

Decoding Position to a 2-by-2 Board

Page 18: Logic Gates

4-line multiplexer

d

c

b

a

C

A0101

B0011

CabcdA B

Page 19: Logic Gates

4-line demultiplexer

A B

A0101

B0011

aIN000

b0

IN00

c00

IN0

d000

IN

IN

d

c

b

a

Page 20: Logic Gates

Synthesizing AND from NOR

A0101

B0011

C1010

D1100

E0001

E

BD

A C

Page 21: Logic Gates

Other Applications of Boolean Logic

Page 22: Logic Gates

Graphic Paint/Copy Modes

COPY OR XOR

Page 23: Logic Gates

Database Search Queries

• A keyword represents the set of documents containing it

• Boolean AND represents the intersection of the sets corresponding to two (or more) search terms

• Boolean OR represents the union of the sets corresponding to two (or more) search terms

Page 24: Logic Gates

Recommended