M
Merlyn
Guest
I have three inputs and one output in my enity:
entity TEST is
Port ( a : in STD_LOGIC_VECTOR (3 downto 0); --4 bit input
b : in STD_LOGIC_VECTOR (3 downto 0); -- 4 bit input
c : in STD_LOGIC_VECTOR (1 downto 0); --2 bit input
out_0 : out STD_LOGIC_VECTOR (3 downto 0)); --4 bit output
end TEST;
I need to do something like this:
if c = "10" then
if b=("--00") then a_1<= ('---1'); --b(3,4=0 in decimal), a(0)=1
elsif
b_1=("--01") then a_1 <= ("--1-"); --b(3,4=1 in decimal), a(1)=1
elsif
b_1=("--10") then a_1 <= ("-1--"); --b(3,4=2 in decimal), a(2)=1
elsif
b_1=("--11) then a_1 <= ("1---"); end if;--b(3,4=3 in decimal), a(3)=1
end if;
out_3 <= a_1;
--(--bits don't care 0 or 1)
Must I convert STD_LOGIC_VECTOR something else or how can i do that?
entity TEST is
Port ( a : in STD_LOGIC_VECTOR (3 downto 0); --4 bit input
b : in STD_LOGIC_VECTOR (3 downto 0); -- 4 bit input
c : in STD_LOGIC_VECTOR (1 downto 0); --2 bit input
out_0 : out STD_LOGIC_VECTOR (3 downto 0)); --4 bit output
end TEST;
I need to do something like this:
if c = "10" then
if b=("--00") then a_1<= ('---1'); --b(3,4=0 in decimal), a(0)=1
elsif
b_1=("--01") then a_1 <= ("--1-"); --b(3,4=1 in decimal), a(1)=1
elsif
b_1=("--10") then a_1 <= ("-1--"); --b(3,4=2 in decimal), a(2)=1
elsif
b_1=("--11) then a_1 <= ("1---"); end if;--b(3,4=3 in decimal), a(3)=1
end if;
out_3 <= a_1;
--(--bits don't care 0 or 1)
Must I convert STD_LOGIC_VECTOR something else or how can i do that?