Docsity

Combinational Logic Design Case Studies: Examples and Design Procedures, Exercises of Digital Systems Design

Partial preview of the text

Download Combinational Logic Design Case Studies: Examples and Design Procedures and more Exercises Digital Systems Design in PDF only on Docsity!

Combinational Logic Design Case Studies

 General design procedure

 Examples

 Calendar subsystem

 BCD to 7-segment display controller

 Process line controller

 Logical function unit

 Arithmetic

 Integer representations

 Addition/subtraction

 Arithmetic/logic units

General Design Procedure for Combinational

Logic

 1. Understand the Problem

 What is the circuit supposed to do?

 Write down inputs (data, control) and outputs

 Draw block diagram or other picture

 2. Formulate the Problem using a Suitable Design

Representation

 Truth table or waveform diagram are typical

 May require encoding of symbolic inputs and outputs

 3. Choose Implementation Target

 ROM, PAL, PLA

 Mux, decoder and OR-gate

 Discrete gates

 4. Follow Implementation Procedure

 K-maps for two-level, multi-level

 Design tools and hardware description language (e.g., Verilog)

month leap 28 29 30 31 month leap 28 29 30 31 0000 – – – – – 0001 – 0 0 0 1 0010 0 1 0 0 0 0010 1 0 1 0 0 0011 – 0 0 0 1 0100 – 0 0 1 0 0101 – 0 0 0 1 0110 – 0 0 1 0 0111 – 0 0 0 1 1000 – 0 0 0 1 1001 – 0 0 1 0 1010 – 0 0 0 1 1011 – 0 0 1 0 1100 – 0 0 0 1 1101 – – – – – 111– – – – – –

Formalize the Problem

 Encoding:

 Binary number for month: 4 bits

 4 wires for 28, 29, 30, and 31

one-hot – only one true at any time

 Block diagram:

month leap 28 29 30 31 0000 – – – – – 0001 – 0 0 0 1 0010 0 1 0 0 0 0010 1 0 1 0 0 0011 – 0 0 0 1 0100 – 0 0 1 0 0101 – 0 0 0 1 0110 – 0 0 1 0 0111 – 0 0 0 1 1000 – 0 0 0 1 1001 – 0 0 1 0 1010 – 0 0 0 1 1011 – 0 0 1 0 1100 – 0 0 0 1 1101 – – – – – 111– – – – – –

Choose Implementation Target

and Perform Mapping

 Discrete gates

 Can translate to S-o-P

or P-o-S

m8’ m4’ m2 m1’ leap’ m8’ m4’ m2 m1’ leap m8’ m4 m1’ + m8 m m8’ m1 + m8 m1’

A B C D C0 C1 C2 C3 C4 C5 C

Formalize the problem

 Truth table

 Show don't cares

 Choose implementation

target

 If ROM, we are done

 Don't cares imply PAL/PLA

may be attractive

 Follow implementation

procedure

 Minimization using K-maps

C0 = A + B D + C + B' D'

C1 = C' D' + C D + B'

C2 = B + C' + D

C3 = B' D' + C D' + B C' D + B' C

C4 = B' D' + C D'

C5 = A + C' D' + B D' + B C'

C6 = A + C D' + B C' + B' C

Implementation as Minimized Sum-of-

Products

 15 unique product terms when minimized

individually

1 0 X 1 0 1 X 1 1 1 X X 1 1 X X D A B C 1 1 X 1 1 0 X 1 1 1 X X 1 0 X X D A B C 0 1 X 1 0 1 X 1 1 0 X X 1 1 X X D A B C 1 1 X 1 1 1 X 1 1 1 X X 0 1 X X D A B C 1 0 X 1 0 1 X 0 1 0 X X 1 1 X X D A B C 1 0 X 1 0 0 X 0 0 0 X X 1 1 X X D A B C 1 1 X 1 0 1 X 1 0 0 X X 0 1 X X D A B C

BC'

B'C

B'D

BC'D

C'D'

CD

B'D'

A

BCD'

A B C D

C0 C1 C2 C3 C4 C5 C6 C

PLA implementation

C0 = C3 + A' B X' + A D Y

C1 = Y + A' C5' + C' D' C

C2 = C5 + A' B' D + A' C D

C3 = C4 + B D C5 + A' B' X'

C4 = D' Y + A' C D'

C5 = C' C4 + A Y + A' B X

C6 = A C4 + C C5 + C4' C5 + A' B' C

X = C' + D'

Y = B' C'

C2 = B + C' + D

C2 = B' D + B C' D + C' D' + C D + B C D'

C2 = B' D + B C' D + C' D' + W

W = C D + B C D'

PAL Implementation

 Limit of 4 Product Terms per Output

 Decomposition of functions with larger number of terms

 Do not share terms in PAL anyway

(although there are some with some shared terms)

 Decompose into multi-level logic (hopefully with CAD

support)

 (^) Find common sub-expressions among functions need another input and another output

Sketch of Problem

 Position of Sensors

 A to B distance = specification – 5%

 A to C distance = specification + 5%

Within Spec Too Short Too Long

A

B

C

spec

  • 5% spec
  • 5%

logic implementation now straightforward just use three 3-input AND gates "too short" = AB'C' (only first sensor tripped) "in spec" = A B C' (first two sensors tripped) "too long" = A B C (all three sensors tripped) A B C Function 0 0 0 do nothing 0 0 1 do nothing 0 1 0 do nothing 0 1 1 do nothing 1 0 0 too short 1 0 1 don't care 1 1 0 in spec 1 1 1 too long

Formalize the problem

 Truth Table

 Show don't cares

choose implementation technology 5-variable K-map to discrete gates multiplexer implementation 1 0

A

B

A

B

A

B

Formalize the Problem

C0 C1 C2 A B F 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 0 1 1 0 1 1 1 0 1 0 1 1 1 1 0 1 0 0 0 0 1

C0 C1 C

S

8:1 MUX

S1 S

F

Arithmetic Circuits

 Excellent Examples of Combinational Logic Design

 Time vs. Space Trade-offs

 Doing things fast may require more logic and thus more

space

 Example: carry lookahead logic

 Arithmetic and Logic Units

 General-purpose building blocks

 Critical components of processor datapaths

 Used within most computer instructions

Sign and Magnitude

 One bit dedicate to sign

(positive or negative)

 sign: 0 = positive (or zero), 1 = negative

 Rest represent the absolute

value or magnitude

 three low order bits: 0 (000)

thru 7 (111)

 Range for n bits

 +/– 2n–1 –1 (two representations

for 0)

 Cumbersome addition/subtraction

 must compare magnitudes

to determine sign of result

1000 = –7 in 1s complement form

1s Complement

 If N is a positive number, then the negative of N ( its 1s

complement or N' ) is N' = (2n– 1) – N

 (^) Example: 1s complement of 7  (^) Shortcut: simply compute bit-wise complement ( 0111 -> 1000 )