engr 212 / csci 310 4 march, 2002 - unc abrock/classes/spring2002/311/lectures/lect20.pdf · engr...

23
1 1 ENGR 212 / CSCI 310 4 March, 2002 All slides except those with blue backgrounds are taken from John Wakerly’s Stanford EE 121, Digital Design Laboratory 2 Programmable Array Logic (PALs) • How beneficial is product sharing? – Not enough to justify the extra AND array • PALs ==> fixed OR array – Each AND gate is permanently connected to a certain OR gate. • Example: PAL16L8

Upload: doanngoc

Post on 13-May-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

1

1

ENGR 212 / CSCI 3104 March, 2002

All slides except those with blue backgrounds are taken from John Wakerly’s

Stanford EE 121, Digital Design Laboratory

2

Programmable Array Logic (PALs)• How beneficial is product sharing?

– Not enough to justify the extra AND array• PALs ==> fixed OR array

– Each AND gate is permanently connected to a certain OR gate.

• Example: PAL16L8

Page 2: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

2

3

• 10 primary inputs• 8 outputs, with 7 ANDs

per output• 1 AND for 3-state enable• 6 outputs available as

inputs– more inputs, at expense of

outputs– two-pass logic, helper terms

• Note inversion on outputs– output is complement of

sum-of-products– newer PALs have

selectable inversion

4

Designing with PALs• Compare number of inputs and outputs of the

problem with available resources in the PAL.• Write equations for each output using ABEL.• Compile the ABEL program, determine

whether minimimized equations fit in the available AND terms.

• If no fit, try modifying equations or providing “helper” terms.

Page 3: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

3

5

“Recent” PLA’s• TI EPIC (1989)• SPLD

– Simple Programmable Logic Design• PLA – Programmable Logic Array• PAL – Programmable Logic Array• GAL – Generic Array Logic

• Programmable Logic FAQ

6

Decoders• General decoder structure

• Typically n inputs, 2n outputs– 2-to-4, 3-to-8, 4-to-16, etc.– with a few enable inputs

Page 4: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

4

7

Binary 2-to-4 decoder

Note “x” (don’t care) notation.

8

MSI 2-to-4 decoder

• Input buffering (less load)• NAND gates (faster)

Page 5: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

5

9

Decoder Symbol

10

3-to-8 decoder

Page 6: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

6

11

74x138 3-to-8-decoder symbol

12

Decoder cascading

4-to-16 decoder

Page 7: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

7

13

More cascading

5-to-32 decoder

14

ABEL / PAL Version of 74x138module Z74X138

title '74x138 Decoder PLD J. Wakerly, Stanford University‘

"Z74X138 device 'P16L8';

" Input pins

A, B, C, !G2A, !G2B, G1 pin 1, 2, 3, 4, 5, 6;

" Output pins

!Y0, !Y1, !Y2, !Y3 pin 19, 18, 17, 16 istype 'com'; !Y4, !Y5, !Y6, !Y7 pin 15, 14, 13, 12 istype 'com';

" Constant expressionENB = G1 & G2A & G2B;

Page 8: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

8

15

ABEL decoder program (continuedequationsY0 = ENB & !C & !B & !A; Y1 = ENB & !C & !B & A; Y2 = ENB & !C & B & !A; Y3 = ENB & !C & B & A; Y4 = ENB & C & !B & !A; Y5 = ENB & C & !B & A; Y6 = ENB & C & B & !A; Y7 = ENB & C & B & A;

end Z74X138

16

Decoder applications• Microprocessor memory systems

– selecting different banks of memory• Microprocessor input/output systems

– selecting different devices• Microprocessor instruction decoding

– enabling different functional units• Memory chips

– enabling different rows of memory depending on address

• Lots of other applications

Page 9: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

9

17

Encoders vs. Decoders

Decoder Encoder

18

Binary encoders

Page 10: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

10

19

Need priority in most applications

20

8-input priority encoder

Page 11: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

11

21

Priority-encoder logic equations

22

74x148 8-input priority encoder

– Active-low I/O– Enable Input– “Got Something”– Enable Output

Page 12: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

12

23

74x148circuit

24

74x148 Truth Table

Page 13: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

13

25

Cascading priority encoders

• 32-inputpriority encoder

26

Multiplexers

Page 14: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

14

27

74x1518-input

multiplexer

28

74x151 truth table

Page 15: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

15

29

Easy ABEL multiplexer codemodule mux4in8b title '4-input, 8-bit wide multiplexer PLD J. Wakerly, Stanford University'

" Input and output pins !G pin; " Output enableS1..S0 pin; " Select inputsA1..A8, B1..B8, C1..C8, D1..D8 pin; " input busesY1..Y8 pin istype 'com'; " three-state output bus

" SetsSEL = [S1..S0];A = [A1..A8];B = [B1..B8];C = [C1..C8];D = [D1..D8];Y = [Y1..Y8];

equations

Y.OE = G; “ support variesWHEN (SEL == 0) THEN Y = A;ELSE WHEN (SEL == 1) THEN Y = B;ELSE WHEN (SEL == 2) THEN Y = C;ELSE WHEN (SEL == 3) THEN Y = D;

end mux4in8b

30

CMOS transmission gates

• 2-input multiplexer

Page 16: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

16

31

Three-state buffers• Output = LOW, HIGH, or Hi-Z.

• Can tie multiple outputs together, if at most one at a time is driven.

32

Different flavors

Page 17: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

17

33

34

Timing considerations

Page 18: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

18

35

Three-state drivers

36

Driver application

Page 19: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

19

37

Three-state transceiver

38

Barrel shifter design example• n data inputs, n data outputs• Control inputs specify number of positions to

rotate or shift data inputs• Example: n = 16

– DIN[15:0], DOUT[15:0], S[3:0] (shift amount)• Many possible solutions, all based on

multiplexers

Page 20: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

20

39

2-input XOR gates• Like an OR gate, but excludes the case

where both inputs are 1.

• XNOR: complement of XOR

40

XOR and XNOR symbols

Page 21: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

21

41

Gate-level XOR circuits• No direct realization with just a few transistors.

42

CMOS XOR with transmission gates

IF B==1 THEN Z = !A;ELSE Z = A;

Page 22: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

22

43

Parity tree• Faster with balanced tree structure

44

Comparators• Not Op Amps• Inputs

– Pairs of n-bit numbers• Outputs

– Results of comparison• GT, EQ, LT

Page 23: ENGR 212 / CSCI 310 4 March, 2002 - UNC Abrock/classes/Spring2002/311/lectures/Lect20.pdf · ENGR 212 / CSCI 310 4 March, 2002 ... 5-to-32 decoder 14 ABEL / PAL Version of 74x138

23

45

ALU• Usual inputs

– Pairs of N-bit words– Control inputs

• Typical functions– Arithmetic ops

• Add, Subtract– Logical ops

• Bit-wise AND, OR, NOT, XOR

• Can be used in slices• 74181