CPE129_hw20_soln

CPE129_hw20_soln - CPE 129 Homework 20 Solution (Completely...

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

View Full Document Right Arrow Icon
CPE 129 Homework 20 Solution W. Pilkington Composite K-Map ( Completely Specified ) Next States, (GiveToken, ChangeBack) Inputs (N, D) Present State 00 01 11 10 Got 0 Cents Got 0 Cents ( 0, 0 ) Got 10 Cents ( 0, 0 ) Got 0 Cents ( 0, 0 ) Got 5 Cents ( 0, 0 ) Got 5 Cents Got 5 Cents ( 0, 0 ) Got 0 Cents ( 1, 0 ) Got 0 Cents ( 0, 0 ) Got 10 Cents ( 0, 0 ) Got 10 Cents Got 10 Cents ( 0, 0 ) Got 0 Cents ( 1, 1 ) Got 0 Cents ( 0, 0 ) Got 0 Cents ( 1, 0 ) VHDL Code: entity TokenDispFSM is Port ( Nickel : in STD_LOGIC; Dime : in STD_LOGIC; CLK : in STD_LOGIC; GiveToken : out STD_LOGIC; ChangeBack : out STD_LOGIC); end TokenDispFSM; architecture Behavioral of TokenDispFSM is -- Create a State variable type type State_Type is (Got0Cents, Got5Cents, Got10Cents); signal PS, NS: State_Type := Got0Cents; -- Initialize -- combine the Nickel & Dime inputs into a single vector signal Nickel_Dime_In : STD_LOGIC_VECTOR( 1 downto 0); begin Nickel_Dime_In <= Nickel & Dime; CLK_synch: process (CLK) is begin if rising_edge(CLK) then PS <= NS; end if; end process CLK_synch;
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

CPE129_hw20_soln - CPE 129 Homework 20 Solution (Completely...

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

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