N
Nemesis
Guest
Hi all, I'm working on a Digital Down Converter, the first stage of this
converter is composed by two blocks wich perform the I/Q demodulation
multiplicating the input sequence with sin/cos.
Frequencies are in a particular ratio, so this demodulation is
performed multiplicating the input sequence by (1,0,-1,0)/(0,-1,0,1).
So I used a 2-counter which feeds two blocks that implement this
demodulation. These blocks are implemented like multiplexers, in the
bottom of this article I pasted one of the blocks.
I have problems with the simulation of these blocks. When the SEL input
changes from the "00" value to "11" value, the output bits doesn't
change in the same time, so I can see a certain amount of "undesidered"
transitions, is that normal? Is there something wrong in the code?
I also tried using a DEMOD variable instead of DEMOD_OUT, but nothing
changed (I got exactly the same RTL).
******************Q_Demod.vhd***************************
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Q_Demod is
port(
CLK : in STD_LOGIC;
INPUT : in STD_LOGIC_VECTOR(13 downto 0);
SEL : in STD_LOGIC_VECTOR(1 downto 0);
DEMOD_OUT : out STD_LOGIC_VECTOR(13 downto 0)
);
end Q_DEMOD;
architecture Behavioral of Q_DEMOD is
begin
------------------------------------------
process (CLK)
begin
if rising_edge(CLK) then
case SEL is
when "00" => DEMOD_OUT <= "00000000000000"; -- 0
when "01" => DEMOD_OUT <= (not INPUT) + 1; -- -1
when "10" => DEMOD_OUT <= "00000000000000"; -- 0
when "11" => DEMOD_OUT <= INPUT; -- 1
when others => NULL;
end case;
end if;
end process;
------------------------------------------
end Behavioral;
******************Q_Demod.vhd***************************
--
If you cannot convince them, confuse them.
|\ | |HomePage : http://nem01.altervista.org
| \|emesis |XPN (my nr): http://xpn.altervista.org
converter is composed by two blocks wich perform the I/Q demodulation
multiplicating the input sequence with sin/cos.
Frequencies are in a particular ratio, so this demodulation is
performed multiplicating the input sequence by (1,0,-1,0)/(0,-1,0,1).
So I used a 2-counter which feeds two blocks that implement this
demodulation. These blocks are implemented like multiplexers, in the
bottom of this article I pasted one of the blocks.
I have problems with the simulation of these blocks. When the SEL input
changes from the "00" value to "11" value, the output bits doesn't
change in the same time, so I can see a certain amount of "undesidered"
transitions, is that normal? Is there something wrong in the code?
I also tried using a DEMOD variable instead of DEMOD_OUT, but nothing
changed (I got exactly the same RTL).
******************Q_Demod.vhd***************************
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Q_Demod is
port(
CLK : in STD_LOGIC;
INPUT : in STD_LOGIC_VECTOR(13 downto 0);
SEL : in STD_LOGIC_VECTOR(1 downto 0);
DEMOD_OUT : out STD_LOGIC_VECTOR(13 downto 0)
);
end Q_DEMOD;
architecture Behavioral of Q_DEMOD is
begin
------------------------------------------
process (CLK)
begin
if rising_edge(CLK) then
case SEL is
when "00" => DEMOD_OUT <= "00000000000000"; -- 0
when "01" => DEMOD_OUT <= (not INPUT) + 1; -- -1
when "10" => DEMOD_OUT <= "00000000000000"; -- 0
when "11" => DEMOD_OUT <= INPUT; -- 1
when others => NULL;
end case;
end if;
end process;
------------------------------------------
end Behavioral;
******************Q_Demod.vhd***************************
--
If you cannot convince them, confuse them.
|\ | |HomePage : http://nem01.altervista.org
| \|emesis |XPN (my nr): http://xpn.altervista.org