chapter 8 synchronous sequential circuits 同步时序电路 1.use flip-flops to represent the...

33
Chapter 8 Synchronous Sequential Circuits 同同同同同同 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the states. 3.realized using combinational logic and one or more flip-flops.

Post on 21-Dec-2015

227 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

Chapter 8

Synchronous Sequential Circuits

同步时序电路1.use flip-flops to represent the states of the circuit ;

2.use clock pulses to trigger changes in the states.

3.realized using combinational logic and one or more flip-flops.

Page 2: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

state

• The value of the outputs of the flip-flops are referred to the state.

• Active clock edge

• Outputs=Function(present state, present inputs)

Page 3: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

Moore & Mealy

• Moore type:circuits whose outputs depend only on the state of the circuits.

• ______Edward Moore

• Mealy type: circuits whose outputs depend both the state and the present inputs of the circuits.

• ______George Mealy

Page 4: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

FSM

• Finite State Machines (FSMs)

• 有限状态机 • ASM

• Algorithmic State Machine

• 算术状态机(流程图)• 状态、判决、条件

Page 5: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

Specification

• 技术规格• 1.The circuit has one input,w,and one output,z;

• 2.All changes in the circuit occur on the positive edge of a clock signal;

• 3.The output z is equal to 1 if during two immediately preceding clock cycles the input w was equal to 1.Otherwise, the value of z is equal to 0.

Page 6: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

State Diagram

• 状态图• State number

• Starting state

• Pictorial representation

Page 7: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

State Table

• 状态表• Tabular form:

• Present state

• Next state

• Output

Page 8: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

State Assignment

状态赋值State variables___flip-flop

n state, n-1 state variables;

Next state variables: Y1,Y2 (大写) ;

Present state variables: y1,y2 ( 小写) ;

State-assigned table 状态赋值表

Page 9: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

One-hot Encoding

• “ 独热”编码• Only one state variable is equal to 1__one

hot,

• others are equal to 0

Page 10: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

VHDL Code for FSMs

• Moore state

• Mealy state

Page 11: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

ARCHITECTURE (Moore)• TYPE State_type IS(A,B,C);• SIGNAL y: State_type;• CASE y IS• WHEN A=>• IF w=‘0’ THEN• y<=A;• ELSE• y<=B;• END IF;

Page 12: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

• WHEN B=>

• IF w=‘0’ THEN

• y<=A;

• ELSE

• y<=C;

• END IF;

Page 13: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

• WHEN C=>

• IF w=‘0’ THEN

• y<=A;

• ELSE

• y<=C;

• END IF;

Page 14: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

• END CASE;

• END IF;

• END PROCESS;

• z<=‘1’ WHEN y=C ELSE ‘0’;

• END Behavior;

Page 15: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

• SIGNAL y_present,y_next: State_type;

• CASE y_present IS

• y_next<=A;

• PROCESS(Clock,Resentn)

• y_present<=y_next;

Page 16: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

ARCHITECTURE (Mealy)• TYPE State_type IS(A,B);

• PROCESS(y,w)

• CASE y IS

• WHEN A =>

• z<=‘0’;

• WHEN B=>

• z<=‘w’;

• END CASE;

• END PROCESS;

Page 17: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the

Serial Adder Example

• Shift register

• FSM serial (full_adder)

Page 18: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 19: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 20: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 21: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 22: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 23: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 24: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 25: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 26: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 27: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 28: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 29: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 30: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 31: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 32: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the
Page 33: Chapter 8 Synchronous Sequential Circuits 同步时序电路 1.use flip-flops to represent the states of the circuit ; 2.use clock pulses to trigger changes in the