哪位大哥教教小弟怎么用vhdl语言编写4输入十六输出的译码器!谢谢了!

正确答案!
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity yimaqi is
port(a0,a1,a2,a3:in std_logic;
y:out std_logic_vector(15 downto 0));
end yimaqi;
architecture one of yimaqi is
signal temp:std_logic_vector(3 downto 0);
begin
temp<=a0&a1&a2&a3;
process(temp)
begin
case temp is
when "0000"=>y<="1111111111111110";
when "0001"=>y<="1111111111111101";
when "0010"=>y<="1111111111111011";
when "0011"=>y<="1111111111110111";
when "0100"=>y<="1111111111101111";
when "0101"=>y<="1111111111011111";
when "0110"=>y<="1111111110111111";
when "0111"=>y<="1111111101111111";
when "1000"=>y<="1111111011111111";
when "1001"=>y<="1111110111111111";
when "1010"=>y<="1111101111111111";
when "1011"=>y<="1111011111111111";
when "1100"=>y<="1110111111111111";
when "1101"=>y<="1101111111111111";
when "1110"=>y<="1011111111111111";
when "1111"=>y<="0111111111111111";
when others=>y<="XXXXXXXXXXXXXXXX";
end case;
end process;
end one;

你就把4个输入 0000--1111 就是16个状态了 每个状态规定相应的端口输出就是了
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-09-16
很对嘛
第2个回答  2009-09-16
你这明明是在教我们怎么写。。。。。。