打印

8~3优先编码器的VHDL程序怎么写

[复制链接]
3679|2
手机看帖
扫描二维码
随时随地手机跟帖
沙发
2009上道的| | 2009-9-23 14:13 | 只看该作者
library ieee;
use ieee.std_logic_1164.all;
entity coder is
port(din:in std_logic_vector(0 to 7);
        output:out std_logic_vector(0 to 2)):
end coder;
architecture behav of coder is
signal sint:std_logic_vector(4 downto 0);
begin
process(din)
begin
   if (din(7)='0') then output<="000";
   elsif(din(6)='0') then output<="100";
   elsif(din(5)='0') then output<="010";
   elsif(din(4)='0') then ouput<="110";
   elsif(din(3)='0') then output<="001";
   elsif(din(2)='0') then output<="101";
   elsif(din(1)='0') then output<="011";
   else output<="111";
end if;
end process;
end behav;

使用特权

评论回复
板凳
2009上道的| | 2009-9-23 14:14 | 只看该作者
输出端口那里打错了,你自己改改

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

21

主题

75

帖子

0

粉丝