Finite state machine with data path:
FSMD has two parts, FSM and Datapath. It's a more flexible mechanism to control data in different stage than FSM. In a standard FSMA, FSM is used to change the state, tell the datapath when and how to do different calculations, and datapath is used to do different calculations.
Use FSMD to implement the function of c++ code which calculates the square root of a number(计算平方根):
while(sqaure<=data){ // control
square=sqaure+delta; //calculate
delta=delta+2;
}
return delta/2 - 1
Input of FSM: (square<=data), rst, clk
Output of FSM: calculate, clean, returnnum(control signals)
Input o