你可以指定状态寄存器和状态机的状态。以下是一个有四种状态的普通状态机。 // These are the symbolic names for states // 定义状态的符号名称 parameter[1:0] S0 = 2'h0, S1 = 2'h1, S2 = 2'h2, S3 = 2'h3; // These are the current state and next state variables // 定义当前状态和下一状态变量 reg [1:0] state; reg [1: ..
[查看全文]
LIBRARY IEEE; USE IEEE.std_logic_1164.ALL; USE IEEE.std_logic_unsigned.ALL; USE IEEE.std_logic_arith.ALL; ENTITY step_motor IS PORT( f, p, d: INSTD_LOGIC:='0'; speed : inSTD_LOGIC_VECTOR(1 downto 0); coil : OUTSTD_LOGIC_VECTOR(3 downto 0) ); END step_motor; ARCHITECTURE behavior OF s ..
[查看全文]