Homework #3

Homework #3 - else stall <='0'; B <= E1; end if; when...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
EEE333 HW#3 Charles Wong 1. VHDL Implementation Write the VHDL codes to implement the following Moore type FSM: -------------------------------------------------------------------------- -- Assignment: HW #3 (Moore State Machine) -- Name: Charles Wong -- File: HW#3.vhd -------------------------------------------------------------------------- library IEEE; use ieee.numeric_std.all; use ieee.numeric_bit.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_1164.all; entity Moore_FSM is port( clk : in std_logic; reset : in std_logic; F_in : in std_logic; IE2_in : in std_logic; IE3_in : in std_logic; PF : in std_logic; stall : out std_logic; out1 : out std_logic_vector(2 downto 0) ); end Moore_FSM; architecture Moore of Moore_FSM is type states is (F,E1,E2,E3,P); signal A,B : states; begin process(A,F_in,IE2_in,IE3_in,PF) begin case A is when F => out1 <= "000"; if F_in = '0' then
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
EEE333 HW#3 Charles Wong stall <= '1'; B <= F;
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: else stall <='0'; B <= E1; end if; when E1 => out1 <= "001"; if IE2_in = '0' and IE3_in = '0' then stall <= '0'; B <= F; else stall <= '0'; B <= E2; end if; when E2 => out1 <= "111"; if IE3_in = '0' then stall <= '0'; B <= F; elsif IE3_in = '1' then stall <= '0'; B <= E3; elsif PF = '1' then stall <= '1'; B <= P; end if; when E3 => out1 <= "101"; if PF = '0' then stall <= '0'; B <= F; else stall <= '1'; B <= P; end if; when P => out1 <= "100"; if PF = '0' then stall <= '1'; B <= F; else stall <= '1'; B <= P; end if; when others => out1 <= "000"; stall <= '0'; B <= F; end case; end process; process (clk,reset) EEE333 HW#3 Charles Wong begin if reset = '1' then A <= F; elsif clk'event and clk='1' then A <= B; end if; end process; end Moore; 2. State Transition Diagram Draw the state diagram of the following VHDL Moore Type FSM, explicitly showing all don’t care conditions:...
View Full Document

This note was uploaded on 09/29/2008 for the course ECE 333 taught by Professor Cao during the Spring '08 term at ASU.

Page1 / 3

Homework #3 - else stall <='0'; B <= E1; end if; when...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online