我正在为一个带有两个输出的10-4编码器进行学校项目。我对架构非常有信心,我认为我的错误只是语法。我不断收到“未声明使用对象T1”的信息,请帮忙!我们的指令是找到第一个MSB,然后对其进行掩码并找到第二个。
library ieee;
use ieee.std_logic_1164.all;
entity enhanced_prio is
port(
r: in std_logic_vector(9 downto 0);
fst, snd: out std_logic_vector(3 downto 0)
);
end enhanced_prio;
architecture count of enhanced_prio is
signal temp:std_logic_vector(9 downto 0);
signal t1:std_logic_vector(3 downto 0);
process (temp,t1)
begin
if(r="1000000000")then
fst <= "1010";
t1 <= "1010";
else (r = "0100000000") then
fst <= "1001";
t1 <= "1001";
elsif (r = "0010000000") then
fst <= "1000";
t1 <= "1000";
elsif (r = "0001000000") then
fst <= "0111";
t1 <= "0111";
elsif (r = "0000100000") then
fst <= "0110";
t1 <= "0110";
elsif (r = "0000010000") then
fst <= "0101";
t1 <= "0101";
elsif (r = "0000001000") then
fst <= "0100";
t1 <= "0100";
elsif (r = "0000000100") then
fst <= "0011";
t1 <= "0011";
elsif (r = "0000000010") then
fst <= "0010";
t1 <= "0010";
elsif (r = "0000000001") then
fst <= "0001";
t1 <= "0001";
else (r = other ) then
fst<= "1111";
t1 <= "1111";
end if;
if (t1 = "1010") then temp <= r AND "0111111111";
elsif (t1 = "1001") then temp <= r AND "0011111111";
elsif (t1 = "1000") then temp <= r AND "0001111111";
elsif (t1 = "0111") then temp <= r AND "0000111111";
elsif (t1 = "0110") then temp <= r AND "0000011111";
elsif (t1 = "0101") then temp <= r AND "0000001111";
elsif (t1 = "0100") then temp <= r AND "0000000111";
elsif (t1 = "0011") then temp <= r AND "0000000011";
elsif (t1 = "0010") then temp <= r AND "0000000001";
elsif (t1 = "0001") then temp <= r AND "0000000000";
else (t1 = "1111") then temp <= r AND "1111111111";
end if;
if (temp = "1000000000") then
snd <= "1010";
elsif (temp = "0100000000") then
snd <= "1001";
elsif (temp = "0010000000") then
snd <= "1000";
elsif (temp = "0001000000") then
snd <= "0111";
elsif (temp = "0000100000") then
snd <= "0110";
elsif (temp = "0000010000") then
snd <= "0101";
elsif (temp = "0000001000") then
snd <= "0100";
elsif (temp = "0000000100") then
snd <= "0011";
elsif (temp = "0000000010") then
snd <= "0010";
elsif (temp = "0000000001") then
snd <= "0001";
else (temp = other ) then
snd<= "1111";
end if;
end process;
end count;