求一个基于VHDL的八人抢答器
1个回答
展开全部
LIBRARY IEEE;
USE IEEE.Std_logic_1164.ALL;
ENTITY Responder IS
PORT(Start:IN Std_logic;
Key:IN Std_logic_Vector(7 DOWNTO 0);
Led:OUT Std_logic_Vector(7 DOWNTO 0));
END Responder;
ARCHITECTURE behave OF Responder IS
SIGNAL mask_off:Std_logic;
BEGIN
P1:PROCESS(Start,Key)
BEGIN
IF Start = '0' THEN
mask_off <= ‘0’;
ELSIF (Key = "11111110" OR Key = "11111101" OR Key = "11111011" OR
Key = "11110111" OR Key = "11101111" OR Key = "11011111" OR
Key = "10111111" OR Key = "01111111") THEN
mask_off <= ‘1’;
END IF;
END PROCESS;
P2:PROCESS(Start,mask_off)
BEGIN
IF Start = '0' THEN
Led <=(OTHERS => ‘0’);
ELSIF Rising_Edge (mask_off) THEN
Led <= NOT Key;
END IF;
END PROCESS;
END behave ;
USE IEEE.Std_logic_1164.ALL;
ENTITY Responder IS
PORT(Start:IN Std_logic;
Key:IN Std_logic_Vector(7 DOWNTO 0);
Led:OUT Std_logic_Vector(7 DOWNTO 0));
END Responder;
ARCHITECTURE behave OF Responder IS
SIGNAL mask_off:Std_logic;
BEGIN
P1:PROCESS(Start,Key)
BEGIN
IF Start = '0' THEN
mask_off <= ‘0’;
ELSIF (Key = "11111110" OR Key = "11111101" OR Key = "11111011" OR
Key = "11110111" OR Key = "11101111" OR Key = "11011111" OR
Key = "10111111" OR Key = "01111111") THEN
mask_off <= ‘1’;
END IF;
END PROCESS;
P2:PROCESS(Start,mask_off)
BEGIN
IF Start = '0' THEN
Led <=(OTHERS => ‘0’);
ELSIF Rising_Edge (mask_off) THEN
Led <= NOT Key;
END IF;
END PROCESS;
END behave ;
华芯测试
2024-09-01 广告
2024-09-01 广告
电学测试台是深圳市华芯测试科技有限公司的核心设备之一,它集成了高精度测量仪器与自动化控制系统,专为半导体芯片、电子元件及模块的电性能检测而设计。该测试台能够迅速、准确地完成电压、电流、电阻、电容及频率等关键参数的测试,确保产品质量符合行业标...
点击进入详情页
本回答由华芯测试提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询