3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

26
Based with permission on lectures by John Getty Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 1 Today 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays Flip Flops and Ripple Counters One Shots and Timers LED Displays, Decoders, and Drivers Homework XXXX Reading H&H sections on sequential logic and clocks. Lab If you have questions: Email or call me on my cell (up to 10pm)

Transcript of 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Page 1: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 1

Today3/8/11 Lecture 8Sequential Logic, Clocks, and Displays

• Flip Flops and Ripple Counters• One Shots and Timers• LED Displays, Decoders, and Drivers

Homework• XXXX

Reading• H&H sections on sequential logic and clocks.

Lab• If you have questions:

Email or call me on my cell (up to 10pm)

Page 2: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 2

Review of Logic Gates

1

23A

B Q Q A B 1

23A

B Q

21A Q Q A

Q A B

Schematic symbol

B QA

7400N

1

23 A B Q

Algebraic example

AND

OR

NOT

NAND

Page 3: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 3

Combinational versus SequentialCombinational logic:

Output state of the circuit is dependant only on the present input states.

Sequential Logic:

Output state depends on both the present input states and on previous history.

A Sequential Logic circuit has memory!

Page 4: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 4

RS Flip-FlopRS FF

The state only changes when one of the inputs (R or S, but not both) are briefly toggled low (FALSE).

This circuit cannot be analyzed combinatorially. The output is determined by considering these NAND functions temporally, that is, discussing the state of the outputs (Q1 and Q’1) after some event in terms of (Q0 and Q’0) before.

1 0'Q S Q 1 0'Q R Q and

1

23

4

56

S

R

Q

Q'

NANDs

1 0 0

1 0 0

1 1

' '

'

if S and R

then Q S Q Q

and Q R Q Q

Inputs Outputs

If Q’0 = NOT(Q0), then state is unchanged.

Page 5: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 5

Q is “reset” lowif R goes low

State Table for RS FF

Q Q’?

10

No Change

S0011

?10

R0101

State Table

1

23

4

56

S

R

Q

Q'

RS FF

Q11110

Q’10001

0001

R•Q1S0011

Q’00101

Toggle “Set” input (with R=1)

Q is “set” high if S goes low

R0011

Q00101

1110

0001

Q’1 S• Q’1 Q10001

Toggle “Reset” input (with S=1)

No change if both high

Set

Reset

No change if both high

Page 6: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 6

SlaveMaster

D-type RS FFs

D-type Master-Slave Clocked Flip-Flop

Operation: Q=D and Q’=not(D) when CLK goes high. No change when CLK is low or goes low, even if D changesNo change if D changes after CLK goes high

Data is clocked and locked when CLK transition from low to high (Details: http://www.piclist.com/images/www/hobby_elec/e_ckt10_6.htm)

1

23

4

56

9

108

12

1311

1

23

4

56

9

108

12

1311

21

43

Data

CLK

Q

Q'

Page 7: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 7

74LS74 Chip-Dual D-type flip-flop with Set and Reset

74LS74

Page 8: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 8

Flip – Flop Shift Register

“1011” is clocked in one bit at a

time

Page 9: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 9

Clocked Flip-Flop: Divide by 2

Timing DiagramAmbiguous Start

f

f/2

Toggle-Connected Flip-Flop

Page 10: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 10

Ripple CounterDivided by 2n

f

f/2

f/4

f/8

f/16

Divided by 2Clock plus n flip-flops

D12 Q1 5

Q’1 6

PR’14CP1

3

CLR’11

7474

D212 Q2 9

Q’28

PR’210CP2

11

CLR’213

7474

D12 Q1 5

Q’1 6

PR’14CP1

3

CLR’11

7474

D212 Q2 9

Q’2 8

PR’210

CP211

CLR’213

7474Clock

1kHz

CLK CLK/16=

62.5 Hz

Vcc

For 7474, pin 7=GND

pin 14 = Vcc

CLK2 CLK4 CLK8 CLK16

CLKCLK2CLK4CKL8CLK16

Page 11: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 11

Ripple Down Counter

Q0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0

Q1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0

Q2 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0

Q3 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0

Hex 0 F E D C B A 9 8 7 6 5 4 3 2 1 0

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

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

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

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

CLKCLK2CLK4CKL8CLK16

Page 12: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 12

Ripple Up Counter

Q0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Q0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

Q2 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

Q3 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

Hex F 0 1 2 3 4 5 6 7 8 9 A B C D E F

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

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

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

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

CLKCLK2CLK4CKL8CLK16

Page 13: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 13

Astable MultivibratorThe astable multivibrator is an oscillator.

The period and duty cycle are properties of oscillator.

tp Period1 in Hertzp

ft

thigh tlow

p high lowt t t

Depending on whose definition you use

%Duty Cycle High 100

%Duty Cycle Low 100

high

p

low

p

tt

ORtt

Page 14: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 14

Timer Circuits - 555

Page 15: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 15

Timer Circuits - 555

23THRES CCV V

13TRIG CCV V

Functional Block

Diagram

Page 16: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 16

One Shot with a 555

tw = 1.1RAC (pulse width from the spec sheet)

“One shot” per trigger pulse

Page 17: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 17

Continuous Shots with a 555

Low Duty Cycle

out

<50%

Page 18: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 18

Setting Frequency of a 555 clock

Note: Max RA+2RB is 20M

Page 19: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 19

50% Duty Cycle Clock with 555

Page 20: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 20

Display Technologies-LEDLED - Light Emitting Diode

• Normally operates at ~10mA

• Drops ~1.7V

• Has typical Solid State Diode IV Characteristics

• Available in many different colors (Physics achievement!)

+5V

330ohm

Page 21: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 21

7-Segment LED Displaya

b

c

d

e

fg

dpMAN71A

Connected to +5V

330ohm

Page 22: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 22

LED Display Devices7-Segment

Display

MAN71A

Page 23: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 23

BCDBinary Coded Decimal maps a four bit binary code directly to decimal numbers.

A3 A2 A1 A0 Dec

0 0 0 0 00 0 0 1 10 0 1 0 20 0 1 1 30 1 0 0 40 1 0 1 50 1 1 0 60 1 1 1 71 0 0 0 81 0 0 1 91 0 1 0 Undef

1 1 1 1 Undef

Great for using binary to provide the human interface, but is really inefficient binary “packing” so is rarely used internally in circuits.

Chips are available that perform the conversion binary BCD binary.

Page 24: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 24

BCD Decoder-Driver

330ohm

+5V

An LED is on when

chip output goes low.

7-Segment LED Display

BCD Decoder-Driver

BCD Decoder-Driver

7-Segment LED Display

Page 25: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 25

Truth Table - BCD Decoder

Page 26: 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

Based with permission on lectures by John Getty

Phsx 262 Laboratory Electronics II Spring 11 Lecture 8 Page 26

Lab 7: Ripple Counter with Display

Clock4-bit

RippleCounter

Samplewith

Scope

BCDDecoder

Driver

7segmentDisplay

MMI

Q1

Q2

Q3

Q4

Q4 Q3 Q2 Q1

a-g

DACLab 8

A3 A2 A1 A0