集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1612|回复: 4

请教大家一个很简单的问题,谢谢!!!

[复制链接]
983921847 发表于 2010-10-19 11:51:17 | 显示全部楼层 |阅读模式
library ieee;
use ieee.std_logic_1164.all;
entity vhdl1 is
port (a,b,c:in std_logic;
                  re:in std_logic;

                  yut std_logic_vector(1 downto 0));
end entity vhdl1;





architecture responder_table of vhdl1 is
signal door:bit:='0';
begin




process(a,b,c)is
variable con:std_logic_vector(2 downto 0);

begin
        con:=a&b&c;
if(door='0') then
        case con is
                when "100"=>y<="01";
                when "010"=>y<="10";
                when "001"=>y<="11";
                when others => y<="XX";
        end case;
        door<='1';
end if;
end process;




process(re) is
begin
        door<='0';
end process;

end architecture responder_table;


Error (10028): Can't resolve multiple constant drivers for net "door" at Vhdl1.vhd(40)
我是想做一个三人抢答器,不止到定义信号量在那里定义,re为重新开始,abc 分别为强大按牛,请指教,谢谢!在先等!!
 楼主| 983921847 发表于 2010-10-19 12:48:09 | 显示全部楼层
有人知道吗?
liyujie 发表于 2010-10-20 09:44:10 | 显示全部楼层
con:=a&b&c;
你定义的con是一位的,a,b,c也是一位的,与运算之后结果也是一位的,在下面的case条件中却为三位的
liyujie 发表于 2010-10-20 09:44:43 | 显示全部楼层
好好看教材,抢答器很容易做的
liyujie 发表于 2010-10-20 09:45:46 | 显示全部楼层
你的思路是对的,3个输入,一个输出,就相当一3*1数据选择器
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-5-23 22:49 , Processed in 0.071619 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表