这个VHDL流水灯程序编译没错,下载到板子上4个灯都亮,实现不了流水灯,哪位高人指点下哪的错误,谢谢啦!
libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityliushuide...
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity liushuideng is
port(
clk : in std_logic;
daout: out std_logic_vector(3 downto 0));
end liushuideng;
architecture behav of liushuideng is
begin
process(clk)
variable sec : std_logic_vector(1 downto 0);
begin
if(clk'event and clk='1') then
if(sec="11") then
sec:="00";
else
sec:=sec+1;
end if;
case sec is
when "00"=>daout<="0001";
when "01"=>daout<="0010";
when "10"=>daout<="0100";
when "11"=>daout<="1000";
when others=>null;
end case;
end if;
end process;
end behav; 展开
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity liushuideng is
port(
clk : in std_logic;
daout: out std_logic_vector(3 downto 0));
end liushuideng;
architecture behav of liushuideng is
begin
process(clk)
variable sec : std_logic_vector(1 downto 0);
begin
if(clk'event and clk='1') then
if(sec="11") then
sec:="00";
else
sec:=sec+1;
end if;
case sec is
when "00"=>daout<="0001";
when "01"=>daout<="0010";
when "10"=>daout<="0100";
when "11"=>daout<="1000";
when others=>null;
end case;
end if;
end process;
end behav; 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询