ch 6. combinational logic design practices

108
Ch 6. Combinational Logic Design Practices 6.1 Documentation standards The type of documentation depends on system complexity and the engineering and manufacturing environments, a documentation package should generally contain at least the following six item: 1. Specification ( I/O, function ) 2. Block diagram ( pictorial description ) 3. Schematic diagram (electrical components, interconnection IC type) 4. Timing diagram (logic signals as a function) 5. Structured logic device description ( logic equations, state tables/diagram) 6. Circuit description ( narrative text document)

Upload: dawn

Post on 23-Feb-2016

49 views

Category:

Documents


1 download

DESCRIPTION

6.1 Documentation standards The type of documentation depends on system complexity and the engineering and manufacturing environments, a documentation package should generally contain at least the following six item: Specification ( I/O, function ) Block diagram ( pictorial description ) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Ch 6. Combinational Logic Design Practices

Ch 6. Combinational Logic Design Practices

6.1 Documentation standards

The type of documentation depends on system complexity and the engineering and manufacturing environments, a documentation package should generally contain at least the following six item:

1. Specification ( I/O, function )2. Block diagram ( pictorial description )3. Schematic diagram (electrical components, interconnection IC type)4. Timing diagram (logic signals as a function)5. Structured logic device description

( logic equations, state tables/diagram)6. Circuit description ( narrative text document)

Page 2: Ch 6. Combinational Logic Design Practices

6.1.1 Block Diagrams

Control Signal

Page 3: Ch 6. Combinational Logic Design Practices

6.1.2 Gate Symbols

F = (A’ * B’)’ = A’’ + B’’ = A + B

AB F

Page 4: Ch 6. Combinational Logic Design Practices

6.1.3 Signal Names and Active Levels

Page 5: Ch 6. Combinational Logic Design Practices

6.1.4 Active Levels for Pins

Page 6: Ch 6. Combinational Logic Design Practices

6.1.4 Active Levels for Pins

Page 7: Ch 6. Combinational Logic Design Practices

6.1.5 Bubble-to-Bubble Logic Design

Page 8: Ch 6. Combinational Logic Design Practices

6.1.5 Bubble-to-Bubble Logic Design

(A * SEL)’

(B * SEL’)’ = ((A*SEL)’ * (B * SEL’)’)’= A*SEL + B*SEL’(Hard to read)

(Easy to read)

Page 9: Ch 6. Combinational Logic Design Practices

6.1.5 Bubble-to-Bubble Logic Design

Page 10: Ch 6. Combinational Logic Design Practices

6.1.7 Drawing Layout

Page 11: Ch 6. Combinational Logic Design Practices

6.1.8 Buses

Page 12: Ch 6. Combinational Logic Design Practices

6.1.8 Buses

Page 13: Ch 6. Combinational Logic Design Practices

/ 16

/ 8/ 8

6.1.8 Buses

Page 14: Ch 6. Combinational Logic Design Practices

6.1.9 Additional Schematic Information

Page 15: Ch 6. Combinational Logic Design Practices

6.2 Circuit Timing

Most digital systems are sequential circuits that operate step-by-step under the control of a periodic clock signal, and the speed of the clock is limited by the worst-case time that it takes for the operations in on step to complete.

Thus digital designers need to be keenly aware of timing behavior in order to build fast circuits that operate correctly under all conditions

1. Timing Diagrams2. Propagation Delay3. Timing Specifications4. Timing Analysis5. Timing Analysis Tools

Page 16: Ch 6. Combinational Logic Design Practices

6.2.1 Timing Diagrams

Causality

Page 17: Ch 6. Combinational Logic Design Practices

Uncertain transition

6.2.1 Timing Diagrams

Page 18: Ch 6. Combinational Logic Design Practices

6.2.2 Propagation Delay

- maximum/minimum delay

- typical : average ex) 99% good IC, CKT with 100 IC

- worst-case delay

Vin Vout

tpHL tpLH

sum of worst case delay through individual component

=

=

max. delay

(1 - 0.99100 ) x 100 = 63% ( would not work)

Page 19: Ch 6. Combinational Logic Design Practices

6.2.3 Timing Specifications

The timing specification for a device may give minimum, typical, and maximum values for each propagation-delay path and transition direction

Page 20: Ch 6. Combinational Logic Design Practices

6.3 Combinational PLDs

6.3.1 Programmable Logic Arrays : PLA

# of inputs (n) # of outputs (m) # of product term (P)

Contains p AND gates(2n-input) and m OR gates(p inputs)

- 2n-input AND gate -> p- P-input OR gate -> m

- → PLA fuses are ‘x’ in the figure and nonvolatile memory cells. - → They are programmed.

‘ n X m PLA with P product term ‘

2n = true or complement of input

Page 21: Ch 6. Combinational Logic Design Practices

6.3.1 Programmable Logic Arrays

Page 22: Ch 6. Combinational Logic Design Practices

6.3.1 Programmable Logic Arrays

O1 = I1·I2 + I1´·I2´·I3´·I4´O2 = I1·I3´ + I1´·I3·I4 + I2O3 = I1·I2 + I1·I3´ + I1´·I2´·I4´

= I1*I2 + I1’*I2’*I3’*I4’

P1 P2

Page 23: Ch 6. Combinational Logic Design Practices

6.3.1 Programmable Logic Arrays

Page 24: Ch 6. Combinational Logic Design Practices

6.3.2 Programmable Array Logic Devices

 

Page 25: Ch 6. Combinational Logic Design Practices

6.3.3 Generic Array Logic Devices

[Ex-2] GAL16L8 : Fig 27

input output

• XOR gate between OR and inverter output polarity

= if fuse -> intact, XOR = AB+AB (B =0) = A (PASS)

-> blown , XOR = AB+AB (B=1)

= A ( inverting)

Page 26: Ch 6. Combinational Logic Design Practices

6.3.4 Complex Programmable Logic Devices(CPLDs) Chapter 9

Page 27: Ch 6. Combinational Logic Design Practices

6.3.5 CMOS PLD Circuits

5V

A

B B

AX = A·B X = A+B

i) AND-OR diode logic

• fusible link, high voltage ( 10~30V ) -> OFF

• masked programmed PLD -> ROM

Page 28: Ch 6. Combinational Logic Design Practices

6.3.5 CMOS PLD Circuitsii) CMOS PLD CKTs

< AND plane >

< OR plane >

Page 29: Ch 6. Combinational Logic Design Practices

6.3.5 CMOS PLD Circuits iii) erasable PLD accumulated charge at high volt(25V)

ultra-violet light -> erase

Ex) PLD writer : PLD programmer and testing (test vector generation)

floating gate ( change storage device)10 years -> 70% decay

Page 30: Ch 6. Combinational Logic Design Practices

6.4 Decoder

A decoder is a multiple-input, multiple-out logic circuit that converts coded inputs into coded outputs, where the input and output codes are different

1. Binary Decoders2. Logic Symbols for Larger-Scale Elements3. The 74x138 3-to-8 Decoder4. Decoders in VHDL

Page 31: Ch 6. Combinational Logic Design Practices

6.4.1 Binary Decoder

- 2n decoder n bit binary input code

1 out of 2n output code

Page 32: Ch 6. Combinational Logic Design Practices

P.52 [Fig6] Gary code

6.4.1 Binary Decoder

Page 33: Ch 6. Combinational Logic Design Practices

6.4.3 The 74x138 3-to-8 Decoder

Y5 = G1*G2A*G2B*CB’A

Enable Select

Page 34: Ch 6. Combinational Logic Design Practices

6.4.3 The 74x138 3-to-8 Decoder

G2A = G2A_L’, G2B = G2B_L’, Y5 = Y5_L’

Y5 = G1 * G2A * G2B * CB’A

Y5_L = G1’ + G2A_L + G2B_L +C’ + B + A’

Page 35: Ch 6. Combinational Logic Design Practices

6.4.3 The 74x138 3-to-8 Decoder

• 3 enable inputs : G1, G2A , G2B

• ex) Y5 = G1· G2A · G2B·A·B·C

Y5´ = (G1· G2A · G2B·A·B·C)´ = G1´+ G2A + G2B+A+B+C

because of inversion bubble on Y5

Page 36: Ch 6. Combinational Logic Design Practices

6.4.4 Cascading Binary Decodershigher order decoder : tree decoding

• 4 select inputs : N0 N1 N2 N3

+ 1 enable EN

• SN74154 ( 1 out of 16 decoder )

Page 37: Ch 6. Combinational Logic Design Practices

6.4.4 Cascading Binary Decoders

3LSBs

2MSBs

N4*N3 = 00,Y0’ = LN4*N3 = 01,Y1’ = LN4*N3 = 10,Y2’ = LN4*N3 = 11,Y3’ = L

Page 38: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

Entity : Simply a declaration of a module’s inputs and outputs

Architecture : a detailed description of the module’s internal behavior or structure

Page 39: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

When A = 010, then Y_L_i = 11011111

When G1*G2A’’*G2B’’ = G1*G2A_L’*G2B_L’

Page 40: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

Active-level handling

Page 41: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

Page 42: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

Page 43: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

Instead of Table 6-17 Dataflow definition, Behavior Model uses a process and sequential statements

Page 44: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

Page268 Table5-25Convert std_logic_vector to integer

Page 45: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

Page 46: Ch 6. Combinational Logic Design Practices

6.4.6 Decoder in VHDL

Page 47: Ch 6. Combinational Logic Design Practices

6.5 Encoder

A decoder’s output code normally has more bits than its input code. If the device’s output code has fewer bits than the input code, the device is usually called an encoder

1. Priority Encoders2. The 74x148 Priority Encoder3. Encoders in VHDL

Page 48: Ch 6. Combinational Logic Design Practices

6.5.1 Priority Encoders

= I1 + I3 + I5 + I7

= I2 + I3 + I6 + I7

= I4 + I5 + I6 + I7

Page 49: Ch 6. Combinational Logic Design Practices

6.5.1 Priority Encoders

- 2n inputs each indicates a ‘request’ for service(=interrupt request)

- priority encoder each request has a priority- ex) 8-to-3 encoder : 74x148 (I7 = highest priority) idle : if no input

Page 50: Ch 6. Combinational Logic Design Practices

6.5.2 The 74x148 Priority Encoder- logic symbol :

· EI : enable input · Gs : assert if Enable and more than 1 input assert

(group select) · E0 : enable output : connect to EI input of another 148

Page 51: Ch 6. Combinational Logic Design Practices

6.5.2 The 74x148 Priority Encoder

Ex) 15 input priority encoder · 215 possible input combinations

Page 52: Ch 6. Combinational Logic Design Practices

6.5.2 The 74x148 Priority Encoder

If REQ30_L = 0, otehrs = 1Then G3A2_L * G3A1_L * G3A0_L = 001 G3GS_L = 0, G3E0_L = 1

Page 53: Ch 6. Combinational Logic Design Practices

6.5.4 Encoder in VHDL

When GS asserted, E0 deasserted

Initialization

Page 54: Ch 6. Combinational Logic Design Practices

6.6 Three-State Devices

In Section 3.7.3 we described the electrical design of CMOS devices whose outputs may be in one of three states 0,1,Hi-z. In this section we’ll show how to use them

1. Three-State Buffer2. Standard MSI Three-State Buffer3. Three-State Outputs in VHDL

Page 55: Ch 6. Combinational Logic Design Practices

6.6.1 Three-State Buffers

= If SELP_L = 0, SDATA = P

when ABC = ‘000’

Page 56: Ch 6. Combinational Logic Design Practices

6.6.1 Three-State Buffers

· tpLZ or tpHZ < tpZL or tpZH : to avoid fighting (= drive by two device)

· dead time safe way to use 3-state devices to guarantee during the dead time, no one IO driving

Turn-OFF time

Turn-ON time

Page 57: Ch 6. Combinational Logic Design Practices

6.6.2 Standard MSI Three-State Buffers

Page 58: Ch 6. Combinational Logic Design Practices

6.6.2 Standard MSI Three-State Buffers

When RD_L = 0, SEL1_L = 0, SEL2_L = 1, PORT1 UPWhen RD_L = 0, SEL1_L = 1, SEL2_L = 0, PORT2 UP

Page 59: Ch 6. Combinational Logic Design Practices

6.6.2 Standard MSI Three-State Buffers

Page 60: Ch 6. Combinational Logic Design Practices

6.6.2 Standard MSI Three-State Buffers

When ENTFR_L = G’ = L & ATOB = DIR = 1 Bus A -> Bus BWhen ENTFR_L = G’ = L & ATOB = DIR = 0 Bus B -> Bus A

Page 61: Ch 6. Combinational Logic Design Practices

6.6.4 Three-State Outputs in VHDL

Unresolved type

Page 62: Ch 6. Combinational Logic Design Practices

6.6.4 Three-State Outputs in VHDL

Page 63: Ch 6. Combinational Logic Design Practices

6.6.4 Three-State Outputs in VHDL

Page 64: Ch 6. Combinational Logic Design Practices

6.7 Multiplexers

A multiplexer is a digital switch it connects data from one of n sources to its output. Figure 6-57(a) shows the inputs and outputs of an n-input, b-bit multiplexer.

1. Standard MSI Multiplexers2. Expanding Multiplexers3. Multiplexers, Demultiplexers, and Buses4. Multiplexers in VHDL

Page 65: Ch 6. Combinational Logic Design Practices

6.7.1 Standard MSI Multiplexers

8 x 1MUX

EN

3

8

Selcet(A,B,C)

Data(D0~D7)

Y

Y

output

Page 66: Ch 6. Combinational Logic Design Practices

6.7.1 Standard MSI Multiplexers

Page 67: Ch 6. Combinational Logic Design Practices

6.7.2 Expanding Multiplexers

Page 68: Ch 6. Combinational Logic Design Practices

6.7.3 Multiplexers, Demultiplexers, and Buses

Page 69: Ch 6. Combinational Logic Design Practices

6.7.3 Multiplexers, Demultiplexers, and Buses

Page 70: Ch 6. Combinational Logic Design Practices

6.7.5 Multiplexers in VHDL

8

A

B

C

D

8Y

EN

output enable

Sel(S1S0)

Page 71: Ch 6. Combinational Logic Design Practices

6.7.5 Multiplexers in VHDL - use case statement

8

A

B

C

D

8Y

EN

output enable

Sel(S1S0)

Page 72: Ch 6. Combinational Logic Design Practices

6.7.5 Multiplexers in VHDL

Page 73: Ch 6. Combinational Logic Design Practices

6.8 Exclusive-Or Gates and Parity Circuits

1. Exclusive-OR and Exclusive-NOR Gates2. Parity Circuits3. Parity-Checking Applications4. Exclusive-OR Gates and Parity Circuits in VHDL

f = XY + XY = XY + XY = XY· XY = (X + Y)(X + Y) = XY + XY

= XY·XY = (X+Y)(XY) = (X + Y)(X + Y)

fX

Y f = X + Y

X

YXY

f

Page 74: Ch 6. Combinational Logic Design Practices

6.8.1 Exclusive-OR and Exclusive-NOR Gates

Page 75: Ch 6. Combinational Logic Design Practices

6.8.2 Parity Circuits- odd parity and even parity

ex) odd parity circuits

ex) Even parity circuits output inverted

Page 76: Ch 6. Combinational Logic Design Practices

6.8.4 Parity-Checking Applications74x280 9 bit parity generator : even and odd parity check

Page 77: Ch 6. Combinational Logic Design Practices

6.8.4 Parity-Checking Applications• error detecting code between memory and micro processor

ex) parity generation and checking for an 8-bit-wide memory system

When read, parity checking

When write, parity generation

Page 78: Ch 6. Combinational Logic Design Practices

6.8.4 Parity-Checking Applications

Hamming Code :

1 2 3 4 5 6 7 8 10 …P P D P D D D P D …

Check : C0 = 1, 3, 5, 7, 9, …

C1 = 2, 3, 6, 7, 10, 11, …

C2 = 4, 5, 6, 7, 12, 13, …

Ex) error correcting code for Hamming code

Page 79: Ch 6. Combinational Logic Design Practices

6.8.6 Exclusive-OR Gates and Parity Circuits in VHDL

Page 80: Ch 6. Combinational Logic Design Practices

6.8.6 Exclusive-OR Gates and Parity Circuits in VHDL

First bit

XORP=1, if ODD

Page 81: Ch 6. Combinational Logic Design Practices

6.8.6 Exclusive-OR Gates and Parity Circuits in VHDL

Table 6-41 Y = A + B + C

Page 82: Ch 6. Combinational Logic Design Practices

6.8.6 Exclusive-OR Gates and Parity Circuits in VHDL

Page 83: Ch 6. Combinational Logic Design Practices

6.9 ComparatorsComparing two binary words for equality is a commonly used operation in

computer systems and device interfaces

1. Comparator Structure2. Iterative Circuits3. An Iterative Comparator Circuit4. Standard MSI Magnitude Comparators5. Comparators in HDLs

Page 84: Ch 6. Combinational Logic Design Practices

6.9.1 Comparator Structure- 74x86 4bit comparator

ex) magnitude comparator : SN74LS85 G = “A > B” E = “A = B” L = “A < B”

A = A3 A2 A1 A0

B = B3 B2 B1 B0

Page 85: Ch 6. Combinational Logic Design Practices

6.9.2 Iterative Circuits

primary input and output upper inputs and lower output cascading input and output between stageboundary input and output left and right most

Page 86: Ch 6. Combinational Logic Design Practices

6.9.3 An Iterative Comparator Circuits

Page 87: Ch 6. Combinational Logic Design Practices

6.9.4 Standard MSI Magnitude Comparators

Xi = Ai Bi + Ai Bi (i = 0, 1, …) ; equivalenceE = X3 X2 X1 X0

G = A3 B3 + X3 A2 B2 + X3 X2 A1 B1 + X3 X2 X1 A0 B0

L = A3 B3 + X3 A2 B2 + X3 X2 A1 B1 + X3 X2 X1 A0 B0

GT = (A>B) + (A=B)·AGTBin

EQ = (A=B)·AEQBin

LT = (A<B) + (A=B)·ALTBin

74LS85 : 4 bit magnitude comparator

Page 88: Ch 6. Combinational Logic Design Practices

6.9.4 Standard MSI Magnitude Comparators12 bit comparator using 74 x 85

Page 89: Ch 6. Combinational Logic Design Practices

6.9.4 Standard MSI Magnitude Comparators

PEQQ = 0 if all 8 bit pairs equal

PGTQ = 0 if p[7 ~ 0] > Q[7 ~ 0]

Page 90: Ch 6. Combinational Logic Design Practices

6.9.4 Standard MSI Magnitude Comparators8 bit MSI comparator

Page 91: Ch 6. Combinational Logic Design Practices

6.9.7 Comparators in VHDL

Initialize

Page 92: Ch 6. Combinational Logic Design Practices

6.9.7 Comparators in VHDL

Page 93: Ch 6. Combinational Logic Design Practices

6.10 Adders, Subtractors, and ALUsAddition is the most commonly performed arithmetic operation in digital

systems. An adder combines two arithmetic operands using the addition rules described in Chapter 2.

1. Half Adders and Full Adders2. Ripple Adders3. Subtractors4. Carry-Lookahead Adders5. MSI Adders6. MSI Arithmetic and Logic Units7. Group-Carry Lookahead8. Adders in VHDL

X

Y

C

SHA

X Y

C

S

Page 94: Ch 6. Combinational Logic Design Practices

6.10.1 Half Adders and Full Adders

Sum = A(BC+BC) + A(BC + BC)

= A(B + C) + A(B + C)

= A + B + C

Carry = ABC + ABC + ABC + ABC

= C(AB + AB) + AB

= C(A + B) + AB

= BC + AC + AB

Page 95: Ch 6. Combinational Logic Design Practices

6.10.2 Ripple Adders

4 bit adder

4 4

Cout Cin

4

A = A3 A2 A1 A0

+ B = B3 B2 B1 B0

C S3 S2 S1 S0

Page 96: Ch 6. Combinational Logic Design Practices

6.10.3 Subtractor

full subtractors : x – y – Bin B & DX : minuendY : SubtrahendBin : borrow inBout : borrow outD : difference

D = XYBin + XYBin + XYBin + XYBin

= X(Y + Bin) + X(Y + Bin)

= X + Y + Bin

B = XYBin + XYBin + XYBin + XYBin

= X(Y + Bin) + YBin) = XY + XBin + YBin

- 2’s Complement subtractor : X – Y = X + Y +1

Page 97: Ch 6. Combinational Logic Design Practices

6.10.3 Subtractor

Page 98: Ch 6. Combinational Logic Design Practices

6.10.4 Carry-Lookahead Adders

Si = Xi + Yi + Ci

Ci+1 = XY + XCi + YCi

= XY + (X + Y)Ci

carry lookahead factor· carry generator : if Xi = Yi = 1, Ci+1 = 1Gi = Xi ·Yi

· carry propagate signal Pi = Xi + Yi

· Ci+1 = gi + piCi two level AND-OR expression

independent of the inputX0 ~ Xi-1

Y0 ~ Yi-1

one stage carry lookahead adder

Page 99: Ch 6. Combinational Logic Design Practices

6.10.5 MSI Adders74x283 4-bit binary adder

Page 100: Ch 6. Combinational Logic Design Practices

6.10.5 MSI Adders74x283 4-bit binary adder

i) half sum equation : hsi

ii) carry equation

Hsi = Xi + Yi = XiYi + XiYi

= XiYi + XiXi + XiYi + YiYi + (Xi + Yi)(Xi + Yi)

= (Xi + Yi)(XiYi) = pi qi

Ci+1 = pi ·qi + pi ·Ci = pi ·(qi + Ci)

Page 101: Ch 6. Combinational Logic Design Practices

6.10.6 MSI Arithmetic and Logic Unit16 bit group ripple adder 4 bit carry lookahead adder + carry

Page 102: Ch 6. Combinational Logic Design Practices

6.10.6 MSI Arithmetic and Logic Unit

Page 103: Ch 6. Combinational Logic Design Practices

6.10.6 MSI Arithmetic and Logic Unit

Page 104: Ch 6. Combinational Logic Design Practices

6.10.7 Group-Carry Lookahead

multiple ALU to be cascaded without ripple carry between 4 bit groups ( = 74 182 = carry lookahead generator)- 16 bit ALU using group carry lookahead

Page 105: Ch 6. Combinational Logic Design Practices

6.10.7 Group-Carry Lookahead16 bit ALU using group carry lookahead

Page 106: Ch 6. Combinational Logic Design Practices

6.10.9 Adders in VHDL

Concatenation operator to make A,B 8-bit to 9 bit S

Page 107: Ch 6. Combinational Logic Design Practices

6.10.9 Adders in VHDL

Page 108: Ch 6. Combinational Logic Design Practices

6.10.9 Adders in VHDL