0% found this document useful (0 votes)
51 views36 pages

3 Logic Circuits

this is about logic circuit document
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)
51 views36 pages

3 Logic Circuits

this is about logic circuit document
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

10/12/2023

Logic circuits

 Boolean expression
 Truth table
 Logic diagram
 Timing diagram

Logic circuits 2

1
10/12/2023

 Three basic logic operations: AND, OR, NOT


 Operation of logic circuits and construction of
truth tables
 Timing diagrams for the various logic-circuit
gates
 Boolean expression for the logic circuits
 Implement logic circuits using AND, OR, NOT
 Simplify logic expressions
◦ DeMorgan’s theorem
 Using NAND or NOR to implement a circuit
 Alternate gate symbols vs. standard logic-gate
symbols
 Active high & Active low

Logic circuits 3

 Boolean constants and variables are allowed


to have only two possible values, 0 or 1
 Boolean 0 and 1 do not represent actual
numbers but instead represent the state of
a voltage variable, or what is called its logic
level
 0/1 and Low/High are used most of the
time
 Three Logic operations:
AND, OR, NOT

Logic circuits 4

2
10/12/2023

 The function x = f(A1, A2, …, AN) is called a


N-variable logic function if A1, A2, …,AN are
logic variables and x  X, with X={0,1}.
◦ The right side: logic expression.
◦ The left side: logic variable
 Logic expression (Boolean expression) is an
algebraic expression with the operands are
logic variables and operators are basic logic
operations

Logic circuits 5

 Logic functions → Logic circuits


 Logic circuits → Logic functions
 The inputs of logic circuits ↔ Logic variables
 The outputs of logic circuits ↔ The value of
function
 Logic Gates
◦ A logic circuit corresponding to a basic logic operation
of Boolean algebra is called the logic gate
◦ Logic gate is constructed from diodes, transistors, and
resistors whose output is the result of a basic logic
operation (OR, AND, NOT) performed on the inputs

Logic circuits 6

3
10/12/2023

 How a logic circuit’s output


depends on the logic levels
present at the inputs
◦ List all the outputs of logic circuit
based on the a combination of inputs’
values

 Truth Table
◦ x is a logic 1 for every combination of input levels where
one or more inputs are 1
◦ Boolean expression x = A + B
 x equals A OR B
 To describe this circuit in the English language we could say
that x is true (1) WHEN A is true (1) OR B is true (1)
 OR Gate
◦ is a circuit that has two or more inputs and whose output is
equal to the OR combination of the inputs
◦ its output is HIGH (logic 1) if either input A or B or both are
at a logic 1 level; for all other cases the output will be 0

Logic circuits 8

4
10/12/2023

Logic circuits 9

 The OR operation produces a result (output)


of 1 whenever any input is a 1. Otherwise the
output is 0
 An OR gate is a logic circuit that performs an
OR operation on the circuit's input
 The expression x=A+B is read as “x equals A
OR B”

Logic circuits 10

5
10/12/2023

Logic circuits 11

Logic circuits 12

6
10/12/2023

 Truth Table
◦ x is a logic 1 only when both A and B are at the logic 1
level. For any case where one of the inputs is 0, the
output is 0.
◦ Boolean expression x = A.B
 x equals A AND B
 AND gate
◦ is a digital circuit performing the AND operation
◦ An AND gate output will be 1 only for the case when
all inputs are 1; for all other cases the output will be 0

Logic circuits 13

7
10/12/2023

 The AND operation is performed the same as


ordinary multiplication of 1s and 0s
 An AND gate is a logic circuit that performs
the AND operation on the circuit’s inputs
 An AND gate output will be 1 only for the
case when all inputs are 1; for all other cases
the output will be 0
 The expression x=AB is read as “x equals A
AND B”

Logic circuits 15

 Determine the output x from the AND gate


for the given input waveforms.

Logic circuits 16

8
10/12/2023

 Determine the output waveform for the AND


gate

Logic circuits 17

 NOT operation
◦ One variable function.
◦ Boolean expression: x = 𝐴ҧ (inverse of A, complement
of A, or NOT A)
◦ Truth table
 NOT gate
◦ is a digital circuit, Inverter, performing the
NOT operation
◦ It inverts (complements) the input signal so that
whenever the input=0, output=1, and vice versa

Logic circuits 18

9
10/12/2023

Logic circuits 19

 OR (resembles binary addition, except for


one operation)
◦ 0+0=0 0+1=1 1+0=1 1+1=1

 AND (resembles binary multiplication)


◦ 0•0=0 0•1=0 1•0=0 1•1=1

 NOT (invert)
◦ 1=0 0=1

Logic circuits 20

10
10/12/2023

 Any logic circuit, no matter how complex,


can be completely described using the three
basic Boolean operations: OR, AND, NOT
◦ the basic building blocks of digital systems
 Example: logic circuit with its Boolean
expression

Logic circuits 21

 Often needed to establish precedence;


sometimes used optionally for clarity
 How to interpret A•B+C?
◦ Is it A•B ORed with C ? Is it A ANDed with B+C ?
 Order of precedence for Boolean algebra:
AND before OR. Parentheses make the
expression clearer, but they are not needed
for some cases
 Note that parentheses are needed here

Logic circuits 22

11
10/12/2023

 Whenever an INVERTER is present in a logic-


circuit diagram, its output expression is
simply equal to the input expression with a
bar over it

Logic circuits 23

A
A ABC
B 1
C X = ABC(A+D)
2
A+D A+D
D

(A+B)C (A+B)C
(A+B)C + D
A A+B
B 1
1
2
C 2
D
E X = [(A+B)C + D]E

Logic circuits 24

12
10/12/2023

 Rule
◦ First, perform all inversions of single terms
◦ Perform all operations with parentheses
◦ Perform an AND operation before an OR operation
unless parentheses indicate otherwise
◦ If an expression has a bar over it, perform the
operations inside the expression first and then
invert the result
 Example, 𝑥 = 𝐴𝐵𝐶(𝐴
ҧ + 𝐷)
◦ A=0, B=1, C=1, D=1

Logic circuits 25

1
A=0 1
B=1 1
C=1 X=0
2
1 0
D=1

Determine the output for the condition where all inputs are LOW?

Logic circuits 26

13
10/12/2023

 Whenever you have a combinational logic circuit and you


want to know how it works, the best way to analyze it is to
use a truth table.
 The advantages of this method are:
◦ It allows you to analyze one gate or logic combination at a time.
◦ It allows you to easily double-check your work.
◦ When you are done, you have a table that is of tremendous
benefit in troubleshooting the logic circuit.

Logic circuits 27

 When the operation of a circuit is defined by a Boolean


expression, we can draw a logic circuit diagram directly from
that expression
 Suppose that we wanted to construct a circuit whose output
is 𝑥 = 𝐴𝐶 + 𝐵𝐶ҧ + 𝐴𝐵𝐶
ҧ
AC X = AC+BC+ABC
BC
ABC
A AC
1
C

BC X = AC+BC+ABC
2
B

ABC
3

Logic circuits 28

14
10/12/2023

 Draw the circuit diagram to implement the


expression 𝑥 = (𝐴 + 𝐵)(𝐵 + 𝐶)

A A+B
B 1
X = (A+B)(B+C)

B+C
C 2

Logic circuits 29

 2-input NOR operation


◦ Boolean expression 𝑥 = 𝐴 + 𝐵
◦ Symbol: 𝐴 + 𝐵 (A NOR B)
◦ Truth table
 NOR gate
◦ is a digital circuit performing the NOR operation
◦ the output goes LOW when any input is HIGH

Logic circuits 30

15
10/12/2023

Logic circuits 31

 Determine the Boolean expression for a 3-


input NOR gate followed by an INVERTER

A A+B+C A+B+C = A+B+C


B
C

Logic circuits 32

16
10/12/2023

 NAND operation
◦ Boolean expression x = 𝐴. 𝐵
◦ Symbol: 𝐴. 𝐵 (A NAND B)
◦ Truth table
 NAND gate
◦ is a digital circuit performing the NAND operation
◦ the output goes LOW only when all inputs are HIGH

Logic circuits 33

Logic circuits 34

17
10/12/2023

 Implement the logic circuit that has the


expression 𝑥 = 𝐴𝐵 ⋅ 𝐶 + 𝐷 using only NOR
and NAND gates

C
D
C+D
𝑥 = 𝐴𝐵 ⋅ 𝐶 + 𝐷
A
B

Logic circuits 35

 Determine the output level in last example


for A=B=C=1 and D=0

C
1
0 C+D 𝑥 = 𝐴𝐵 ⋅ 𝐶 + 𝐷
D
0 1 1
A
B
1

Logic circuits 36

18
10/12/2023

 Exclusive-OR
◦ Boolean expression: x = 𝐴. 𝐵ത + 𝐴.ҧ 𝐵
◦ Symbol: 𝐴 ⊕ 𝐵 (A XOR B)
 XOR gate
◦ is a digital circuit performing the XOR operation
◦ The circuit produces a HIGH output whenever the
two inputs are at opposite levels.

Logic circuits 37

Logic circuits 38

19
10/12/2023

 Exclusive-NOR
◦ Boolean expression: x = 𝐴. 𝐵ത + 𝐴.ҧ 𝐵
◦ Symbol: 𝐴 ⊕ 𝐵 (A XNOR B)
 XNOR gate
◦ is a digital circuit performing the exclusive-NOR
operation
◦ The XNOR produces a HIGH output whenever the two
inputs are at the same level

Logic circuits 39

Logic circuits 40

20
10/12/2023

 Let X: boolean variable, 0,1: constants

1. X+0=X -- Zero Axiom


2. X•1 =X -- Unit Axiom
3. X+1 =1 -- Unit Property
4. X•0 =0 -- Zero Property
5. X+X=X -- Idepotence
6. X•X =X -- Idepotence
7. X + X’ = 1 -- Complement
8. X • X’ = 0 -- Complement
9. (X’)’ = X -- Involution

Logic circuits 41

x x
x x
0 1

𝑥+0 = 𝑥 𝑥. 1 = 𝑥

x x
1 0
1 0

𝑥+1 = 1 𝑥. 0 = 0

x x
x x

𝑥+𝑥 =𝑥 𝑥. 𝑥 = 𝑥

x x
1 0

𝑥+𝑥 =1 𝑥. 𝑥 = 0

Logic circuits 42

21
10/12/2023

 Commutativity
1. 𝑥+𝑦 =𝑦+𝑥
2. 𝑥𝑦 = 𝑦𝑥
 Associativity
1. 𝑥+ 𝑦+𝑧 = 𝑥+𝑦 +𝑧
2. 𝑥𝑦 𝑧 = 𝑥(𝑦𝑧)
 Distributivity
1. 𝑥 𝑦 + 𝑧 = 𝑥𝑦 + 𝑥𝑧
2. 𝑥 + 𝑦𝑧 = (𝑥 + 𝑦)(𝑥 + 𝑧)
 Absorption (covering)
1. 𝑥 + 𝑥𝑦 = 𝑥
2. 𝑥 + 𝑥𝑦ҧ =𝑥+𝑦
3. 𝑥ҧ + 𝑥𝑦 = 𝑥ҧ + 𝑦

Logic circuits 43

 Simplify the expression 𝑦 = 𝐴𝐵𝐷 + 𝐴𝐵𝐷


◦ 𝑦 = 𝐴𝐵 𝐷 + 𝐷
ഥ = 𝐴𝐵ത 1 = 𝐴𝐵ത

 Simplify 𝑧 = (𝐴ҧ + 𝐵)(𝐴 + 𝐵)


◦ 𝑧 = 𝐴𝐴
ҧ + 𝐴𝐵
ҧ + 𝐴𝐵 + 𝐵. 𝐵
ҧ + 𝐴𝐵 + 𝐵
= 𝐴𝐵
= 𝐵 𝐴ҧ + 𝐴 + 1
=𝐵

 Simplify 𝑥 = 𝐴𝐶𝐷 + 𝐴𝐵𝐶𝐷


◦ 𝑥 = 𝐶𝐷 𝐴 + 𝐴𝐵 = 𝐶𝐷 𝐴 + 𝐵 = 𝐴𝐶𝐷 + 𝐵𝐶𝐷

Logic circuits 44

22
10/12/2023

𝑥+𝑦 =𝑥⋅𝑦 𝑥⋅𝑦 =𝑥+𝑦

 Simplify the expression 𝑧 = 𝐴 + 𝐶 ⋅ 𝐵 + 𝐷


to one having only single variables inverted
◦ 𝑧 = 𝐴+𝐶 + 𝐵+𝐷
= 𝐴.ҧ 𝐶ҧ + 𝐵.
ത 𝐷ഥ
= 𝐴𝐶ҧ + 𝐵𝐷ത

Logic circuits 45

 The complement of the sum is the product of


the complements
◦ 𝑥+𝑦 =𝑥⋅𝑦

 The complement of the product is the sum of


the complements
◦ 𝑥⋅𝑦 =𝑥+𝑦

 In general,
◦ 𝑥+𝑦+𝑧 =𝑥⋅𝑦⋅𝑧
◦ 𝑥⋅𝑦⋅𝑧 =𝑥+𝑦+𝑧

Logic circuits 46

23
10/12/2023

𝑥+𝑦 = 𝑥⋅𝑦

x x
𝑥+𝑦 𝑥. 𝑦
y y

x
𝑥. 𝑦 = 𝑥 + 𝑦
y

Logic circuits 47

𝑥⋅𝑦 =𝑥+𝑦

x x
𝑥+𝑦
y y

x
𝑥 + 𝑦 = 𝑥𝑦
y

Logic circuits 48

24
10/12/2023

 Determine the output expression for the


below circuit and simplify it using
DeMorgan’s Theorem

𝑧 = 𝐴𝐵𝐶
=𝐴+𝐵+𝐶
=𝐴+𝐵+𝐶

Logic circuits 49

Logic circuits 50

25
10/12/2023

Logic circuits 51

 A conveyor belt will shut down whenever specific


conditions occur. These conditions are monitored and
reflect by the states of four logic signals as follows:
◦ signal A will be HIGH whenever the conveyor belt speed is too
fast;
◦ signal B will be HIGH whenever the collection bin at the end of
the belt is full;
◦ signal C will be HIGH when the belt tension is too high;
◦ signal D will be HIGH when the manual override is off.
 A logic circuit is needed to generate a signal x that will go
HIGH whenever conditions A and B exist simultaneously or
whenever conditions C and D exist simultaneously. Clearly,
the logic expression for x will be x=AB+CD. The circuit is
to be implemented with a minimum number of ICs.
52

26
10/12/2023

14 13 12 11 10 9 8 14 13 12 11 10 9 8
VCC VCC

GND GND
1 2 3 4 5 6 7 1 2 3 4 5 6 7

74LS00 74LS08

14 13 12 11 10 9 8 14 13 12 11 10 9 8
VCC VCC

GND GND
1 2 3 4 5 6 7 1 2 3 4 5 6 7

74LS02 74LS32

Logic circuits 53

74LS08 74LS00
(1) (1)
(3) (3)
(2) 1
74LS32 74LS00
(1) (2) (9)
(3) (8)
3
74LS08 74LS00
(4) (2) (4) (10)
(6) (6)
(5) 2
(5)

1 3 5

AND 7

2 4 6

AND OR
Logic circuits 54

27
10/12/2023

55

 Invert each input and output of the standard


symbol. This is done by adding bubbles
(small circles) on input and output lines that
do not have bubbles and by removing
bubbles that are already there
 Change the operation symbol from AND to
OR, or from OR to AND. (In the special case
of the INVERTER, the operation symbol is not
changed)

Logic circuits 56

28
10/12/2023

 The equivalences can be extended to gates with


any number of inputs
 None of the standard symbols have bubbles on
their inputs, and all the alternate symbols do
 The standard and alternate symbols for each gate
represent the same physical circuit; there is no
difference in the circuits represented by the two
symbols
 NAND and NOR gates are inverting gates, and so
both the standard and the alternate symbols for
each will have a bubble on either the input or the
output, AND and OR gates are non-inverting gates,
and so the alternate symbols for each will have
bubbles on both inputs and output

Logic circuits 57

 Active high/low
◦ When an input or output line on a logic circuit
symbol has no bubble on it, that line is said to be
active-high, otherwise it is active-low
◦ The presence or absence of a bubble, then,
determines the active-HIGH/active-LOW status of
a circuit’s inputs and output, and is used to
interpret the circuit operation

Logic circuits 58

29
10/12/2023

Active Active Active Active


HIGH LOW LOW HIGH

Output goes LOW only when all Output is HIGH when any
inputs are HIGH input is LOW

Logic circuits 59

Active HIGH Active LOW

Output goes HIGH when Output goes LOW only


any input is HIGH when all inputs are LOW

Logic circuits 60

30
10/12/2023

1. To obtain the alternate symbol for a logic gate,


take the standard symbol and change its
operation symbol (OR to AND, or AND to OR),
and change the bubbles on both inputs and
output (i.e., delete bubbles that are present,
and add bubbles where there are none).
2. To interpret the logic-gate operation, first
note which logic state, 0 or 1, is the active
state for the inputs and which is the active
state for the output. Then realize that the
output’s active state is produced by having all
of the inputs in their active state (if an AND
symbol is used) or by having any of the inputs
in its active state (if an OR symbol is used).

Logic circuits 61

Original circuit (all NAND gates)

Equivalent representation where output Z is active HIGH

Equivalent representation where output Z is active LOW 62

31
10/12/2023

 If the circuit is being used to cause some action


(e.g., turn on an LED or activate another logic
circuit) when output Z goes to the 1 state, then
we say that Z is to be active-HIGH, and the
circuit diagram “active-HIGH” should be used.
◦ On the other hand, if the circuit is being used to cause
some action when Z goes to the 0 state, then Z is to
be active-LOW, and the diagram “active LOW” should
be used
 Bubble placement
◦ Whenever possible, choose gate symbols so that
bubble outputs are connected to bubble inputs, and
nonbubble outputs to nonbubble inputs

Logic circuits 63

 The logic circuit is being used to activate an


alarm when its output Z goes HIGH. Modify
the circuit diagram so that it represents the
circuit operation more effectively

Logic circuits 64

32
10/12/2023

 When the output of the logic circuit goes


LOW, it activates another logic circuit. Modify
the circuit diagram to represent the circuit
operation more effective

Logic circuits 65

 The logic circuit generates an output, MEM, that is used to


activate the memory ICs in a particular microcomputer.
Determine the input conditions necessary to activate MEM

1. MEM is active-LOW, and it will go LOW only


when X and Y are HIGH.
2. X will be HIGH only when RD=0.
3. Y will be HIGH when either W or V is HIGH.
4. V will be HIGH when RAM=0.
5. W will be HIGH when either ROM-A or ROM-
B is 0.
6. Putting this all together, MEM will go LOW
only when RD=0 and at least one of the three
inputs ROM-A, Logic
ROM-B,
circuits or RAM is LOW. 66

33
10/12/2023

 When a logic signal is in its active state, it


can be said to be asserted (=activated)
 When a logic signal is not in its active state,
it is said to be unasserted (=inactive)

 The overbar is simply a way to emphasize


that these are active-LOW signals

Logic circuits 67

 Many ways
◦ Logical statements in our own language
◦ Truth tables
◦ Traditional graphic logic symbols
◦ Boolean algebra expressions
◦ Timing diagrams

Logic circuits 68

34
10/12/2023

 The following English expression


describes the way a logic circuit needs to
operate in order to drive a seatbelt warning
indicator in a car.
If the driver is present AND the driver is NOT
buckled up AND the ignition switch is on,
THEN turn on the warning light.
 Describe the circuit using Boolean algebra,
schematic diagrams with logic symbols, truth
tables, and timing diagrams.

Logic circuits 69

Logic circuits 70

35
10/12/2023

 Boolean Algebra: a mathematical tool used in the


analysis and design of digital circuits
 OR, AND, NOT: basic Boolean operations
 OR: HIGH output when any input is HIGH
 AND: HIGH output only when all inputs are HIGH
 NOT: output is the opposite logic level as the input
 NOR: OR with its output connected to an INVERTER
 NAND: AND with its output connected to an
INVERTER
 Boolean theorems and rules: to simplify the
expression of a logic circuit and can lead to a
simpler way of implementing the circuit
 NAND, NOR: can be used to implement any of the
basic Boolean operations

Logic circuits 71

36

You might also like