You are on page 1of 59

Digital Circuit and Logic

Design

Chapter 8
Counters
2-bit asynchronous binary counter

*เป็ นวงจร Asynchronous เนื่องจาก FF1 ไม่ถก


ู กระตุ้นด้ วยสัญญาณ CLK

0 1 0 1 0

0 0 1 1 0
2
3-bit asynchronous binary counter

3
4-bit asynchronous binary counter

Note: FF ทํางานที่ขอบขาลง ดังนันต้


้ องต่อ Q ไปยัง FF ตัวถัดไป โดยจะทํางานเมื่อ Q 1->0

4
Decoding of state 6 (110)2

5
Decade counter with asynchronous recycling

ทําการนับ pulse จนครบ 10 ( = 10102 ) แล้ ววนกลับไปเริ่ มใหม่ (0000)


โดยสร้ างสัญญาณ CLR = 0 โดยสัญญาณจะปรากฎเพียงเวลาสัน้ ๆ (Glitch)

6
Example

ทําการนับ pulse จนครบ 50


(110010)2 แล้ วสร้ าง
สัญญาณ 1 พลัส

7
Propagation delays in a 3-bit ripple counter

0 1 0 1 1

0 0 1 1 0

0 0 0 0 1

8
74LS93A 4-bit asynchronous binary counter
11.00฿

9
R0 : return to zero
Configurations of the 74LS93A counter

10 = 10102 12 = 11002

Q3 และ Q1 = 1 Q3 และ Q2 = 1

10
Two cascaded counters
Cascaded Counters

11
Mod-100 counter using 2 cascaded counters

100KHz

12
3 cascaded decade counters

13
2-bit synchronous binary counter

เป็ นวงจร Synchronous เนื่องจาก FF ทุกตัวถูกกระตุ้นให้ ทาํ งานพร้ อมกันด้ วยสัญญาณ CLK

(J,K) = (0,0)
No-change 14
(J,K) = (0,0) (J,K) = (1,1) (J,K) = (1,1)
No-change Toggle Toggle
2-bit synchronous counter operation

Propagation delay จะไม่ถก


ู ส่งต่อเหมือนวงจร Asynchronous เนื่องจาก FF ทุกตัว
ทํางานพร้ อมกันตามสัญญาณ CLK
15
3-bit synchronous binary counter

(J,K) = (1,1)
Toggle

(J,K) = (0,0)
No-change
16
4-bit synchronous binary counter

17
Synchronous BCD decade counter
Q3,Q0 = (1,1) => J3, K3 = (1,1)
(Toggle)

FF1 จะทํางานเฉพาะ
Q3 = 0

18
3-bit up/down synchronous counter

-การทํางานในโหมดนับขึ ้นและลง เป็ น


การเปลีย่ นการทํางานของ JK FF

นับขึน้ นับลง
Q0 JK-FF Q1 Q0 JK-FF Q1
0 no change 0 1 toggle 0
1 toggle 0 0 no change 0
0 no change 1 1 toggle 1
1 toggle 1 0 no change 1
0 no change 0 1 toggle 0
1 toggle 0 0 no change 0
0 no change 1 1 toggle 1
1 toggle 1 0 no change 1
19
Timing Diagram

20
Design of Synchronous Counters

21
State diagram for a 3-bit Gray code counter
ตัวอย่าง1 จงออกแบบวงจรนับ synchronous แบบ 3-bit Gray code ตาม state
diagram ดังรูป โดยใช้ J-K FF

Gray code ่ กจัดเรียงลําดับให ้รหัสข ้างเคียงมีบต


เป็ นรหัสเลขฐานสองซึงถู ิ

เปลียนแปลงได ้เพียง 1 บิต

22
Step 2: Next-Sate Table
่ าหนด
เขียน State table จาก State diagram ทีกํ

23
Step 3: J-K Flip-Flop Transition Table
จาก Transition table (State table) ของ J-K FF

24
Step 4: Karnaugh Maps
ทําการหา Excite table จาก state table ของวงจรและ J-K FF

25
Karnaugh maps for present-state J and K inputs
ทําการลดรูปโดย KM และเขียน logic function ของอินพุต JK-FF

26
Step 5: 3-bit Gray code counter
ทําการสังเคราะห ์วงจรจาก logic function ของอินพุต JK-FF

27
State Diagram for a 1-2-5-7 Counter
ตวั อย่าง2 จงออกแบบวงจรนับ synchronous แบบ 3-bit ตาม state
diagram ดังรูป โดยใช้ J-K FF

28
Step 2: Next-Sate Table
่ าหนด
เขียน State table จาก State diagram ทีกํ

29
Step 3: J-K Flip-Flop Transition Table
จาก Transition table (State table) ของ J-K FF

30
Step 4: Karnaugh Maps
ทําการหา Excite table จาก state table ของวงจรและ J-K FF
ทําการลดรูปโดย KM และเขียน logic function ของอินพุต JK-FF

31
Step 5: Implementation of 1-2-5-7 Counter
ทําการสังเคราะห ์วงจรจาก logic function ของอินพุต JK-FF

32
State diagram for a 3-bit up/down Gray code
counter
ตวั อย่าง3 จงออกแบบวงจรนับ synchronous แบบ 3-bit ตาม state
diagram ดังรูป โดยใช้ J-K FF

33
Step 2: Next-Sate Table

34
Step 3: Flip-Flop Transition Table
จาก Transition table (State table) ของ J-K FF

35
J and K maps. Y is UP/DOWN control input
ทําการหา Excite table จาก state table ของวงจรและ J-K FF
ทําการลดรูปโดย KM และเขียน logic function ของอินพุต JK-FF

36
3-bit up/down Gray code counter
ทําการสังเคราะห ์วงจรจาก logic function ของอินพุต JK-FF

37
State transition diagram for the
synchronous counter design example
การบ้าน 1 จงออกแบบวงจรนับ synchronous แบบ 3-bit ตาม state
diagram ดังรูป โดยใช้ J-K FF

38
K map used to obtain the simplified expression for J A
(hint: การบ ้าน 1)

39
K-maps for the J B, K B, J C and K C logic circuits
(hint: การบ ้าน 1)

40
Implementation of the synchronous counter
คําตอบ การบ ้าน1

41
(a) synchronous supplies the sequential outputs to drive a stepper motor
(b) state transition diagrams for both states of Direction input, D

การบ้าน 2 จงออกแบบวงจรนับแบบ synchronous ของรหัส Gray แบบ 2-bits โดย


ใช้ JK-FF สําหร ับใช ้ขับ stepping motor ตาม state diagram ด ้านล่าง กําหนด ให ้

D เป็ นสัญญาณควบคุมการนับเพิม/ลด (ควบคุมทิศทางการหมุนของมอเตอร ์)

42
Karnaugh maps for A and B FF
(hint: การบ ้าน 2)

43
Synchronous counter implementation
คําตอบ การบ ้าน2

44
Synchronous counter implementation
คําตอบ การบ ้าน2 3. Check expression
and build excite-circuit

1.Assign input and output pin 2. Create Excite-table

4. Edit excite-circuit appearance


5. Complete whole circuit with excite-circuit,
FF and clk.

45
A 3-bit counter with decoding of count 2 and 7

46
Basic decade (BCD) counter and decoder

Propagation delay ของ Counter (CTR


DIV10) จะทําให้ เกิด glitch ขึ ้นที่ BCD Decoder

47
Strobing to eliminate glitches

ใช้ สญ
ั ญาณ Strobe เพื่อกําจัดปั ญหา Glitch อัน
เนื่องมาจาก delay ภายในวงจรนับ

48
Applications : 12-hour digital clock

49
Applications : Automobile Parking Control

50
Mod-100 up/down counter for automobile parking
control

51
Parallel-to-serial data conversion logic
Counter Applications : Parallel-to-Serial Data Conversion
(Multiplexing)

52
Example of parallel-to-serial conversion timing

53
Traffic light control system block diagram
การบ้าน 3 จงออกแบบวงจร synchronous ควบคุมสัญญาณไฟจราจร
สําหร ับเส ้นทางตรง (main road) และเส ้นทางตัด (side road) ตาม state
diagram ด ้านล่าง โดยใช้ JK-FF

54
Hint: การบ ้าน 3

Main Side
Present Next
State State R Y G R Y G
1st 00 01 0 0 1 1 0 0
2nd 01 11 0 1 0 1 0 0
3rd 11 10 1 0 0 0 0 1

4th 10 00 1 0 0 0 1 0
55
Block diagram for counters and state machines

56
Hint: การบ้าน 3 (ส่วน State transition)

Main Side
Present Next
State State R Y G R Y G
q0,q1 Q0,Q1
1st 00 01 0 0 1 1 0 0
2nd 01 11 0 1 0 1 0 0
4th 10 00 1 0 0 0 1 0
3rd 11 10 1 0 0 0 0 1 57
Hint: การบ้าน 3 (ส่วน Moore’s Output Circuit)

Main Side
Present Next
State State R Y G R Y G
q0,q1 Q0,Q1
1st 00 01 0 0 1 1 0 0
2nd 01 11 0 1 0 1 0 0
4th 10 00 1 0 0 0 1 0
3rd 11 10 1 0 0 0 0 1

58
Hint: การบ้าน 3

59

You might also like