Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Moore is combinational,
primitive example
Let C= {Not A & Not B} OR {A & B}
we say here C = Exclusive NOR of {A,B}
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 -- This is a sample state-machine using enumerated types. -- This will allow the synthesis tool to select the appropriate -- encoding style and will make the code more readable. --Insert the following in the architecture before the begin keyword --Use descriptive names for the states, like st1_reset, st2_search type state_type is (st1_<name_state>, st2_<name_state>, ...); signal state, next_state : state_type; --Declare internal signals for all outputs of the state-machine signal <output>_i : std_logic; -- example output signal --other outputs --Insert the following in the architecture after the begin keyword SYNC_PROC: process (<clock>) begin if (<clock>'event and <clock> = '1') then if (<reset> = '1') then state <= st1_<name_state>; <output> <= '0'; else state <= next_state; <output> <= <output>_i; -- assign other outputs to internal signals end if; end if; end process; --MOORE State-Machine - Outputs based on state only OUTPUT_DECODE: process (state) begin --insert statements to decode internal output signals --below is simple example if state = st3_<name> then <output>_i <= '1'; else <output>_i <= '0'; end if; end process; NEXT_STATE_DECODE: process (state, <input1>, <input2>, ...) begin --declare default state for next_state to avoid latches next_state <= state; --default is to stay in current state --insert statements to decode next_state --below is a simple example case (state) is when st1_<name> => if <input_1> = '1' then next_state <= st2_<name>; end if; when st2_<name> => if <input_2> = '1' then next_state <= st3_<name>; end if; when st3_<name> => next_state <= st1_<name>; when others => next_state <= st1_<name>; end case; end process;