![]() |
|
|
|
#1 |
|
Hi,
When checking some condition which is responsible for jumping back to some known state within a state machine I have done the following : process(rst, clk) begin if rst='1' then ls_state <= s_ini; elsif rising_edge(clk) then case ls_state is ... when s_0 => ... if ls_condition='1' then ls_state <= s_known; end if; when s_1 => ... if ls_condition='1' then ls_state <= s_known; end if; when s_2 => ... if ls_condition='1' then ls_state <= s_known; end if; ... end case; end if; end process; Can the FSM be replaced with the following description ? process(rst, clk) begin if rst='1' then ls_state <= s_ini; elsif rising_edge(clk) then case ls_state is ... when s_0 => ... when s_1 => ... when s_2 => ... end case; if ls_condition='1' then ls_state <= s_known; end if; end if; end process; Thank you for your comments. Rgds André ALuPin@web.de |
|
|
|
|
#2 |
|
Posts: n/a
|
|
|
|
|
#3 |
|
Posts: n/a
|
Another way to write it is what is listed below. In my opinion, it
more clearly represents what you're trying to express which is that if 'ls_condition = 1' then you want to go to a known state and there is no point evaluating the case statement. Either way will synthesize to exactly the same output so it becomes somewhat of a style issue more than anything. process(rst, clk) begin if rst='1' then ls_state <= s_ini; elsif rising_edge(clk) then if ls_condition='1' then ls_state <= s_known; else case ls_state is ... when s_0 => ... when s_1 => ... when s_2 => ... end case; end if; end if; end process; KJ |
|
|
|
#4 |
|
Posts: n/a
|
Hi Mike, KJ,
thank you for your comments. Rgds André ALuPin@web.de |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| combinational lock state machine | harikanth | General Help Related Topics | 0 | 04-06-2009 05:38 AM |
| Using BRAM in state machines | zoki111 | Hardware | 0 | 09-18-2007 09:38 AM |
| Judge: File-swapping tools are legal | Citizen Bob | DVD Video | 140 | 11-08-2006 06:42 PM |
| BUSH WILL LIKELY INSTALL A DRAFT | Jas | DVD Video | 165 | 10-20-2004 09:39 PM |
| Re: Can't login to XP Pro machine | Gary | A+ Certification | 3 | 09-22-2004 10:17 PM |