37
LOGIC GATES Ho Kyung Kim, Ph.D. [email protected] School of Mechanical Engineering Pusan National University Basic Experiment and Design of Electronics

LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. [email protected] School of Mechanical

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

LOGIC GATES

Ho Kyung Kim, [email protected]

School of Mechanical EngineeringPusan National University

Basic Experiment and Design of Electronics

Page 2: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Outline

• Boolean algebra

• Logic gates

• Karnaugh maps

• Combinational logic circuits

2

Page 3: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Analog signal– An electric signal whose value varies in analogy with a physical quantity (e.g., temp., force, or

acceleration)– Sensitive to noise

• Digital signal– Immune to noise

Analog and digital signals

Page 4: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Binary signal

• Characterized by transitions between two states ( / , on/off, 5 V/0 V …)• Knowledge of the transition between one state to another is equivalent to knowledge of

the state Digital logic circuits can operate by detecting transitions (edges) between voltage levels

4

Page 5: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Binary number system

MSB

LSB

LSB

MSB

• bits = binary digits– LSB (least significant bit), MSB (most significant bit)– 8 bits = 1 byte– 16 bits = 2 bytes = 1 word

• 3.25 3 10 2 10 5 10

• 10.011 1 2 0 2 0 2 1 2 1 2 2 0 0 2.375

• 3.25 ?• 28.375 ?

Page 6: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Addition Subtraction

Multiplication Division

Page 7: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Negative binary numbers– +5 0101, -5 1101– 2 1 2 1 for -bit signed integer words– instead of in digital computers

• Complements– Ones complement

• 0101 ones complement of = 2 1 1010– Twos complement (= ones complement + 1)

• 0101 ones complement of =2 1011 (= 1010 + 1)

• Hexadecimal system– 0, 1, 2, … , 9, A (= 10), B (= 11), C (= 12), D (= 13), E (= 14), F (= 15)– B5F 11 16 5 16 15 16 2611

Page 8: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Binary codes– BCD (binary-coded decimal)

• 139 → 000100111001• e.g., hand calculator

– Gray codes• Any consecutive numbers differ only by 1 bit• Effective in encoding mechanical angular position

BCD code Gray code

Page 9: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Encoders

Page 10: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Mathematics associated with the binary number system (and with the more general field of logic)

• Logical algebra• Positive logic

– Logic 1 = true, logic 0 = false

• Negative logic– Logic 1 = false, logic 0 = true

• Analysis of logic functions, that is, functions of logical (Boolean) variables, can be carried out in terms of truth tables

• Logic gates– Physical devices that can be used to implement logic functions

Boolean algebra

Page 11: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Logic gates: OR, AND, NOT

Logical addition Logical multiplication Logical complement

Page 12: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

VCC

VCERB

RC

VBB

A

B

F

+VCC

Input

OutputA

B

FInput

Output

Page 13: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Ex) Realize the following statement with the logic gates:– The output shall be logic 1 only when the condition ( = 1 AND = 1) OR ( = 1) occurs, and

shall be logic 0 otherwise

Page 14: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Ex) Realize the following statement with the logic gates:– The output shall be logic 1 only when the condition ( = 0 AND = 1) OR ( = 1) occurs, and

shall be logic 0 otherwise The output shall be logic 1 only when the condition ( = 1 AND = 1) OR ( = 1) occurs, and

shall be logic 0 otherwise

Page 15: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Rules of Boolean algebra

Proof of rule 16 by perfect induction (truth table)

0 · 1 0 ⟺ 1 0 1 (duality)

From 2: · 1 1 From 17: · · · ·

Page 16: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• De Morgan’s theorems– ·– ·– Any logic gates can be implemented by using only OR and NOT gates, or only AND and NOT

gates

Page 17: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Ex) Simplify the following functions– , , , · · · · · · · ·

Page 18: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Ex) Realize the logic function described by the truth table below

00001111

00110011

01010101

01011111

Page 19: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• NAND = NOT AND• NOR = NOT OR

Logic gates: NAND, NOR, XOR

Just regard this “bubble” as the “NOT” gate

Page 20: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• AND function with NAND gates

0011

0101

1110

0001

Page 21: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Realization of various logic gates with only NAND gates

Inverter

AND

OR

NOR

Page 22: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• AND function with NOR gates– ·

Page 23: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Realization of various logic gates with only NOR gates

Inverter

AND

OR

NOR

Page 24: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• XOR (exclusive OR) gate– When its inputs are all logic 1’s, the output is exclusively a logic 0; otherwise, identical to the OR

gate

– ⨁ · ·

Page 25: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Summary

게이트 이름 회로기호 논리식 진리표

AND

x y

0 0

0 1

1 0

1 1

F

0

0

0

1

F = xy

F = x+y

x y

0 0

0 1

1 0

1 1

F

0

1

1

1

x

0

1

F

1

0

F = x'

x

yF

x

yF

F

F

x

x

OR

NOT또는

inverter

buffer

x

0

1

F

0

1

F = x

비고

입력이 모두 1일때 출력이 1

입력중 하나라도 1이면 출력이 1

입력이 반전되어 출력

입력이 그대로 출력

x

yF

x

y

x

y

x

y

F

F

F

XNOR(exclusive-NOR)

또는equivalence

NAND

NOR

XOR(exclusive-OR)

x y

0 0

0 1

1 0

1 1

F

1

1

1

0

F = (xy)'

F = (x+y)'

x y

0 0

0 1

1 0

1 1

F

1

0

0

0

x y

0 0

0 1

1 0

1 1

F

0

1

1

0

x y

0 0

0 1

1 0

1 1

F

1

0

0

1

입력이 모두 1일때에만 출력이 0

입력이 모두 0일때에만 출력이 1

입력에 1이 홀수개일때 출력이 1

입력에 0이 짝수개일때 출력이 1

F = (x y)'F = x'y'+xy

F = x yF = x'y + xy'

게이트 이름 회로기호 논리식 진리표 비고

Page 26: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Sum-of-products expression

Standard forms

• Product-of-sums expression

• Any logical expression can be reduced to one of these two forms!

Page 27: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Sum-of-products– OR of minterms–

• Products-of-sums– AND of maxterms–

Minterm Maxterm

00001111

00110011

01010101

10100110

Page 28: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Karnaugh maps and logic designs

• Karnaugh map– Describing all possible combinations of the

variables present in the logic function of interest

– Arranging variables in a 1-bit change between adjacent terms

– 2 cells– Minterm in each cell

• AND-combination of the variables in either uncomplemented or complemented form

• Product of the variables appearing at the corresponding vertical and horizontal coordinates

– Define a subcube with logical value• 1 cell• 2 cells = pair• 4 cells = quad• 8 cells = octet

Page 29: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• 1 cell– · · · · · · · · · · · · · · · · · · + · · ·

• 2 cells– · · · · · · · · · · · · + · · ·

Page 30: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• 4 cells– · · ·

• 8 cells–

Page 31: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Ex) Simplify the following logic circuit

X

Y

ZF

Y

FXZ

00 01 11 10

0 1 0 0 1

1 1 1 1 1

YZX

+

Page 32: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Ex) Design a logic circuit that implements the following truth table

– · · · · ·

Sum-of-products realizations

Page 33: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Ex) Derive the truth table and minimum sum-of-products expression for the following circuit

– · ·

Page 34: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

1. Solve for the 0’s exactly as for the 1’s in sum-of-products expressions2. Complement the resulting expression

Product-of-sums realization

• Product-of-sums– · · · · · · ·– ·

• Sum-of-products– · · ·

Page 35: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

• Use the don’t care entry with whenever it does not matter whether a position in the K-map is filled by a 1 or a 0

• Then, can be used as either a 1 or a 0, depending on which results in a greater simplification (i.e., helps in forming the smallest number of maximal subcubes)

Don’t care conditions

• If =1 in the right truth table;– · · · ·

Page 36: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

Digital IC packages

• TTL (transistor-transistor logic)– High-power consumption, fast– 74 series

• CMOS (complementary metal-oxide-semiconductor)– Low-power consumption, slow– Weak to static– 40 series

36

1 2 3 4 5 6 7

814 13 12 11 10 9

1Y 2A1A 1B

Vcc 4Y 3B4B

2B GND

3A4A

2Y

3Y

DIP (dual-in-line) package Flat-type Surface-mount package

7400

Page 37: LOGIC GATES - Pusan National Universitybml.pusan.ac.kr/resources/2014_basic_elec/9_LogicGates.pdf · 2014-10-27 · LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical

37

제조회사SN : Texas Instrument

MC : MotorolaDM : National Semiconductor

IM : IntersilN : Signetics

MM : Monolithic MemoriesP : Intel

H : HarriesF : Fairchild

AM : Advanced Micro DevicesCD : RCA

HD : HitachDN/MN : Mitsubishi

MB : FujitsuTC : ToshibaHY : Hyundai

GD : GoldStarK- : Samsung

회로타입S : high speed SchottkyL : Low powerLS : Low power SchottkyH : High speed},F : FastHC : High speed CMOS(CMOS compatible)HCT : High speed CMOS TTL(LSTTL compatible)AC : AdvancedAS : Advanced SchottkyALS : Advanced Low power Schottky

기능에 따른 고유번호

패키지 외형N : Plastic DIPJ : Ceramic DIPW : Flat Pack

시리즈명74 : TTL40 : CMOS