lecture 10 synchronous counters - suranaree university of...

33
Lecture 10 Synchronous Counters Paramate Horkaew School of Computer Engineering, Institute of Engineering Suranaree University of Technology

Upload: others

Post on 13-Jul-2020

22 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Lecture 10 Synchronous Counters

Paramate Horkaew

School of Computer Engineering, Institute of EngineeringSuranaree University of Technology

Page 2: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Course Outline

• Introduction to Digital System• Truth Table and Boolean Algebra• Methods for Minimizing Boolean Expression• Programmable Circuits• Sequential Flip-Flops• Synchronous Counters• Synchronous Finite State Machine• A/D and D/A Conversion• Asynchronous Sequential Circuit Design• Practical Digital Designs (Part I Arithmetic Operations)• Practical Digital Designs (Part II Microprocessor)• Practical Digital Designs (Part III Data Communication)

Page 3: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Previous Lectures• Digital Feedback

– Meta-states and Oscillations– Electronic SPDT (Single-Pole Double-Throw) Switch Debouncer

• Flip!

• Set-Reset (S-R) Latches– Designing S-R Latches using NOR and NAND gates

– N-Latch Extension

• Clocked S-R Latches– Transient Glitches and Level-Sensitive Clock

• Data (D) Latches• Master-Slave (M-S) Flip-Flops

– Edge-Triggered Clock (Edge Sensitive Clock)

• Toggle (T) Flip-Flops• J-K Flip-Flops

• Data (D) Flip-Flops• Clock Timing and Stability Analysis

Page 4: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Set-Reset (S-R) Latch

การออกแบบวงจร S-R Latches ดวย gate พื้นฐานเริ่มจากการสรางตารางคาความจริงของ output โดยแบงแยกระหวางคาปจจุบัน QN กับคาถัดไป QN+1

• เมื่อ S-R = (0, 0) คา Q จะไมเปลี่ยน นั่นคือ QN = QN+1

• เมื่อ S-R = (0, 1) หรือ (1, 0) คา QN+1 จะเทากับ R และ S ตามลําดับ

• เมื่อ S-R = (1, 1) คา QN = INV (QN+1)

ซึ่งสามารถนําไปเขียน K-Map ไดดังนี้

Page 5: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Level-Sensitive Clockสําหรับวงจร S-R Latch เพิ่มขา CONTROL เพื่อรอให input S-R เปลี่ยนไปตามเงื่อนไขพรอมกอน ในที่นี้เราจะเรียกขา CONTROL วาสัญญาณนาฬิกา (CLOCK)

ก า ร ใ ช CLCK มีป ร ะ โ ยชน ใ น ก า ร แ ก ไ ข Transient Glitch และ เขาจั ง ห ว ะ สัญญาณ input

ขา CLK จะผานให ผลลัพธของ A AND INV (A) ออกไปปรากฏที่ขา S ไดเมื่ อผ านพนช วงที่เปน glitch ไปแลว

Page 6: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Data (D) Latchเราอาจปรับปรุง วงจร SR-Latch แบบมีสัญญาณนาฬิกา โดย เพิ่ม Literal สองตัวซึ่งเปน Inverse ของกันและกัน

• สังเกตวา input ลักษณะนี้ โดยปรกติจะทําใหเกิด Transient Glitch แตถา CLK เปน HI หลังจาก ผานชวง delay ที่ INV (D) มาแลวจะไมเกิด glitch ที่ขา Q

• เมื่อสัญญาณ CLK เปน LO S-R จะมีคาเปน (0, 0) นั่นคือ Flip-Flop จะคงคาเดิม ของ D ไว (Hold) หรือ อีกนัยหนึ่งคือประพฤติตัวเปน Memory นั่นเอง

Page 7: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Master-Slave (M-S) Flip-FlopD Latch สองตัวที่มาตออนุกรมกัน (ดังรูป) โดยมี INV (CLK) คั่นกลาง จะเรียกวาวงจา Master-Slave (M-S) Flip-Flop

Output ของ Latch ซายมือ (Master) จะ “สั่ง” Input ของ Latch ทางขวามือ (Slave) สังเกตการตอ CLK ลักษณะนี้ใชสัญลักษณ สามเหลี่ยม ที่ขาสัญญาณ

Page 8: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

M-S S-R Flip Flopถายอนไปพิจารณา negative edge trigged D FF ดังรูปดานซาย พบวา มีเพียง input เดียว (ซึ่งไดจากการตอ complement ภายใน ของ S-R Latch)

ดังนั้น D FF จะไมมีการจําขอมูลระหวางสถานะ

ในขณะที่ S-R FF สาม า รถ จํ า ข อ มู ล ของสถานะ กอนหนาได เมื่อ S-R = (0, 0) ระหวางที่ CLK เปน HI (วงจรภายใน)

Edge trigged MS FF

Page 9: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Toggle (T) Flip-Flopการออกแบบให input ของ M-S FF ปรากฏแตสถานะ ที่เปน complement กัน (01 หรือ 10) สามารถทําได โดยตอ X และ INV (X) ที่ input

หรืออีกวิธี ที่ใหผลเหมือนกันคือ ตอ Q และ INV (Q) ไปเขาที่ขา R และ S ตามลําดับ (ดังรูป) เรียกวงจร ที่ไดวา T-Flip Flop

T-FF 1 ตัวสามารถนํามาสรางเปน counter ขนาด 2 บิตไดดังแผนผังดานลาง

หมายเหตุ T FF ตางจากวงจร Oscillator แบบ feedback แบบพื้นฐาน ตรงที่ สถานะจะเปลี่ยนเฉพาะตรงขอบขาลงของ CLK

Page 10: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

J-K Flip Flopปญหาที่สําคัญของ S-R Flip Flop คือ สถานะที่ S-R เปน 1 พรอมกัน (1, 1) เราสามารถ หลีกเลี่ยงขอจํากัด นี้ได โดยสราง J-K Flip Flop ดังรูป

ที่ขอบขาลงของ CLK

J-K = (1, 0) คา Q = 1J-K = (0, 1) คา Q = 0J-K = (0, 0) คา Q คงเดิมJ-K = (1, 1) คา Q toggle

• D output Q จํา input D ได แตไมขึ้นกับ input กอนหนา

• S-R จํา input และ สถานะกอนหนาได แตมีเงื่อนไข (S, R) ไมเทากับ (1, 1)

• J-K เหมือน S-R แตที่ (1, 1) output จะสลับกัน เหมือน T FF

Page 11: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Lecture Outlines• Sequential Circuits

• States and Clock– State versus Output

– Clock and Its Maximum Frequency

• Steps in Analyzing a Synchronous Counter

• Design of Synchronous Counters– Assigning FF O/P to States

– Designing Procedures

• Positionally Coded Counters

• Conclusions

Page 12: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Synchronous Countersวงจรนับเขาจังหวะ (Synchronous Counter) ประกอบขึ้นดวยองคประกอบแนวคิดพื้นฐานดังตอไปนี้

Sequencerคือ วงจร หรือ ระบบ ซึ่งปรับเปลี่ยนตัวเอง ไปตาม อนุกรมจํากัด (finite series) ของสถานะตางๆ โดยที่การเปลี่ยนสถานะนั้นสามารถกําหนด ได 2 วิธี

• กําหนดดวย สัญญาณนาฬิกาหลัก (Master Clock)วงจรลักษณะนี้เรียกวา Synchronous Sequencer

• กําหนดดวย ตัวกระตุนภายนอกใดๆ (External Stimuli)วงจรลักษณะนี้เรียกวา Asynchronous Sequencer

Hardware ของ Sequencer ประกอบดวยสวนสําคัญ ไดแก 1) หนวยความจํา สถานะ และ 2) วงจร Combinational Logic

Page 13: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Counters and AutomatonsFinite State Machineคือ วงจร sequencer ที่ประกอบดวยสัญญาณ input หลายชนิด ซึ่งทําหนาที่ในการ กําหนด และ ปรับเปลี่ยน สถานะของวงจร ณ เวลาใดๆ

Counters and Automatonsสําหรับในบทนี้เราจะพิจารณาวงจร sequencer ชนิดที่มีสัญญาณ input เพียงตัวเดียว ซึ่งเรียกวา Counters หรือ Automatons

Statesณ เวลาใดๆ สถานะของวงจร นิยามดวย output ของ FF ทุกตัว ดังนั้น ในการออกแบบวงจรประเภท sequencer เราจึงตองกําหนด สถานะที่ตองการในอนุกรม แตละสถานะดวย เลขฐานสอง (Binary States)

โดยอาศัยตาราง PS-NS (Present-State-Next-State Table) เราสามารถออกแบบวงจร Combinational Logic เพื่อนําไปขับ FF ใหสราง สถานะตามที่กําหนด

Page 14: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

States and Clockจากบทที่ผานมา เราทราบวา วงจรที่มีความจํา สามารถสรางไดจาก การปอนกลับ ทางดิจิตอล โดยอาศัยวงจร gate พื้นฐานเราสามารถสรางวงจรปอนกลับ ซึ่งเรียกวา Latch และ Flip-Flop ที่มีคุณสมบัติ ตอบสนองสัญญาณนาฬิกา และ input ที่แตกตางกัน

หลักการสําคัญของวงจร sequential ในที่นี้ไดแกการออกแบบวงจรที่มีองคประกอบ ของ หนวยความจําสรางจาก Flip-Flop โดยที่ Flip-Flop แตละตัวเชื่อมตออยูกับสัญญาณนาฬิกา รวมกันเพียงสัญญาณเดียว

ตัวอยาง

ว ง จ ร sequential ที่สรางขึ้นมาจาก D Flip-Flop 3 ตัว ตออนุกรมกัน

Page 15: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Timing Diagramจากวงจร (Cyclic Shift Register) สมมติใหที่สถานะเริ่มตน Q ทุกตัวมีคาเปน 0 หลังจากนั้นสถานะของ Q แตละตัวจะเปลี่ยน ก็ตอเมื่อ สัญญาณ CLK เปลี่ยนจาก 0 เปน 1

ที่ขอบขาขึ้นของสัญญาณนาฬิกา Q จะเปลี่ยนดังรูป

QC, QB, QA

0 0 00 1 11 1 0

Sequence

Page 16: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Transition Equationsจากการวิเคราะห Timing Diagram พบวา สถานะ ของวงจร เปลี่ยนไป 3 รูปแบบ แลวกลับมาซ้ํา รูปแบบเดิม (Cycle) ซึ่งคลายกับ วงจรที่ทําหนาที่ นับจํานวนลูกคลื่น ของสัญญาณนาฬิกา

ถาหากเราทราบสถานะปจจุบัน เราสามารถทํานายสถานะถัดไป (หลังขอบขาขึ้นของสัญญาณนาฬิกา) ได โดยใช Transition Equations

สําหรับวงจรที่กําเนิด Timing Diagram ดังรูป สามารถเขียนสมการไดดังนี้

BA

CB

AC

QDQDQD

=

=

=

Page 17: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Typical Sequencerเพื่อความสะดวกในการออกแบบ และ วิเคราะหวงจร sequencer เรามักจะจัดเรียง อุปกรณ ในวงจรใหม โดย

• รวม D-FF ไว ดวยกัน• รวมวงจร combinational logic ที่ปอน output (Q) กลับมายัง input (D) อีก 1 กลุม (กลองเสนประ)

• แยกสัญญาณ นาฬิการ วม (CLK) ออกมาตางหาก ดังรูป

ดวยการจัดเรียงวงจรในลักษณะนี้ เราสามารถพิจารณา sequencer ดวย register ขนาน ซึ่งมี output ปอนกลับมายัง input ผานวงจร combinational logic

ปอนกลับ

ความจํา

Output

CLOCK

Page 18: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

General Form of Moore Circuitsในการวิเคราะห sequencer เราตองทราบ 1) input ปจจุบัน 2) input ณ สถานะถัดไป และ 3) แผนผังวงจร ทั้งนี้ วงจรที่ประกอบดวย FF จํานวน N ตัวสามารถนํามาสราง sequencer ที่มีสถานะได ไมเกิน 2N สถานะ

วงจร Moore คือวงจรที่ output เปลี่ยนตามสัญญาณนาฬิกา

สังเกต ความแตกตางระหวาง State และ System Output

Page 19: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

An Example of Moore Circuitวงจรดังรูปดานลาง เปนตัวอยางหนึ่งของวงจร Moore ซึ่งประกอบดวย FF 3 ตัว แตมีเพียง 1 output เราสามารถหาจํานวนสถานะได โดยกําหนดสถานะเริ่มตน Q = 0

แบบฝกหัด จากวงจร และสมการ Transition จงวิ เคราะหหาว า วงจรนี้ ใหกําเนิดอนุกรม กี่สถานะ

CA

AB

BACC

QDQD

QQQD

=

=⋅⋅=

Page 20: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Synchronous CountersSynchronous Counter เปนกรณีเฉพาะของวงจร Moore โดยที่ output ของกลุม FF ตอผาน วงจร Combinational Logic ปอนกลับมายัง input (D, J, K, S, R)

สําหรับ Synchronous Counter

สถานะปจจุบันของวงจร แ ส ด ง ด ว ย Outputs ของ FF

สถาน ะของ ว ง จ ร จ ะเ ป ลี่ ย น ที่ ข อ บ ข อ งสัญญาณ CLKInner loop

Outer loop

ขอควรระวังสัญญาณ CLK ควรใชขอบเดียวกันทั้งวงจร (ขึ้นหรือลงเพียงอยางเดียวเทานั้น)

Page 21: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Maximum Clock Rateเมื่อพิจารณาวงจร Moore พบวา วงจร Sequential จะมีการหนวงเวลา 4 ลําดับ กลาวคือ ∆C และ ∆F คือเวลาที่สัญญาณใชในการผานวงจร Combinational Logic และ Flip Flops ตามลําดับ และเวลา tsetup และ thold ที่วงจร FF ตองการสําหรับการตอบสนองตอ input

( )setupFC tF

+∆+∆=

1

ถาสมมติให thold = 0 เราจะไดวาความถี่สูงสุด ของ CLK หาไดจา

Page 22: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

FF State Changes SummaryFF พื้นฐานที่เราจะนํามาใชในการออกแบบวงจร Sequential ไดแก D-FF, T-FF และ J-K FF ซึ่งแตละชนิด มีคุณสมบัติการเปลี่ยนสถานะ ขึ้นอยูกับ I/P ดังตาราง

วิเคราะหสังเคราะห

Page 23: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Analyzing Synchronous Counter

• แยกวงจร FF และวงจร excitation (วงจรปอน input กลับ) ออกจากกัน

• ศึกษาวงจร excitation และ เขียนสมการ Boolean สําหรับ input ของ FF

• สมมติใหวงจรมีสถานะเริ่มตน Q = 0• หา logic ที่ input FF จาก excitation

equation เพื่อหาสถานะถัดไป• ทําซ้ําขั้นตอนที่ 4

ในการวิเคราะหวงจรนับแบบเขาจังหวะ เราจะดําเนินการตามขั้นตอนตอไปนี้

Reset = 0 ที่ t = 0

Page 24: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

An Example (I)

Step 2 เขียนสมการ Excitations

Reset = 0 ที่ t = 0

Step 1 แยกวงจร FF กับ ปอนกลับ input ออกจากกัน สังเกตเสนสีฟาเปนการปอนกลับ DA = INV (QA)

( )

( )ABCABC

ACBC

ABBCACAC

ABBCACB

AA

QQQQQQQQQD

QQQQQQQQQQQQQQD

QD

⋅⋅+⋅⋅=

⊕⋅=⋅+⋅+⋅+⋅=

⋅+⋅+⊕=

=

Page 25: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

An Example (II)Step 3-4 สมมติให Q = 0 ณ เวลาเริ่มตน แลวหาสถานะตอเนื่องจากสมการ Excitations

( )

( )ABCABC

ACBC

ABBCACAC

ABBCACB

AA

QQQQQQQQQD

QQQQQQQQQQQQQQD

QD

⋅⋅+⋅⋅=

⊕⋅=⋅+⋅+⋅+⋅=

⋅+⋅+⊕=

=

QC QB QA State

0 0 0 0

0 0 1 1

0 1 0 2

0 1 1 3

1 1 0 6

1 1 1 7

นํามาเขียนตารางสถานะไดดังนี้

สถานะที่ 1 = 0 0 1

( )( ) 0000

0000000

10

1

1

1

=⊕⋅=

=⋅+⋅+⊕=

==

C

B

A

D

D

D

Page 26: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

An Example (III)Step 3-4 สถานะตอเนื่องจากสมการ Excitations ในลําดับตอไป จนกวาสถานะกลับซ้ํา

สถานะที่ 2 = 0 1 0 นํามาเขียนตารางสถานะไดดังนี้

( )( ) 0100

1100010

01

2

2

2

=⊕⋅=

=⋅+⋅+⊕=

==

C

B

A

D

D

DQC QB QA Value

0 0 0 0

0 0 1 1

0 1 0 2

0 1 1 3

1 1 0 6

1 1 1 7

สถานะที่ 3 = 0 1 1

( )( ) 0001

1011000

10

3

3

3

=⊕⋅=

=⋅+⋅+⊕=

==

C

B

A

D

D

D

Page 27: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

An Example (IV)Step 5 จากสมการ Excitation นําไปเขียนเปน K-Map ของ Q (A ถึง C) ตารางสุดทายแสดง ลําดับการเปลี่ยนสถานะ ใน K-Map

Page 28: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Another Exampleวิเคราะหวงจรตอไปนี้ สังเกตวาวงจร มีสถานะกําหนดโดย QA, QB, QC และ QD แต output ของวงจรมีเพียง QD เทานั้น

A Multiple-States-Single-OutputCircuit

สังเกต INV (S) = 1 และ INV (R) เปน input

Page 29: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Step 1) Study the Circuitจากการวิเคราะห FF พบวา FF สามตัวทางดานขวามือ (QB, QC และ QD) มี input J-K ตออยูกับ output Q/INV (Q) ของตัวกอนหนา ซึ่งทําหนาที่เสมือนเปน D FF ??

CBADCB

CBADCB

QK

QJ

,,,,

,,,,

=

=

( )CBA

AA

QQQ

KJ

+⊕=

=

เพราะวา JA=KA ดังนั้น FF ตัวแรก (QA) จะทําหนาที่ เปน Toggle FF หรือ คงคาสถานะปจจุบันไว (Hold) ขึ้นอยูกับ output ของวงจร combination ที่ JA, KA

Page 30: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Step 2) Excitation Equations

( )CBA

AA

QQQ

KJ

+⊕=

=จําแนกสมการ Excitation (สมการปอนกลับของ output ของแตละ FF กลับมายัง input แตละตัว)

AB

AB

QKQJ

=

=

BC

BC

QKQJ

=

=

CD

CD

QKQJ

=

=

Page 31: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Step 3-4) Excite the Logics

( )CBA

AA

QQQ

KJ

+⊕=

=กําหนดใหสถานะเริ่มตนเปน QA = QB = QC= QD = 0 แลวหาสถานะถัดไปของวงจรจาก สมการ

QD QC QB QA Value

0 0 0 0 0

0 0 0 1 1

0 0 1 1 3

0 1 1 0 6

1 1 0 0 12

1 0 0 0 8

0 0 0 1 1

0 0 1 1 3

( ) ( ) 1000, =+⊕=AKJ

( ) ( ) 0001, =+⊕=AKJ( ) ( ) 1011, =+⊕=AKJ

JA=KA=1

JA=KA=0

JA=KA=1

( ) ( ) 0110, =+⊕=AKJJA=KA=0

( ) ( ) 0010, =+⊕=AKJJA=KA=0

( ) ( ) 1000, =+⊕=AKJJA=KA=1

( ) ( ) 0001, =+⊕=AKJJA=KA=0

Page 32: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Step 5) Output Analysisจากตารางจะเห็นวา หมายเลขของสถานะ เลื่อนไปตามลําดับดังนี้

QD QC QB QA Value

0 0 0 0 0

0 0 0 1 1

0 0 1 1 3

0 1 1 0 6

1 1 0 0 12

1 0 0 0 8

0 0 0 1 1

0 0 1 1 3

0 1 3 6

128RESET

และทุกขอบขาขึ้นของสัญญาณ CLK คา output (QD) จะเปลี่ยนไปตามลําดับดังนี้

QD = 0 00011 00011 00011 …

แบบฝกหัด เขียน K-Map แสดงการเปลี่ยนสถานะ เหมือนตัวอยางที่แลว

Page 33: Lecture 10 Synchronous Counters - Suranaree University of ...personal.sut.ac.th/paramate/files/digital/lecture10.pdf · Lecture 10 Synchronous Counters Paramate Horkaew School of

Conclusions• Sequential Circuits

• States and Clock– State versus Output

– Clock and Its Maximum Frequency

• Steps in Analyzing a Synchronous Counter

• Design of Synchronous Counters– Assigning FF O/P to States

– Designing Procedures

• Positionally Coded Counters– To be Continued in Next Lecture