Forum Discussion
Altera_Forum
Honored Contributor
11 years agosince i'm a beginner, i dont know the best way of using FP MF's. after calculation completed by MF, i need a ready signal to start the next MF calculation process. i want to know the most suitable method? is my code below suitable? and could you please warn me of what is wrong?
process (reset,clock,t) variable clk_u:integer:=0; variable clk_end:integer:=0; variable state,state_next:integer:=0; variable rdy:std_logic:='0'; begin if reset='1' then aclr<='1'; clk_en_mul<='0'; rdy:='0'; state:=0; else if rdy='0' and rising_edge(clock) then case state is when 0=> aclr<='0'; clk_en_mul<='0'; state_next:=1; clk_end:=2; when 1=> dataa_mul<=x"3A4DE32E"; datab_mul<=x"40000000"; state_next:=2; clk_end:=2; when 2=> clk_en_mul<='1'; state_next:=3; clk_end:=11; when 3=> clk_en_mul<='0'; state_next:=4; clk_end:=1; when 4=> clk_en_mul<='0'; result<=result_mul; rdy:='1'; state_next:=5; clk_end:=2; when others=> null; end case; clk_u:=clk_u+1; if clk_u>clk_end then state:=state_next; clk_u:=0; end if; end if; end if; ready<=rdy; end process; Regards Bedri