求一个基于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-10-21 广告
2024-10-21 广告
测温电桥是测温领域中测量准确度最高的一类电测设备,可以用来精确测量标准铂电阻温度计,电阻温度计和热敏电阻电阻值、部分测温电桥还可以对热电偶进行测量。约克仪器测温电桥2017年4月1日,英国ISOTECH公司由于microK系列测温电桥的技术...
点击进入详情页
本回答由约克仪器提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询