Download presentation
Presentation is loading. Please wait.
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.