0% found this document useful (0 votes)
25 views10 pages

DC 03

Uploaded by

kaanmcs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views10 pages

DC 03

Uploaded by

kaanmcs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Digital Circuits License: https://creativecommons.org/licenses/by-nc-nd/4.

0/

Logic Gates
Logic gates are physical devices which implement simple Boolean functions.
Some of the simple gates:
ANSI/IEEE-1973 ANSI/IEEE-1984 Truth Table:
X Y
BUFFER Y=X X Y X 1 Y 0 0
1 1

X Y
INVERTER (NOT)
X Y X 1 Y 0 1
1 0

X Y Z
X X 0 0 0
AND Z=X•Y
Y
Z
Y
& Z 0 1 0
1 0 0
1 1 1
X Y Z
X X 0 0 0
OR Z=X+Y
Y
Z
Y
≥1 Z 0 1 1
1 0 1
1 1 1
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.1
http://www.buzluca.info

Digital Circuits

Some of the simple gates (cont’d): Truth Table:


ANSI/IEEE-1973 ANSI/IEEE-1984
X Y Z
NAND X X 0 0 1
(NOT AND) Y
Z
Y
& Z 0 1 1
1 0 1
1 1 0

X Y Z
X X 0 0 1
NOR Y
Z
Y
≥1 Z 0 1 0
1 0 0
(NOT OR) 1 1 0

X Y Z
X
X 0 0 0
XOR (Difference) ⊕ Z Y
=1 Z
0 1 1
Y
1 0 1
1 1 0

X X Y Z
X =1 Z 0 0 1
XNOR (Equality) ⊙ Z
Y Y 0 1 0
1 0 0
1 1 1
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.2
http://www.buzluca.info
Digital Circuits

Integrated Circuits – IC
Logic gates are manufactured in integrated circuit (IC) (chip) form.
Often, a large number of mixed logic gates are packaged in a single integrated circuit.
For example, a ULSI (Ultra large-scale integration) chip can include more than
100,000 gates.
ICs themselves come in different types of packages.
Dual in-line Package (DIP) ICs
pin 1 pin 20
pin 1 pin 14

pin 8 pin 11

Quad Flat Package (QFP) Pin Grid Array (PGA)

http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.3
http://www.buzluca.info

Digital Circuits

Examples of 74xx Series

You can find necessary information about ICs in their datasheet catalogs.
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.4
http://www.buzluca.info
Digital Circuits

Positive and Negative Logic


• Boolean values (zero and one) represent physical quantities such as voltage or
state of an entity (door is open, light is off).
• Assigning "1" to a high value and "0" to a low value is called positive logic, and
• Assigning "0" to a high value and "1" to a low value is called negative logic.
Example:
The function table of a physical device with two inputs and one output is shown
below.
If we use the positive logic, the device can be implemented using an AND gate.
In a negative logic system, the device is implemented using an OR gate.

Physical Device Positive Logic Negative Logic


Inputs: Output: Inputs: Output: Inputs: Output:
x1 x2 z x1 x2 z x1 x2 z
L L L 0 0 0 1 1 1
L H L 0 1 0 1 0 1
H L L 1 0 0 0 1 1
H H H 1 1 1 0 0 0
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.5
http://www.buzluca.info

Digital Circuits

Implementation of Boolean Functions Using Logic Gates


ABC

 Sum of Products (SOP)


 AND gates implement the products.
Z
 OR gate implements the sum.

ABC

 Product of Sums (POS)


 OR gates implement the sums.
Z
 AND gate implements the product.

A A
NOT gates can also be used where necessary.

http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.6
http://www.buzluca.info
Example: Implementation of a Boolean Function represented (given) by truth table
A B C F
0 0 0 0
0 0 1 1 F(A, B, C)= Σm(1,3,5,6,7) 1. canonical form
0 1 0 0 = A'B'C + A'BC + AB'C + ABC' + ABC = F1
0 1 1 1 = AB+C = F2 (minimized)
1 0 0 0 F(A, B, C)= ΠM(0,2,4) 2. canonical form
1 0 1 1
1 1 0 1 = (A + B + C) (A + B' + C) (A' + B + C) = F3
1 1 1 1 = (A + C) (B + C) = F4 (minimized)
A
F1 = F2 = F3 = F4
B
F1 1. canonical form (SOP)
C

F2 minimized (SOP)

F3
2. canonical form (POS)

minimized (POS)
F4

Digital Circuits License: https://creativecommons.org/licenses/by-nc-nd/4.0/

Implementation of Boolean Functions Using Logic Gates (cont'd)


• There are many ways to express a Boolean function.
We implement each one using different logic gates.
• Sometimes, it is necessary to manipulate logic expressions of functions based on
the types of available gates (for example, if we have only 2-input AND gates).

Example:
Z = A' • B' • (C + D) = (A' • (B' • (C + D))) (Associative Law)

A A Z
B Z ≡ B
B'(C+D)
C
D C
D C+D
3-input gate
Only 2-input gates

• Reduction of logic equations is still necessary to fit the equations into a small
number of ICs.

http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.8
http://www.buzluca.info
Digital Circuits

Functionally Complete Sets of Logic Gates


A set of logic operations is functionally complete if any Boolean function can be
expressed using only this set of operations.
• The set {AND, OR, NOT} is obviously functionally complete because AND, OR,
and NOT are the main operations defined in Boolean algebra.
Any function can be expressed in sum-of-products (or product-of-sums) form,
and a sum-of-products expression uses only the AND, OR, and NOT operations.
• Since the set of operations {AND, OR, NOT} is functionally complete, any set of
logic gates which can realize {AND, OR, NOT} is also functionally complete.
o For example, {AND, NOT} is also a functionally complete set of gates because
OR can be realized using only AND and NOT.
o To prove it, we can use De Morgan's theorem.
De Morgan's Theorem:


X · X
· Y

o Since {AND, NOT} is functionally complete, we can express any Boolean


function using only AND and NOT.
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.9
http://www.buzluca.info

Digital Circuits

Universal Logic Gates


• If a single gate forms a functionally complete set by itself, then any Boolean
function can be realized using only gates of that type.
• This type of gate is called universal logic gate.
• Examples:
o The NAND (NOT AND) gate is an example of a universal logic gate.
Remember: the NAND gate performs the AND operation followed by inversion
(AND-NOT).
o NOT, AND, and OR can be realized using only NAND gates.
o Thus, any Boolean function can be realized using only NAND gates.
o Similarly, the set consisting only of the binary operator NOR (NOT OR) is also
functionally complete.
o All other logic functions can be realized using only NOR gates.
o The NOR gate is also an example of a universal logic gate.

http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.10
http://www.buzluca.info
Digital Circuits

Proof of functional completeness


To prove that NAND and NOR operators are functionally complete , we have to
show that AND, OR, NOT operations can be implemented using only NAND (or
alternatively, NOR) gates.
NAND is denoted by symbol | x|x = (x·x)'
NOR is denoted by symbol ↓ x↓x = (x+x)'

NAND NOR

x' = x | x x' = x ↓ x
NOT: = (x·x)' = (x+x)' x x'
x x'
= x' = x'

x·y = (x' + y')' de Morgan


AND: x·y = ((x·y)')' Involution
= (x' ↓ y') (NOT can be implemented
= (x | y)' (NOT can be implemented using NOR only)
using NAND only)

x+y = (x'·y')' de Morgan x+y = ((x+y)')' Involution


OR:
= (x' | y') = (x ↓ y)'

http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.11
http://www.buzluca.info

Digital Circuits

Relation between NAND and NOR

 NAND - NOR Conversions


 de Morgan: 1. A' • B' = (A + B)'
2. A' + B' = (A • B)'
3. (A' • B')' = A + B
4. (A' + B')' = (A • B)
 These expressions show that
1. An AND gate with inverted inputs is the equivalent of the NOR gate.
2. An OR gate with inverted inputs is the equivalent of the NAND gate.
3. A NAND gate with inverted inputs is the equivalent of the OR gate.
4. A NOR gate with inverted inputs is the equivalent of the AND gate.

1. ≡ 3. ≡

2. ≡ 4. ≡
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.12
http://www.buzluca.info
Digital Circuits License: https://creativecommons.org/licenses/by-nc-nd/4.0/

Implementation of Boolean functions using only NAND (NOR) gates


There are four different combinations:
1. Expression in SOP form, implementation using NAND gates
2. Expression in SOP form, implementation using NOR gates
3. Expression in POS form, implementation using NOR gates
4. Expression in POS form, implementation using NAND gates

1. Implementation of Boolean functions in SOP form using only NAND gates


Shortcut: If we add NOT gates to the outputs of AND gates and to the inputs of
the OR gates, we obtain NAND gates. (See 3.12 - 2)
If we always add inverters in pairs (NOT-NOT), the function realized by the circuit
will not change. (a')' = a (Involution)

Example: Z = (A • B) + (C • D)
A A
B B

C
Z ≡ C
Z

D D
NAND (See. 3.12)
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.13
http://www.buzluca.info

Digital Circuits

Example (cont’d):
Solution using algebraic conversion:
Expression is inverted twice. (Z')' = Z (Involution)
Z = (A • B) + (C • D) (SOP form)
= [( (A • B) + (C • D) )' ]'
= [(A • B)' • (C • D)' ]' (De Morgan)
= (A | B) | (C | D) (only NAND gates)

Algebraic verification:
A A
B
? B
Z Z
C ≡ C
D D

Z = [ (A • B)' • (C • D)' ]' Expression using NANDs (circuit on the right)


= [ (A' + B') • (C' + D') ]'
= [ (A' + B')' + (C' + D')' ]
= (A • B) + (C • D) Expression of the circuit on left
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.14
http://www.buzluca.info
Digital Circuits

Implementation using gates with limited number of inputs


Sometimes, it is necessary to implement products (or sums) with many literals using
gates that accept only two inputs (remember the integrated circuits in 3.4).
Example:
Z= ABC + ACD
Implement this expression using only 2-input NAND Gates.
Solution 1:
1. Implementation using the classical gates of the Boolean algebra
Extra NOT gates are necessary (see 3.16).
A A B C C D

2. Inserting NOT gates to obtain NAND gates

http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.15
http://www.buzluca.info

Digital Circuits

Example (cont’d):
Solution 1:
3. Implementation with 2-input NAND gates
A B C D

Solution 2:
Manipulating the original expression to obtain a simpler circuit
Z= ABC + ACD = A(BC + CD)
A B C D The circuit in solution 2 is
cheaper to implement than
Z
the circuit in solution 1.
Therefore, solution 2 is
preferable to solution 1.
(BC + CD)
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.16
http://www.buzluca.info
Digital Circuits

2. Implementation of Boolean functions in SOP form using only NOR gates


We obtain a more complicated circuit than we did in case 1 (SOP using NAND).
A
Example: Z = (A • B) + (C • D)
B
Z
C
D
1. Step: 2. Step:
Converting AND to NOR. Converting OR to NOR
NOR
A A

B B
Z Z
C C
D D

Remember: We can
implement NOT gates x x'
using NOR gates.
(a')' = a (Involution)
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.17
http://www.buzluca.info

Digital Circuits

3. Implementation of Boolean functions in POS form using only NOR gates


For expressions in POS form, using NOR gates is advantageous.
Shortcut :
If we add NOT gates at the outputs of OR gates and at the inputs of the AND
gates, we obtain NOR gates. (See 3.12)
Remember: If we always add inverters in pairs, the function realized by the
circuit will not change. (a')' = a (Involution)

Example: Z = (A + B) • (C + D)
A A
B B

C
Z ≡ C
Z

D D
A
B NOR (See. 3.12 -1)
Z
C
D
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.18
http://www.buzluca.info
Digital Circuits License: https://creativecommons.org/licenses/by-nc-nd/4.0/

4. Implementation of Boolean functions in POS form using only NAND gates


We obtain a more complicated circuit than we did in case 3 (POS using NOR).
A
Example: Z = (A + B) • (C + D) B
Z
C
D
1. Step: 2. Step:
Converting OR to NAND Converting AND to NAND

A A

B B
Z Z
C C

D D

NAND
Remember: We can x x'
implement NOT gates
using NAND gates.
http://akademi.itu.edu.tr/en/buzluca/
2011 - 2024 Feza BUZLUCA 3.19
http://www.buzluca.info

You might also like