V
VHDL_HELP
Guest
hi every body,
my problem is to simulate a module that make convert the 3 signals
Red , Green and Blue to Y,Cr and Cb
( transfom space color )
this program is correct with syntax but not synthetisable
------------------------------------------------------------------------------------------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity rgb is
Port ( clk : in STD_LOGIC;
reset: in STD_LOGIC;
r : in STD_LOGIC_VECTOR (10 downto 0);
g : in STD_LOGIC_VECTOR (10 downto 0);
b : in STD_LOGIC_VECTOR (10 downto 0);
y : out STD_LOGIC_VECTOR (21 downto 0);
cb: out STD_LOGIC_VECTOR (21 downto 0);
cr: out STD_LOGIC_VECTOR (21 downto 0));
end rgb;
architecture Behavioral of rgb is
signal s1,s2: bit_vector(10 downto 0);
signal yr,yg,yb,crr,crb,crg,cbr,cbb,cbg:STD_LOGIC_VECTOR (19 downto
0);
signal yy,cr1,cb1:STD_LOGIC_VECTOR (21 downto 0);
begin
-- component Y
yr <= "0100110010" * r;
yg <= "1001011001" * g;
yb <= "0001110100" * b;
yy <= yb + yg + yr;
-- component cr
s1 <= To_bitvector(r) srl 1;
crr <= "000000000" & To_StdLogicVector(s1);--decalage de 1 de r
crg <= "0110101101" * g;
crb <= "0001010011" * b;
cr1 <= crr - crg - crb;
-- component cb
cbr <= "0010101101" * r;
cbg <= "0101010011" * g;
s2 <= To_bitvector(b) srl 1;
cbb <= "000000000" & To_StdLogicVector(s2);--decalage de 1 de b
cb1 <= cbb - cbr - cbg;
-- the results
y <= yy;
cr <= cr1;
cb <= cb1;
end Behavioral;
------------------------------------------------------------------------------------------------------------------------------------------------------------------
thank you
my problem is to simulate a module that make convert the 3 signals
Red , Green and Blue to Y,Cr and Cb
( transfom space color )
this program is correct with syntax but not synthetisable
------------------------------------------------------------------------------------------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity rgb is
Port ( clk : in STD_LOGIC;
reset: in STD_LOGIC;
r : in STD_LOGIC_VECTOR (10 downto 0);
g : in STD_LOGIC_VECTOR (10 downto 0);
b : in STD_LOGIC_VECTOR (10 downto 0);
y : out STD_LOGIC_VECTOR (21 downto 0);
cb: out STD_LOGIC_VECTOR (21 downto 0);
cr: out STD_LOGIC_VECTOR (21 downto 0));
end rgb;
architecture Behavioral of rgb is
signal s1,s2: bit_vector(10 downto 0);
signal yr,yg,yb,crr,crb,crg,cbr,cbb,cbg:STD_LOGIC_VECTOR (19 downto
0);
signal yy,cr1,cb1:STD_LOGIC_VECTOR (21 downto 0);
begin
-- component Y
yr <= "0100110010" * r;
yg <= "1001011001" * g;
yb <= "0001110100" * b;
yy <= yb + yg + yr;
-- component cr
s1 <= To_bitvector(r) srl 1;
crr <= "000000000" & To_StdLogicVector(s1);--decalage de 1 de r
crg <= "0110101101" * g;
crb <= "0001010011" * b;
cr1 <= crr - crg - crb;
-- component cb
cbr <= "0010101101" * r;
cbg <= "0101010011" * g;
s2 <= To_bitvector(b) srl 1;
cbb <= "000000000" & To_StdLogicVector(s2);--decalage de 1 de b
cb1 <= cbb - cbr - cbg;
-- the results
y <= yy;
cr <= cr1;
cb <= cb1;
end Behavioral;
------------------------------------------------------------------------------------------------------------------------------------------------------------------
thank you