State machine design for EDA review

Advantages of state machine: efficient implementation of sequential control model system performance is stable and high reliability

The important parameter now_state is written into the case () brackets to determine what should be executed now and next_state is used to enter the next state and assign a value after the judgment. parameter s0 s1 s2 s3 are used to enter the parameters selected in the case, it is fine if they are different. In addition to writing the case statement, there is also an always clock statement to enter and change the now_state to next_state every time the clock comes.

Mealy state: the output is not only related to the current state but also to the input

Moore state machine: the output is only related to the current state

VHDL is more rigorous, more rigorous, and more cumbersome than Verilog, while Verilog is relatively concise.

The ADC0809 chip is a multi-state structure state machine

When realizing the same function, the Moore type state machine needs one more state than the Mealy type state machine, and the output of the Moore type state machine is delayed by one clock cycle than the Mealy type.

The final output is related to the input, and mealy doesn’t care about it halfway.

The role of the sequence detector: it is used to detect synchronous identification marks in various fields such as data communication, radar and telemetry, and can be used for rapid identification, etc.

Mooregs state machine synchronous output, Mealy state machine asynchronous output

State machine coding method:

1. Sequential binary encoding

2. Gray code and one-hot code

3. Johnson coding

4. Custom coding.

define: It is a macro-defined module, which can be valid throughout the compilation process until it encounters an undef launch point

Role: often used to define constants, which can cross modules and files

Scope: available throughout the project

parameter: Act on the declared file, which can be redefined by # (parameter)

Function: Commonly used for parameter passing between modules

Scope: Definitions valid within this module.

localparam is a local parameter, which cannot be redefined, and cannot be used for parameter passing, that is, it cannot be redefined through hierarchical references during instantiation, and can only be changed through source code.

The parameter acts on the declared file, which can be redefined by

1. State guidance method

2. State coding detection method

3. EDA tool generates state machine

Used to implement a safe state machine

Guess you like

Origin blog.csdn.net/weixin_63163242/article/details/128881619