0% found this document useful (0 votes)
29 views26 pages

Chap2 Gates

This document discusses digital logic design and basic logic gates. It begins by explaining how manual switches work and then introduces controllable switches or auto switches that can be controlled by a high or low input voltage without manual operation. It then shows how to use switches to create basic logic gates like AND, OR and NOT gates and represents their functionality using both logic symbols and truth tables. The document discusses Boolean algebra concepts like Boolean operations, identity elements, commutativity, associativity, distributivity, complements, duality, involution, absorption, and DeMorgan's theorem. It also introduces additional logic gates like NAND, NOR and XOR.

Uploaded by

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

Chap2 Gates

This document discusses digital logic design and basic logic gates. It begins by explaining how manual switches work and then introduces controllable switches or auto switches that can be controlled by a high or low input voltage without manual operation. It then shows how to use switches to create basic logic gates like AND, OR and NOT gates and represents their functionality using both logic symbols and truth tables. The document discusses Boolean algebra concepts like Boolean operations, identity elements, commutativity, associativity, distributivity, complements, duality, involution, absorption, and DeMorgan's theorem. It also introduces additional logic gates like NAND, NOR and XOR.

Uploaded by

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

Digital Logic Design

Ali Saleh

Logic Gates
The Modest Switch

• Manual Switch
• A switch is pushed manually, raised to a high voltage
• Which makes the current flow through the bulb

•Auto Switch or Controllable Switch


• No hands output
input
•High voltage at input: switch on
Otherwise it is off
•Output=Input

Digital Logic Design - Ali Saleh 2


Using the switch

Input Output is high (voltage) if and only if


the input is high

Output

Now we can make one circuit control


another switch…

Input Output

Digital Logic Design - Ali Saleh 3


Lets use them creatively

Input1 Output is high if both the inputs


input1 AND input2 are high
If either of the inputs is low, the
Output output is low.

This is called an AND gate

Input2

Now, can you make an OR gate with


switches?

Digital Logic Design - Ali Saleh 4


OR Gate

Input1

Output

Input2

Output is low iff both inputs are low

I.e. Output is high if either of the inputs (or both) are


high (input1 OR input2)
Digital Logic Design - Ali Saleh 5
Basic Gates
• There are three basic kinds of logic gates

Operation: AND OR of two NOT


of two inputs inputs (complement)
on one input

Logic gate:

Digital Logic Design - Ali Saleh 6


Describing Circuit Functionality:
Inverter
Truth Table
A Y
A Y 0 1

1 0
Symbol

Input Output

• Basic logic functions have symbols.


• The same functionality can be represented with truth tables.
– Truth table completely specifies outputs for all input combinations.
• The above circuit is an inverter.
– An input of 0 is inverted to a 1.
– An input of 1 is inverted to a 0.

Digital Logic Design - Ali Saleh 7


The AND Gate

A
Y
B

• This is an AND gate.


• So, if the two inputs signals
Truth Table
are asserted (high) the
output will also be asserted. A B Y
Otherwise, the output will
0 0 0
be deasserted (low).
0 1 0

1 0 0

1 1 1

Digital Logic Design - Ali Saleh 8


The OR Gate

A
Y
B

• This is an OR gate. A B Y
• So, if either of the two
0 0 0
input signals are
asserted, or both of 0 1 1
them are, the output
1 0 1
will be asserted.
1 1 1

Digital Logic Design - Ali Saleh 9


Describing Circuit Functionality:
Waveforms

• Waveforms provide another approach for representing functionality.


• Values are either high (logic 1) or low (logic 0).
• Can you create a truth table from the waveforms?

Digital Logic Design - Ali Saleh 10


Consider three-input
gates

3 Input OR Gate

Digital Logic Design - Ali Saleh 11


Ordering Boolean Functions

• 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.
• Note that parentheses are needed here :

Digital Logic Design - Ali Saleh 12


Boolean Algebra

• A Boolean algebra is defined as a closed algebraic system containing


two or more elements and the two operators, . and +.
• Useful for identifying and minimizing circuit functionality
• Identity elements
– a+0=a
– a.1=a
• 0 is the identity element for the + operation.
• 1 is the identity element for the . operation.

Digital Logic Design - Ali Saleh 13


Commutativity and Associativity of the Operators

• The Commutative Property:


For every a and b in K,
– a+b=b+a
– a.b=b.a
• The Associative Property:
For every a, b, and c in K,
– a + (b + c) = (a + b) + c
– a . (b . c) = (a . b) . c

Digital Logic Design - Ali Saleh 14


Distributivity of the Operators and Complements
• The Distributive Property:
For every a, b, and c in K,
– a+(b.c)=(a+b).(a+c)
– a.(b+c)=(a.b)+(a.c)
• The Existence of the Complement:
For every a in K there exists a unique element called a’
(complement of a) such that,
– a + a’ = 1
– a . a’ = 0
• To simplify notation, the . operator is frequently omitted. When
two elements are written next to each other, the AND (.) operator
is implied…
– a+b.c=(a+b).(a+c)
– a + bc = ( a + b )( a + c )

Digital Logic Design - Ali Saleh 15


Duality

• The principle of duality is an important concept. This says that if


an expression is valid in Boolean algebra, the dual of that expression
is also valid.
• To form the dual of an expression, replace all + operators with .
operators, all . operators with + operators, all ones with zeros, and
all zeros with ones.
• Form the dual of the expression
a + (bc) = (a + b)(a + c)
• Following the replacement rules…
a(b + c) = ab + ac
• Take care not to alter the location of the parentheses if they are
present.

Digital Logic Design - Ali Saleh 16


Involution

• This theorem states:


a’’ = a
• Remember that aa’ = 0 and a+a’=1.
– Therefore, a’ is the complement of a and a is also the
complement of a’.
– As the complement of a’ is unique, it follows that a’’=a.
• Taking the double inverse of a value will give the initial value.

Digital Logic Design - Ali Saleh 17


Absorption

• This theorem states:


a + ab = a a(a+b) = a
• To prove the first half of this theorem:
a + ab = a . 1 + ab
= a (1 + b)
= a (b + 1)
= a (1)
a + ab = a

Digital Logic Design - Ali Saleh 18


DeMorgan’s Theorem

• A key theorem in simplifying Boolean algebra expression is


DeMorgan’s Theorem. It states:
(a + b)’ = a’b’ (ab)’ = a’ + b’

• Complement the expression


a(b + z(x + a’)) and simplify.

(a(b+z(x + a’)))’ = a’ + (b + z(x + a’))’


= a’ + b’(z(x + a’))’
= a’ + b’(z’ + (x + a’)’)
= a’ + b’(z’ + x’a’’)
= a’ + b’(z’ + x’a)

Digital Logic Design - Ali Saleh 19


Additional gates

• We’ve already seen all the basic Boolean operations and


the associated primitive logic gates.
• There are a few additional gates that are often used in
logic design.
– They are all equivalent to some combination of
primitive gates.
– But they have some interesting properties in their
own right.

Digital Logic Design - Ali Saleh 20


Additional Boolean operations

NAND NOR XOR


Operation:
(NOT-AND) (NOT-OR) (eXclusive OR)

Expressions: (xy)’ = x’ + y’ (x + y)’ = x’ y’ x  y = x’y + xy’

Truth table: x y (xy)’ x y (x+y)’ x y xy


0 0 1 0 0 1 0 0 0
0 1 1 0 1 0 0 1 1
1 0 1 1 0 0 1 0 1
1 1 0 1 1 0 1 1 0

Logic gates:

Digital Logic Design - Ali Saleh 21


NAND/OR Gates Illustrations

NAND in the form of AND


NAND
(NOT-AND)
NAND in the form of OR

NOR in the form of OR


NOR
(NOT-OR)
NOR in the form of AND

Digital Logic Design - Ali Saleh 22


Interpretation of the two NAND gate symbols

(AB)’

A’+B’=(AB)’

• Determine the output expression for circuit via DeMorgan’s


Theorem

Digital Logic Design - Ali Saleh 23


XOR gates
• A two-input XOR gate outputs true when exactly one of its inputs is
true:
x y xy
0 0 0
0 1 1 x  y = x’ y + x y’
1 0 1
1 1 0

• x  0fascinating
Several =x x  XOR
properties of the 1 = x’operation:
xx=0 x  x’ = 1
x  (y  z) = (x  y)  z [ Associative ]
xy=yx [ Commutative ]

Digital Logic Design - Ali Saleh 24


More XOR tidbits
• The general XOR function is true when an odd number of its arguments are true.
• For example, we can use Boolean algebra to simplify a three-input XOR to the
following expression and truth table.

x y z xyz
x  (y  z) 0 0 0 0
= x  (y’z + yz’) [ Definition of XOR ] 0 0 1 1
= x’(y’z + yz’) + x(y’z + yz’)’ [ Definition of XOR ] 0 1 0 1
= x’y’z + x’yz’ + x(y’z + yz’)’ [ Distributive ] 0 1 1 0
= x’y’z + x’yz’ + x((y’z)’ (yz’)’) [ DeMorgan’s ]
1 0 0 1
= x’y’z + x’yz’ + x((y + z’)(y’ + z)) [ DeMorgan’s ]
= x’y’z + x’yz’ + x(yz + y’z’) [ Distributive ] 1 0 1 0
= x’y’z + x’yz’ + xyz + xy’z’ [ Distributive ] 1 1 0 0
1 1 1 1

• XOR is especially useful for building adders (as we’ll see on later) and error
detection/correction circuits.

Digital Logic Design - Ali Saleh 25


XNOR gates
• Finally, the complement of the XOR function is the XNOR function.
• A two-input XNOR gate is true when its inputs are equal:

x y (xy)’
0 0 1
0 1 0 (x  y)’ = x’y’ + xy
1 0 0
1 1 1

Digital Logic Design - Ali Saleh 26

You might also like