level 1
Q版大尾巴狼
楼主
设计一个跑马灯电路。共8盏灯,编号为LED0-LED7,这8盏灯奇偶交替着亮灭。
这是我写的,能帮我看看哪里不对吗?
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity mux is
port(clk,en,clr:in std_logic;
dir:in std_logic;
b:out std_logic_vector(0 to 7));
end mux;
architecture rtl of mux is
begin
process(clk)
begin
if(clk'event and clk='1')then
ifclr='1'then
b<=(others=>'0');
elsifen='1'then
if dir='1'then
b<="10101010";
else b<="01010101";
end if;
endif;
end if;
end process;
end rtl;
------这个小尾巴的唯一做用就是凑字数~~~
2013年12月23日 10点12分
1
这是我写的,能帮我看看哪里不对吗?
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity mux is
port(clk,en,clr:in std_logic;
dir:in std_logic;
b:out std_logic_vector(0 to 7));
end mux;
architecture rtl of mux is
begin
process(clk)
begin
if(clk'event and clk='1')then
ifclr='1'then
b<=(others=>'0');
elsifen='1'then
if dir='1'then
b<="10101010";
else b<="01010101";
end if;
endif;
end if;
end process;
end rtl;
------这个小尾巴的唯一做用就是凑字数~~~