Presentation is loading. Please wait.

Presentation is loading. Please wait.

King Fahd University of Petroleum and Minerals

Similar presentations


Presentation on theme: "King Fahd University of Petroleum and Minerals"โ€” Presentation transcript:

1 King Fahd University of Petroleum and Minerals
Additional Gates COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

2 Presentation Outline Additional Gates and Symbols
Universality of NAND and NOR gates NAND-NAND and NOR-NOR implementations Exclusive OR (XOR) and Exclusive NOR (XNOR) gates Odd and Even functions

3 Additional Logic Gates and Symbols
Why? Low cost implementation Useful in implementing Boolean functions ๐‘ฅ ๐‘ฆ ๐‘ฅยท๐‘ฆ AND gate ๐‘ฅ ๐‘ฆ ๐‘ฅ+๐‘ฆ OR gate ๐‘ฅโ€ฒ ๐‘ฅ NOT gate (inverter) ๐‘ฅ ๐‘ฆ ๐‘ฅยท๐‘ฆ โ€ฒ NAND gate ๐‘ฅ ๐‘ฆ (๐‘ฅ+๐‘ฆ)โ€ฒ NOR gate ๐‘ฅ Buffer ๐‘“ ๐‘ฅ 3-state gate ๐‘ ๐‘ฅ ๐‘ฆ ๐‘ฅโŠ•๐‘ฆ XOR gate ๐‘ฅ ๐‘ฆ (๐‘ฅโŠ•๐‘ฆ)โ€ฒ XNOR gate

4 Another symbol for NAND
NAND Gate The NAND gate has the following symbol and truth table NAND represents NOT AND The small bubble circle represents the invert function NAND gate is implemented efficiently in CMOS technology In terms of chip area and speed x y NAND 0 0 1 0 1 1 0 1 1 ๐‘ฅ ๐‘ฆ ๐‘ฅยท๐‘ฆ โ€ฒ = ๐‘ฅ โ€ฒ +๐‘ฆโ€ฒ NAND gate ๐‘ฅ ๐‘ฆ ๐‘ฅโ€ฒ+๐‘ฆโ€ฒ Another symbol for NAND

5 NOR Gate The NOR gate has the following symbol and truth table
NOR represents NOT OR The small bubble circle represents the invert function NOR gate is implemented efficiently in CMOS technology In terms of chip area and speed x y NOR 0 0 1 0 1 1 0 1 1 ๐‘ฅ ๐‘ฆ ๐‘ฅ+๐‘ฆ โ€ฒ = ๐‘ฅ โ€ฒ ยท๐‘ฆโ€ฒ NOR gate ๐‘ฅ ๐‘ฆ ๐‘ฅโ€ฒยท๐‘ฆโ€ฒ Another symbol for NOR

6 The NAND Gate is Universal
NAND gates can implement any Boolean function NAND gates can be used as inverters, or to implement AND/OR A single-input NAND gate is an inverter ๐‘ฅ NAND ๐‘ฅ = (๐‘ฅยท๐‘ฅ)โ€ฒ = ๐‘ฅโ€ฒ AND is equivalent to NAND with inverted output (๐‘ฅ NAND ๐‘ฆ)โ€ฒ = ((๐‘ฅยท๐‘ฆ)โ€ฒ)โ€ฒ = ๐‘ฅยท๐‘ฆ (AND) OR is equivalent to NAND with inverted inputs (๐‘ฅโ€ฒ NAND ๐‘ฆโ€ฒ) = (๐‘ฅโ€ฒยท๐‘ฆโ€ฒ)โ€ฒ = ๐‘ฅ+๐‘ฆ (OR) ๐‘ฅ ๐‘ฆ ๐‘ฅยท๐‘ฆ ๐‘ฅ ๐‘ฆ ๐‘ฅ+๐‘ฆ ๐‘ฅโ€ฒ ๐‘ฆโ€ฒ

7 The NOR Gate is also Universal
NOR gates can implement any Boolean function NOR gates can be used as inverters, or to implement AND/OR A single-input NOR gate is an inverter ๐‘ฅ NOR ๐‘ฅ = (๐‘ฅ+๐‘ฅ)โ€ฒ = ๐‘ฅโ€ฒ OR is equivalent to NOR with inverted output (๐‘ฅ NOR ๐‘ฆ)โ€ฒ = ((๐‘ฅ+๐‘ฆ)โ€ฒ)โ€ฒ = ๐‘ฅ+๐‘ฆ (OR) AND is equivalent to NOR with inverted inputs (๐‘ฅโ€ฒ NOR ๐‘ฆโ€ฒ) = ( ๐‘ฅ โ€ฒ +๐‘ฆโ€ฒ)โ€ฒ = ๐‘ฅยท๐‘ฆ (AND) ๐‘ฅ ๐‘ฆ ๐‘ฅ+๐‘ฆ ๐‘ฅ ๐‘ฆ ๐‘ฅยท๐‘ฆ ๐‘ฅโ€ฒ ๐‘ฆโ€ฒ

8 Non-Associative NAND / NOR Operations
Unlike AND, NAND operation is NOT associative (๐‘ฅ NAND ๐‘ฆ) NAND ๐‘ง โ‰  ๐‘ฅ NAND (๐‘ฆ NAND ๐‘ง) (๐‘ฅ NAND ๐‘ฆ) NAND ๐‘ง = ((๐‘ฅ๐‘ฆ)โ€ฒ๐‘ง)โ€ฒ=((๐‘ฅโ€ฒ+๐‘ฆโ€ฒ)๐‘ง)โ€ฒ=๐‘ฅ๐‘ฆ+๐‘งโ€ฒ ๐‘ฅ NAND (๐‘ฆ NAND ๐‘ง) = (๐‘ฅ(๐‘ฆ๐‘ง)โ€ฒ)โ€ฒ=(๐‘ฅ(๐‘ฆโ€ฒ+๐‘งโ€ฒ))โ€ฒ=๐‘ฅโ€ฒ+๐‘ฆ๐‘ง Unlike OR, NOR operation is NOT associative (๐‘ฅ NOR ๐‘ฆ) NOR ๐‘ง โ‰  ๐‘ฅ NOR (๐‘ฆ NOR ๐‘ง) (๐‘ฅ NOR ๐‘ฆ) NOR ๐‘ง = ๐‘ฅ+๐‘ฆ โ€ฒ +๐‘ง โ€ฒ = ๐‘ฅ โ€ฒ ๐‘ฆ โ€ฒ +๐‘ง โ€ฒ =(๐‘ฅ+๐‘ฆ)๐‘งโ€ฒ ๐‘ฅ NOR (๐‘ฆ NOR ๐‘ง) = ๐‘ฅ+ ๐‘ฆ+๐‘ง โ€ฒ โ€ฒ = ๐‘ฅ+ ๐‘ฆ โ€ฒ ๐‘ง โ€ฒ โ€ฒ =๐‘ฅโ€ฒ(๐‘ฆ+๐‘ง)

9 Multiple-Input NAND / NOR Gates
NAND/NOR gates can have multiple inputs, similar to AND/OR gates ๐‘ค ๐‘ง ๐‘คยท๐‘ฅยท๐‘ฆยท๐‘ง โ€ฒ 4-input NAND gate ๐‘ฆ ๐‘ฅ ๐‘ฅ ๐‘ง ๐‘ฅยท๐‘ฆยท๐‘ง โ€ฒ 3-input NAND gate ๐‘ฆ ๐‘ฅ ๐‘ฆ ๐‘ฅยท๐‘ฆ โ€ฒ 2-input NAND gate ๐‘ค ๐‘ง ๐‘ค+๐‘ฅ+๐‘ฆ+๐‘ง โ€ฒ 4-input NOR gate ๐‘ฆ ๐‘ฅ ๐‘ฅ ๐‘ง ๐‘ฅ+๐‘ฆ+๐‘ง โ€ฒ 3-input NOR gate ๐‘ฆ ๐‘ฅ ๐‘ฆ ๐‘ฅ+๐‘ฆ โ€ฒ 2-input NOR gate Note: a 3-input NAND is a single gate, NOT a combination of two 2-input gates. The same can be said about other multiple-input NAND/NOR gates.

10 NAND โ€“ NAND Implementation
Consider the following sum-of-products expression: ๐‘“=๐‘๐‘‘+๐‘Žโ€ฒ๐‘๐‘‘โ€ฒ A 2-level AND-OR circuit can be converted easily to a 2-level NAND-NAND implementation ๐‘ ๐‘‘ ๐‘“ ๐‘Žโ€ฒ ๐‘ ๐‘‘โ€ฒ 2-Level AND-OR ๐‘ ๐‘‘ ๐‘“ ๐‘Žโ€ฒ ๐‘ ๐‘‘โ€ฒ Inserting Bubbles ๐‘ ๐‘‘ ๐‘“ ๐‘Žโ€ฒ ๐‘ ๐‘‘โ€ฒ 2-Level NAND-NAND 3-input AND gate 3-input NAND gate Two successive bubbles on same line cancel each other

11 NOR โ€“ NOR Implementation
Consider the following product-of-sums expression: ๐‘”=(๐‘Ž+๐‘‘)(๐‘+๐‘+๐‘‘โ€ฒ) A 2-level OR-AND circuit can be converted easily to a 2-level NOR-NOR implementation 2-Level OR-AND ๐‘Ž ๐‘‘ ๐‘” ๐‘ ๐‘ ๐‘‘โ€ฒ Inserting Bubbles ๐‘Ž ๐‘‘ ๐‘” ๐‘ ๐‘ ๐‘‘โ€ฒ 2-Level NOR-NOR ๐‘Ž ๐‘‘ ๐‘” ๐‘ ๐‘ ๐‘‘โ€ฒ 3-input OR gate 3-input NOR gate Two successive bubbles on same line cancel each other

12 Exclusive OR / Exclusive NOR
Exclusive OR (XOR) is an important Boolean operation used extensively in logic circuits Exclusive NOR (XNOR) is the complement of XOR x y XOR 0 0 0 1 1 1 0 1 1 x y XNOR 0 0 1 0 1 1 0 1 1 XNOR is also known as equivalence ๐‘ฅ ๐‘ฆ ๐‘ฅ โจ ๐‘ฆ XOR gate ๐‘ฅ ๐‘ฆ (๐‘ฅ โจ ๐‘ฆ)โ€ฒ XNOR gate

13 XOR / XNOR Functions The XOR function is: ๐‘ฅ โจ ๐‘ฆ=๐‘ฅ๐‘ฆโ€ฒ+๐‘ฅโ€ฒ๐‘ฆ
The XNOR function is: (๐‘ฅ โจ ๐‘ฆ)โ€ฒ=๐‘ฅ๐‘ฆ+๐‘ฅโ€ฒ๐‘ฆโ€ฒ XOR and XNOR gates are complex Can be implemented as a true gate, or by Interconnecting other gate types XOR and XNOR gates do not exist for more than two inputs For 3 inputs, use two XOR gates The cost of a 3-input XOR gate is greater than the cost of two XOR gates Uses for XOR and XNOR gates include: Adders, subtractors, multipliers, counters, incrementers, decrementers Parity generators and checkers

14 XOR and XNOR Properties
๐‘ฅ โจ 0=๐‘ฅ ๐‘ฅ โจ 1=๐‘ฅโ€ฒ ๐‘ฅ โจ ๐‘ฅ=0 ๐‘ฅ โจ ๐‘ฅโ€ฒ=1 ๐‘ฅ โจ ๐‘ฆ=๐‘ฆ โจ ๐‘ฅ ๐‘ฅ โ€ฒ โจ ๐‘ฆ โ€ฒ =๐‘ฅ โจ ๐‘ฆ ๐‘ฅ โจ ๐‘ฆ โ€ฒ = ๐‘ฅ โ€ฒ โจ ๐‘ฆ=๐‘ฅ โจ ๐‘ฆโ€ฒ XOR and XNOR are associative operations ๐‘ฅ โจ ๐‘ฆ โจ ๐‘ง=๐‘ฅ โจ ๐‘ฆ โจ ๐‘ง =๐‘ฅ โจ ๐‘ฆ โจ ๐‘ง ๐‘ฅ โจ ๐‘ฆ โ€ฒ โจ ๐‘ง โ€ฒ = ๐‘ฅ โจ (๐‘ฆ โจ ๐‘ง)โ€ฒ โ€ฒ =๐‘ฅ โจ ๐‘ฆ โจ ๐‘ง

15 Odd Function Output is 1 if the number of 1's is odd in the inputs
Output is the XOR operation on all input variables ๐‘“๐‘œ๐‘‘๐‘‘= (1, 2, 4, 7) x y z fodd 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 ๐‘“๐‘œ๐‘‘๐‘‘= ๐‘ฅ โ€ฒ ๐‘ฆ โ€ฒ ๐‘ง+ ๐‘ฅ โ€ฒ ๐‘ฆ ๐‘ง โ€ฒ +๐‘ฅ ๐‘ฆ โ€ฒ ๐‘ง โ€ฒ +๐‘ฅ๐‘ฆ๐‘ง ๐‘“๐‘œ๐‘‘๐‘‘=๐‘ฅ โจ ๐‘ฆ โจ ๐‘ง Odd Function with 3 inputs ๐‘ฅ ๐‘ฆ ๐‘ง ๐‘“๐‘œ๐‘‘๐‘‘ Implementation using two XOR gates

16 Even Function Output is 1 if the number of 1's is even in the inputs (complement of odd function) Output is the XNOR operation on all inputs w x y z feven 1 ๐‘“๐‘’๐‘ฃ๐‘’๐‘›= (0, 3, 5, 6, 9, 10, 12, 15) Even Function with 4 inputs ๐‘“๐‘’๐‘ฃ๐‘’๐‘›=(๐‘ค โจ ๐‘ฅ โจ ๐‘ฆ โจ ๐‘ง)โ€ฒ ๐‘ค ๐‘ฅ ๐‘ฆ ๐‘“๐‘’๐‘ฃ๐‘’๐‘› ๐‘ง Implementation using two XOR gates and one XNOR

17 Parity Generators and Checkers
Sender Receiver n-bit code Parity Generator (n+1)-bit code Checker Error A parity bit is added to the n-bit code Produces (n+1)-bit code with an odd (or even) count of 1's Odd parity: count of 1's in the (n+1)-bit code is odd Use an even function to generate the odd parity bit Use an even function to check the (n+1)-bit code Even parity: count of 1's in the (n+1)-bit code is even Use an odd function to generate the even parity bit Use an odd function to check the (n+1)-bit code

18 Example of Parity Generator and Checker
Design even parity generator & checker for 3-bit codes Solution: Use 3-bit odd function to generate even parity bit ๐‘ƒ. Use 4-bit odd function to check if there is an error ๐ธ in even parity. Given that: ๐‘ฅ๐‘ฆ๐‘ง = 001 then ๐‘ƒ = 1. The sender transmits ๐‘ƒ๐‘ฅ๐‘ฆ๐‘ง = 1001. If ๐‘ฆ changes from 0 to 1 between generator and checker, the parity checker receives ๐‘ƒ๐‘ฅ๐‘ฆ๐‘ง = 1011 and produces ๐ธ = 1, indicating an error. ๐‘ฅ ๐‘ฆ ๐‘ง ๐‘ƒ Parity Generator ๐‘ƒ ๐‘ฅ ๐‘ฆ ๐ธ ๐‘ง Parity Checker


Download ppt "King Fahd University of Petroleum and Minerals"

Similar presentations


Ads by Google