Sei sulla pagina 1di 36

UNIT 3:

COMBINATIONAL LOGIC

Jeff Shelton 24 January 2014

STATIC AND DYNAMIC


BEHAVIOR
General Systems
Static Systems

Outputs depends on the current values of the inputs


Described by algebraic equations
Can be implemented as a look-up-table (LUT)

Dynamic Systems

Outputs depends on the current and past values of the inputs


Described by differential equations (calculus)

Jeff Shelton 24 January 2014

STATIC AND DYNAMIC


BEHAVIOR
True/False (Binary) Systems
Static behavior

Described by combinational logic (Unit 3)


Subject to mathematical tools of Boolean algebra

Dynamic behavior

Described by sequential logic (Unit 4)


Developed ad hoc (no formal calculus for binary systems)

Jeff Shelton 24 January 2014

UNIT 3:
COMBINATIONAL LOGIC

Jeff Shelton 24 January 2014

BOOLEAN ALGEBRA
George Boole English mathematician (1815-1864)

Jeff Shelton 24 January 2014

BOOLEAN ALGEBRA
Algebra dealing with variables that may assume two
(and only two) values.
Typical symbol pairs to represent Boolean values:
0/1
TRUE/FALSE
ON/OFF
OPEN/CLOSE
HI/LO

Jeff Shelton 24 January 2014

BOOLEAN ALGEBRA
Expression of numerical values using a base-2 system
(0/1) is called a binary representation.
5

101

Boolean logic is not dependent upon using binary


values to represent Boolean values. However, it is quite
convenient for use in digital computing devices.

Jeff Shelton 24 January 2014

BOOLEAN ALGEBRA
NOT ( or

or / )

Truth Table:
0

Map:

Jeff Shelton 24 January 2014

BOOLEAN ALGEBRA
AND ( )

Truth Table:

Map:

Jeff Shelton 24 January 2014

AND
0

BOOLEAN ALGEBRA
OR ( + )
+

Truth Table:

Map:

Jeff Shelton 24 January 2014

OR
0

10

BOOLEAN ALGEBRA
XOR ( ) "Exclusive OR"

Truth Table:

Map:

Jeff Shelton 24 January 2014

XOR
0

11

BOOLEAN ALGEBRA
Equations:
Write equations in the normal way
Hierarchy and parentheses usage borrowed from
ordinary algebra
Unlike ordinary algebra, the AND and OR operators are
dual operators if one substitutes 0 for 1, and also
substitutes AND for OR, the result is unchanged

Jeff Shelton 24 January 2014

12

BOOLEAN ALGEBRA
Axioms:
Commutativity:

Associativity:

Distributivity:

Existence of 0 and 1:

0
1

Existence of complements:
Jeff Shelton 24 January 2014

0
1
13

BOOLEAN ALGEBRA
Theorems
Can be proven either through algebraic manipulation (as in
ordinary algebra) or by exhaustive substitution.

Useful Theorems:
Idempotent Operators:

Absorption:

Simplification:

DeMorgans Law:

Jeff Shelton 24 January 2014

14

COMBINATIONAL LOGIC
DESIGN
Use Boolean algebra to go from design specification to
implementable logic function
Boolean algebra can be used to design systems that
have:
Binary inputs
Binary outputs
No history dependence or memory

Jeff Shelton 24 January 2014

15

COMBINATIONAL LOGIC
DESIGN
Example: Electronic Door Lock
The lock has a set of buttons. To enter (open the lock), one must
press down the correct combination of buttons.
Inputs: buttons B1 and B2, Button-IN = 1, Button-OUT = 0
Output: Lock actuator (L), 0 = Lock, 1 = Unlock
Truth Table: (two button lock)

0
0
1
0

Jeff Shelton 24 January 2014

16

SUM OF PRODUCTS
Generate an algebraic expression for desired
function from a truth table by creating a
sum-of-products expression:

0
0
1
0

Form a sum-of-products function:

where each
term expresses one of n possible combinations
of the input variables, or their complements, as Boolean
products. Treat ones in the truth table as uncomplimented
variables, and zeros as complimented variables.
Drop terms corresponding to an output of zero in the truth
table.

Jeff Shelton 24 January 2014

17

SUM OF PRODUCTS

0
0
1
0

Example: Two button door lock

Form a sum-of-products function:


1 2

1 2

1 2

1 2

Drop terms associated with an output of zero in the truth


table:
1 2

1 2

1 2

1 2

1 2

Jeff Shelton 24 January 2014

18

SUM OF PRODUCTS

0
0
1
0

All Boolean design flows from this


procedure. It is the Boolean
equivalent of regression, but it is
exact!

Jeff Shelton 24 January 2014

19

PRODUCT OF SUMS

0
0
1
0

Complementary to Sum-of-Products
All rules are dual
Example: Two button door lock
Form product of sums function:
1

Drop terms with truth table output of 1:


1

In this example, the product-of-sums expression is more complex than the


sum-of-products.
Complexity is problem dependent
Function minimization can be done algebraically and graphically.

Jeff Shelton 24 January 2014

20

GRAPHICAL
MINIMIZATION
Based on the repeated application of

If two sum-of-products terms are identical, except that one variable


is complimented in the first term and uncomplimented in the
second, the variable can be removed
Construct a map such that only one variable changes its value
between the adjacent cells
Pairs of adjacent cells can then be combined as can pairs of pairs

Jeff Shelton 24 January 2014

21

GRAPHICAL
MINIMIZATION
Example: A new two button door lock
A two button door lock with two possible combinations:
0
1
0
1

Adjacent 1s are collected


Keep only terms that dont change for the final expression
1 2
0
1
Jeff Shelton 24 January 2014

0
1

1 2

1 2

2
22

GRAPHICAL
MINIMIZATION
Non-Reducible Maps
Door Lock example (alternate combination)
1 2

0
1

1 2

1
0

Mapped method does not guarantee absolute minimum. It


is a minimum for the product-of-sums (or dual) form
More Variables
3-variable map is three dimensional!
Need to map 3-D maps to 2-D AND preserve adjacency
Need a different way than the natural binary counting order

Jeff Shelton 24 January 2014

23

GRAY CODE
A counting sequence for which successive values change
by only one bit at a time
Multi-bit changes causes problem if data is accessed while
the changes are in-progress:
Straight binary counting two transitions involve changing
of both bits: 00 01 10 11
!"# $ "%
&#' ()
% *+,"' )!+%,-

Depends on which bit changes first, the intermediate values


will come from the following sequence:
01 00 10

or

01 11 10

Alternative counting order:


00 01 11 10

Jeff Shelton 24 January 2014

24

REFLECTED GRAY CODE


General procedure for creating a reflected binary code:
A 1-bit Gray code has two values, 0 and 1
The first 2n code words of an (n+1)-bit Gray code equals to
the code word of an n-bit Gray code, written in order with a
leading 0 appended
The last 2n code words of an (n+1)-bit Gray code equals to
the code word of an n-bit Gray code, written in reverse
order with a leading 1 appended

Jeff Shelton 24 January 2014

25

REFLECTED GRAY CODE


Creating:
Start with 1 bit:
2-bit:

01

Write 1-bit Gray code with leading bit set at 0:


01

Get remaining numbers by reflecting, prefixing, and concatenating:


01
00 01

Reflect
Prefix

00 01 11 10

Concatenate

Jeff Shelton 24 January 2014

10
11 10

26

REFLECTED BINARY CODE


Creating:
3-bit:

Reflecting, prefixing, and concatenating:


00 01 11 10
Reflect
000 001 011 010 Prefix

10 11 01 00
110 111 101 100

000 001 011 010 110 111 101 100 Concatenate

Jeff Shelton 24 January 2014

27

REFLECTED GRAY CODE


Converting:
The bits of an n-bit binary or Gray-code code word are
numbered from right to left, from 0 to n1
Bit i of a Gray-code word is 0 if bits i and i+1 of the
corresponding binary code word are the same, else bit i
is 1. (When i+1=n, bit n of the binary code is
considered to be 0.)

Jeff Shelton 24 January 2014

28

ASYNCHRONOUS INPUTS
If non-Gray-code coding scheme is used, asynchronous
input requires a synchronizer (clock) or handshake
must be used
Clocked I/O All registers and memories are updated at
either the rising edge or the falling edge of the clock
signal and are ready to be read at the next transition of
the clock signal
Handshake Devices that are outputting values will
broadcast when the data is ready to be read

Jeff Shelton 24 January 2014

29

ASYNCHRONOUS INPUTS
If Gray code is used, input signal can be used with no
synchronizer
Input must go through all intermediate values to get
from one value to another
Reading at any time will give valid result
In value is changing, result will be either the old or the
new value; never a spurious value

Jeff Shelton 24 January 2014

30

PSEUDO CIRCUITS
First step in circuit design
Convert Boolean equations into logic block diagrams
Very close to actual circuit elements
Standard symbols:
AND

NAND
NOT

OR

NOR

NAND gate is NOT(AND):


NOR gate is NOT(OR):

NAND and NOR are the most common gates which stems from the
transistor structure of the semiconductor gates

Jeff Shelton 24 January 2014

./.0
.23

31

DEMORGANS LAW
Converting AND/OR form logic circuits (equations) to
NAND/NOR form logic circuits (equations).
The equivalents for OR and AND are:

Jeff Shelton 24 January 2014

32

7400 LOGIC SERIES

Image: https://upload.wikimedia.org/wikipedia/commons/2/26/7400.jpg
Jeff Shelton 24 January 2014

33

7400 LOGIC SERIES


Hex 1-input gates
7404 Inverter (NOT)
Quad 2-input gates
7400 NAND
7402 NOR
7408 AND
7432 OR
7486 XOR
Triple 3-input gates
7410 NAND
7411 AND
7427 NOR
Dual 4-input gates
7420 NAND
7421 AND
plus hundreds more!
Jeff Shelton 24 January 2014

34

PSEUDO CIRCUIT
Door lock example:
Boolean Equation:

1 2

Pseudo Circuit:

Convert to NAND/NOR form:

Jeff Shelton 24 January 2014

35

CIRCUIT DIAGRAM

Jeff Shelton 24 January 2014

36

Potrebbero piacerti anche