用VHDL语言编写在Quartus II 软件上编译仿真的按键选通模块,U为加键,D为减键,当sel为000时把U给U0、D给
D0,当sel为001时把U给U1、D给D1,以此类推,sel为110则把U给U6、D给D6。输入端为u,d,sel[2..0],输出端为u1到u6,d1到d6...
D0,当sel为001时把U给U1、D给D1,以此类推,sel为110则把U给U6、D给D6。输入端为u,d,sel[2..0],输出端为u1到u6,d1到d6
展开
展开全部
library ieee;
use ieee.std_logic_1164.all;
entity choise is
port ( u,d : in std_logic;
sel: in std_logic_vector(2 downto 0);
u1,u2,u3,u4,u5,u6,d1,d2,d3,d4,d5,d6 : out std_logic);
end entity;
architecture one of choise is
process ( sel ,u,d)
begin
case sel is
when "001" => u1 <= u,d1<=d;
when "010" => u2 <=u,d2<=d;
when "011" => u3 <= u,d3<=d;
when "100" => u4 <=u,d4<=d;
when "101" => u5 <= u,d5<=d;
when "110" => u6 <=u,d6<=d;
when others => null;
end case;
end process;
end architecture;
use ieee.std_logic_1164.all;
entity choise is
port ( u,d : in std_logic;
sel: in std_logic_vector(2 downto 0);
u1,u2,u3,u4,u5,u6,d1,d2,d3,d4,d5,d6 : out std_logic);
end entity;
architecture one of choise is
process ( sel ,u,d)
begin
case sel is
when "001" => u1 <= u,d1<=d;
when "010" => u2 <=u,d2<=d;
when "011" => u3 <= u,d3<=d;
when "100" => u4 <=u,d4<=d;
when "101" => u5 <= u,d5<=d;
when "110" => u6 <=u,d6<=d;
when others => null;
end case;
end process;
end architecture;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询