Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

07.Sequential circuits

.pdf
Скачиваний:
27
Добавлен:
23.08.2013
Размер:
360.91 Кб
Скачать

Chapter 7 Sequential Circuits

Page 31 of 37

(e)). Finally, the complete modulo-6 up counter circuit is shown in Figure 24(e). Comparing this circuit with the circuit from Example 9.3 shown in

C= 0

Q2Q1Q0 = 000

C= 1

Q2Q1Q0 = 001

C= 0

 

Y = 0

 

Y = 0

 

C= 1

 

 

 

C= 1

Q2Q1Q0 = 101

C= 0

 

C= 0

Q2Q1Q0 = 010

Y = 1

 

 

 

Y = 0

C= 1

 

 

 

C= 1

C= 0

Q2Q1Q0 = 100

C= 1

Q2Q1Q0 = 011

C= 0

 

Y = 0

Y = 0

 

 

 

(a)

 

 

Current State

Next State

Q2next

Q1next Q0next

Q2Q1Q0

C = 0

 

C = 1

 

 

000

000

 

001

001

001

 

010

010

010

 

011

011

011

 

100

100

100

 

101

101

101

 

000

(b)

Current State

Implementation

D2

D1 D0

Q2Q1Q0

C = 0

 

C = 1

 

 

000

000

 

001

001

001

 

010

010

010

 

011

011

011

 

100

100

100

 

101

101

101

 

000

(c)

(f) where D flip-flops are used, it is obvious that using T flip-flops for this problem result in a much smaller circuit than using D flip-flops.

Microprocessor Design – Principles and Practices with VHDL

Last updated 7/18/2003 1:19 PM

Chapter 7 Sequential Circuits

Page 32 of 37

7.8Exercises

9.1 Design a modulo-4 Counter using T flip-flops

9.2. Design a FSM that counts the following decimal sequence

3, 7, 2, 6, 3, 7, 2, 6, …

The count is to be represented directly by the contents of the D flip-flops. The counting starts when the control input C is asserted and stops whenever C is de-asserted. Assume that the next-state from all unused states is the state for the first count in the sequence, i.e. the state for 3.

9.3 Design a counter that counts in the following sequence:

1, 4, 6, 7, 1, 4, 6, 7, ….

The count is to be represented directly by the contents of the flip-flops. Use a JK flip-flop, a D flip-flop and a SR flip-flop in this order starting from the most significant bit for the three flip-flops needed. The counter is enabled by the input C. The count stops when C = 0. The next-state from all unused states are undefined.

Microprocessor Design – Principles and Practices with VHDL

Last updated 7/18/2003 1:19 PM

Chapter 7 Sequential Circuits

Page 33 of 37

7.9Selected Answers

9.1 Next-state table:

Current State

Next State

 

Q1next Q0next

Q1 Q0

C = 0

C = 1

00

00

01

01

01

10

10

10

11

11

11

00

Implementation table:

Current State

Next State

 

T1 T0

Q1 Q0

C = 0

C = 1

00

00

01

01

00

11

10

00

01

11

00

11

Circuit:

 

Excitation equations:

C

 

T1 = CQ0

 

 

T0 = C

 

T1

Q1

 

Clk

 

 

 

Q'1

 

T0

Q0

Clk

Clk

 

 

 

Q'0

9.2Since we’re using the flip-flop content to represent the count and the largest number is 7, therefore, we need three (3) bits even though there are only four numbers in the sequence.

State diagram:

C = 0

 

 

C = 0

 

011

C = 1

111

 

 

 

 

 

C = 1

xxx

 

 

 

all unused

 

 

 

state

C = 1

 

 

 

110

 

010

 

 

 

C = 1

C = 0

 

 

C = 0

Microprocessor Design – Principles and Practices with VHDL

Last updated 7/18/2003 1:19 PM

Chapter 7 Sequential Circuits

Page 34 of 37

Next-state table and implementation table:

Current State

Next State / Implementation

Q2next Q1next Q0next / D2D1D0

Q2Q1Q0

C = 0

C = 1

 

000

011

011

001

011

011

010

010

110

011

011

111

100

011

011

101

011

011

110

110

011

111

111

010

Excitation equations:

D2 = Q2'Q1C + Q2Q1C'

 

 

D1 = 1

 

 

D0 = Q1' + Q2'Q0 + Q0C' + Q2Q0'C

 

 

Circuit:

 

 

C

 

 

 

D2

Q2

 

Clk

 

 

 

Q'2

'1'

D1

Q1

 

Clk

 

 

 

Q'1

 

D0

Q0

 

Clk

 

Clk

 

Q'0

 

 

Microprocessor Design – Principles and Practices with VHDL

Last updated 7/18/2003 1:19 PM

Chapter 7 Sequential Circuits

9.3 Next-state table:

Current State

Next State

Q2next

Q1next Q0next

Q2Q1Q0

C = 0

 

C = 1

 

 

001

001

 

100

100

100

 

110

110

110

 

111

111

111

 

001

Excitation tables for the three flip-flops:

 

Q

 

Qnext

 

J

 

K

 

 

D

 

S

R

 

0

 

0

0

 

×

 

0

 

0

×

 

0

 

1

1

 

×

 

1

 

1

0

 

1

 

0

×

 

1

 

0

 

0

1

 

1

 

1

×

 

0

 

1

 

×

0

Implementation table:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Current State

 

 

Implementation

 

 

 

 

J2 K2

D1 S0 R0

 

 

 

Q2Q1Q0

 

 

 

 

 

 

C = 0

 

 

C = 1

 

 

 

 

 

 

 

 

 

 

 

001

 

0× 0× 0

 

1× 001

 

 

 

100

 

×

000×

 

×

010×

 

 

 

110

 

×

010×

 

×

0110

 

 

 

111

 

×

01× 0

 

×

10× 0

 

K-maps and excitation equations:

J2

CQ2

 

 

 

 

 

 

 

 

 

Q1Q0

 

00

01

11

10

 

00

×

×

×

×

C

01

0

×

×

1

 

11

×

×

×

×

 

10

×

×

×

×

 

 

J2 = C

 

 

S0

CQ2

 

 

 

 

 

 

 

Q1Q0

 

00

01

11

10

 

00

×

0

0

×

CQ1

01

×

×

×

0

 

11

×

×

×

×

 

10

×

0

1

×

 

 

S0 = CQ1

 

 

K2

CQ2

 

 

 

 

 

 

 

Q1Q0

 

00

01

11

10

 

00

×

0

0

×

CQ0

01

×

×

×

×

 

11

×

0

1

×

 

10

×

0

0

×

 

 

K2 = CQ0

 

 

R0

CQ2

 

 

 

 

 

 

 

Q1Q0

 

00

01

11

10

 

00

×

×

×

×

CQ1' 01 0

×

×

1

 

11

×

0

0

×

 

10

×

×

0

×

 

 

R0 = CQ1'

 

 

Page 35 of 37

D1

CQ2

 

 

 

 

 

 

 

Q1Q0

 

00

01

11

10

CQ0' 00 ×

0

1

×

C'Q1

01

0

×

×

0

 

11

×

1

0

×

 

10

×

1

1

×

 

 

D1 = CQ0' + C'Q1

Circuit:

 

Microprocessor Design – Principles and Practices with VHDL

Last updated 7/18/2003 1:19 PM

Chapter 7 Sequential Circuits

Page 36 of 37

C

 

J 2

Q2

Clk

 

K2

Q'2

D1

Q1

Clk

 

 

Q'1

S0

Q0

Clk

 

R0

Q'0

Clk

 

Microprocessor Design – Principles and Practices with VHDL

Last updated 7/18/2003 1:19 PM

Chapter 7 Sequential Circuits

Index

A

Algorithmic state machine chart. See ASM chart Analysis of sequential circuit, 4

ASM chart, 18

C

Characteristic equation, 5

E

Excitation equation, 5

F

Finite-state machine, 2

FSM. See Finite-state machine.

M

Mealy FSM, 2

Microprocessor next-state logic, 2 state memory, 2

Page 37 of 37

Moore FSM, 2

N

Next-state equation, 5

Next-state logic, 2

Next-state table, 5

O

Output equation, 5

Output table, 6

S

Sequential circuit analysis, 4 synthesis, 10

State, 2

State action table, 18, 20 State diagram, 6

State memory, 2

Synthesis of sequential circuit, 10

Microprocessor Design – Principles and Practices with VHDL

Last updated 7/18/2003 1:19 PM

Соседние файлы в предмете Электротехника