Y
yvonnewong
Guest
I am trying to writing a 16 QAM. However, i cannot fix the mapper to
the 4 digit code. It can be compiled but the i and q branches doesn't
have any output. Anyone could help? thx
entity QAM is
port
(
clock : in bit;
flag1 : in bit;
flag2 : in bit;
flag3 : in bit;
flag4 : in bit;
input : in bit;
i : out bit_vector(1 downto 0);
q : out bit_vector(1 downto 0)
);
end QAM;
architecture trial of QAM is
begin
process (input)
variable c1,c2,c3,c4:integer;
begin
if ((flag1= '1') and (input= '1')) then
c1:=1;
elsif ((flag1= '1') and (input= '0')) then
c1:=0;
elsif ((flag2= '1') and (input= '1')) then
c2:=1;
elsif ((flag2= '1') and (input= '0')) then
c2:=0;
elsif ((flag3= '1') and (input= '1')) then
c3:=1;
elsif ((flag3= '1') and (input= '0')) then
c3:=0;
elsif ((flag4= '1') and (input= '1')) then
c4:=1;
if ((c1=1) and (c2=0) and (c3=1) and (c4=1)) then
i<="00"; q<="11";
elsif ((c1=1) and (c2=0) and (c3=1) and (c4=0)) then
i<="00"; q<="10";
elsif ((c1=1) and (c2=1) and (c3=1) and (c4=0)) then
i<="00"; q<="01";
elsif ((c1=1) and (c2=1) and (c3=1) and (c4=1)) then
i<="00"; q<="00";
elsif ((c1=1) and (c2=0) and (c3=0) and (c4=1)) then
i<="01"; q<="11";
elsif ((c1=1) and (c2=0) and (c3=0) and (c4=0)) then
i<="01"; q<="10";
elsif ((c1=1) and (c2=1) and (c3=0) and (c4=0)) then
i<="01"; q<="01";
elsif ((c1=1) and (c2=1) and (c3=0) and (c4=1)) then
i<="01"; q<="00";
elsif ((c1=0) and (c2=0) and (c3=0) and (c4=1)) then
i<="10"; q<="11";
elsif ((c1=0) and (c2=0) and (c3=0) and (c4=0)) then
i<="10"; q<="10";
elsif ((c1=0) and (c2=1) and (c3=0) and (c4=0)) then
i<="10"; q<="01";
elsif ((c1=0) and (c2=1) and (c3=0) and (c4=1)) then
i<="10"; q<="00";
elsif ((c1=0) and (c2=0) and (c3=1) and (c4=1)) then
i<="11"; q<="11";
elsif ((c1=0) and (c2=0) and (c3=1) and (c4=0)) then
i<="11"; q<="10";
elsif ((c1=0) and (c2=1) and (c3=1) and (c4=0)) then
i<="11"; q<="01";
elsif ((c1=0) and (c2=1) and (c3=1) and (c4=1)) then
i<="11"; q<="00";
end if;
elsif ((flag4= '1') and (input= '0')) then
c4:=0;
if ((c1=1) and (c2=0) and (c3=1) and (c4=1)) then
i<="00"; q<="11";
elsif ((c1=1) and (c2=0) and (c3=1) and (c4=0)) then
i<="00"; q<="10";
elsif ((c1=1) and (c2=1) and (c3=1) and (c4=0)) then
i<="00"; q<="01";
elsif ((c1=1) and (c2=1) and (c3=1) and (c4=1)) then
i<="00"; q<="00";
elsif ((c1=1) and (c2=0) and (c3=0) and (c4=1)) then
i<="01"; q<="11";
elsif ((c1=1) and (c2=0) and (c3=0) and (c4=0)) then
i<="01"; q<="10";
elsif ((c1=1) and (c2=1) and (c3=0) and (c4=0)) then
i<="01"; q<="01";
elsif ((c1=1) and (c2=1) and (c3=0) and (c4=1)) then
i<="01"; q<="00";
elsif ((c1=0) and (c2=0) and (c3=0) and (c4=1)) then
i<="10"; q<="11";
elsif ((c1=0) and (c2=0) and (c3=0) and (c4=0)) then
i<="10"; q<="10";
elsif ((c1=0) and (c2=1) and (c3=0) and (c4=0)) then
i<="10"; q<="01";
elsif ((c1=0) and (c2=1) and (c3=0) and (c4=1)) then
i<="10"; q<="00";
elsif ((c1=0) and (c2=0) and (c3=1) and (c4=1)) then
i<="11"; q<="11";
elsif ((c1=0) and (c2=0) and (c3=1) and (c4=0)) then
i<="11"; q<="10";
elsif ((c1=0) and (c2=1) and (c3=1) and (c4=0)) then
i<="11"; q<="01";
elsif ((c1=0) and (c2=1) and (c3=1) and (c4=1)) then
i<="11"; q<="00";
end if;
end if;
end process;
end trial;
the 4 digit code. It can be compiled but the i and q branches doesn't
have any output. Anyone could help? thx
entity QAM is
port
(
clock : in bit;
flag1 : in bit;
flag2 : in bit;
flag3 : in bit;
flag4 : in bit;
input : in bit;
i : out bit_vector(1 downto 0);
q : out bit_vector(1 downto 0)
);
end QAM;
architecture trial of QAM is
begin
process (input)
variable c1,c2,c3,c4:integer;
begin
if ((flag1= '1') and (input= '1')) then
c1:=1;
elsif ((flag1= '1') and (input= '0')) then
c1:=0;
elsif ((flag2= '1') and (input= '1')) then
c2:=1;
elsif ((flag2= '1') and (input= '0')) then
c2:=0;
elsif ((flag3= '1') and (input= '1')) then
c3:=1;
elsif ((flag3= '1') and (input= '0')) then
c3:=0;
elsif ((flag4= '1') and (input= '1')) then
c4:=1;
if ((c1=1) and (c2=0) and (c3=1) and (c4=1)) then
i<="00"; q<="11";
elsif ((c1=1) and (c2=0) and (c3=1) and (c4=0)) then
i<="00"; q<="10";
elsif ((c1=1) and (c2=1) and (c3=1) and (c4=0)) then
i<="00"; q<="01";
elsif ((c1=1) and (c2=1) and (c3=1) and (c4=1)) then
i<="00"; q<="00";
elsif ((c1=1) and (c2=0) and (c3=0) and (c4=1)) then
i<="01"; q<="11";
elsif ((c1=1) and (c2=0) and (c3=0) and (c4=0)) then
i<="01"; q<="10";
elsif ((c1=1) and (c2=1) and (c3=0) and (c4=0)) then
i<="01"; q<="01";
elsif ((c1=1) and (c2=1) and (c3=0) and (c4=1)) then
i<="01"; q<="00";
elsif ((c1=0) and (c2=0) and (c3=0) and (c4=1)) then
i<="10"; q<="11";
elsif ((c1=0) and (c2=0) and (c3=0) and (c4=0)) then
i<="10"; q<="10";
elsif ((c1=0) and (c2=1) and (c3=0) and (c4=0)) then
i<="10"; q<="01";
elsif ((c1=0) and (c2=1) and (c3=0) and (c4=1)) then
i<="10"; q<="00";
elsif ((c1=0) and (c2=0) and (c3=1) and (c4=1)) then
i<="11"; q<="11";
elsif ((c1=0) and (c2=0) and (c3=1) and (c4=0)) then
i<="11"; q<="10";
elsif ((c1=0) and (c2=1) and (c3=1) and (c4=0)) then
i<="11"; q<="01";
elsif ((c1=0) and (c2=1) and (c3=1) and (c4=1)) then
i<="11"; q<="00";
end if;
elsif ((flag4= '1') and (input= '0')) then
c4:=0;
if ((c1=1) and (c2=0) and (c3=1) and (c4=1)) then
i<="00"; q<="11";
elsif ((c1=1) and (c2=0) and (c3=1) and (c4=0)) then
i<="00"; q<="10";
elsif ((c1=1) and (c2=1) and (c3=1) and (c4=0)) then
i<="00"; q<="01";
elsif ((c1=1) and (c2=1) and (c3=1) and (c4=1)) then
i<="00"; q<="00";
elsif ((c1=1) and (c2=0) and (c3=0) and (c4=1)) then
i<="01"; q<="11";
elsif ((c1=1) and (c2=0) and (c3=0) and (c4=0)) then
i<="01"; q<="10";
elsif ((c1=1) and (c2=1) and (c3=0) and (c4=0)) then
i<="01"; q<="01";
elsif ((c1=1) and (c2=1) and (c3=0) and (c4=1)) then
i<="01"; q<="00";
elsif ((c1=0) and (c2=0) and (c3=0) and (c4=1)) then
i<="10"; q<="11";
elsif ((c1=0) and (c2=0) and (c3=0) and (c4=0)) then
i<="10"; q<="10";
elsif ((c1=0) and (c2=1) and (c3=0) and (c4=0)) then
i<="10"; q<="01";
elsif ((c1=0) and (c2=1) and (c3=0) and (c4=1)) then
i<="10"; q<="00";
elsif ((c1=0) and (c2=0) and (c3=1) and (c4=1)) then
i<="11"; q<="11";
elsif ((c1=0) and (c2=0) and (c3=1) and (c4=0)) then
i<="11"; q<="10";
elsif ((c1=0) and (c2=1) and (c3=1) and (c4=0)) then
i<="11"; q<="01";
elsif ((c1=0) and (c2=1) and (c3=1) and (c4=1)) then
i<="11"; q<="00";
end if;
end if;
end process;
end trial;