با عرض سلام
تو برنامه زیر دستور case بعضی حالات را اجرا نمی کنه برنامه تو محیط ISE 14.1 نوشته شده.
تو برنامه زیر دستور case بعضی حالات را اجرا نمی کنه برنامه تو محیط ISE 14.1 نوشته شده.
کد:
[size=+2] process(clk_5M,alarm) variable data4b:std_logic_vector(3 downto 0); variable state :integer range 0 to 31:=0; variable state1 :integer range 0 to 15:=0; variable csv:std_logic:='0'; begin if rising_edge(clk_5M) and alarm='1' then if cmdt=0 then lcd_rs<='0'; case state is when 0=> data4b:="0011"; state1:=1; state:=20; when 1=> data4b:="0111"; state1:=2; state:=20; when 2=> data4b:="1111"; state1:=3; state:=20; when 3=> data4b:="0010"; state1:=4; state:=20; when 4=> data4b:="0010"; state1:=5; state:=20; when 5=> data4b:="1000"; state1:=6; state:=20; when 6=> data4b:="0010"; state1:=7; state:=20; when 7=> data4b:="1000"; state1:=8; state:=20; when 8=> data4b:="0000"; state1:=9; state:=20; when 9=> data4b:="1100"; state1:=10; state:=20; when 10=> state1:=11; when 20=> state:=state1; when others=> end case; end if; if state<11 then datat<=data4b; csv:=not csv; cs<=csv; end if; end if; end process;[/size]
دیدگاه