1 <!DOCTYPE rgb3sx8_to_gs>
2 <block_impl ref_md5="" ref_name="rgb3sx8_to_gs.xml">
4 <author mail="" lastname="" firstname=""/>
6 <description>vcdsv</description>
7 <notes>vrevgfregaqv</notes>
11 <package name="std_logic_1164" use="all"/>
12 <package name="numeric_std" use="all"/>
17 signal do_mult : std_logic;
18 signal do_out : std_logic;
19 signal count : unsigned (2 downto 0);
20 signal accum : unsigned(dsp_in_width-1 downto 0);
21 signal result : unsigned(dsp_out_width-1 downto 0);
22 signal cst_mult : unsigned(dsp_in_width-1 downto 0); -- eq. 87382 to do /3
26 cst_mult <= to_unsigned(87382, 18);
28 accum_process : process (clk, reset)
31 count <= to_unsigned(0, 3);
32 accum <= to_unsigned(0, dsp_in_width);
35 elsif rising_edge(clk) then
39 if rgb_in_enb = '1' then
42 accum <= resize(unsigned(rgb_in), dsp_in_width);
43 count <= to_unsigned(1, 3);
45 accum <= accum + resize(unsigned(rgb_in), dsp_in_width);
46 count <= to_unsigned(2, 3);
48 accum <= accum + resize(unsigned(rgb_in), dsp_in_width);
49 count <= to_unsigned(0, 3);
55 end process accum_process;
57 mult_process : process (clk, reset)
60 result <= to_unsigned(0, dsp_out_width);
62 elsif rising_edge(clk) then
66 result <= accum * cst_mult;
70 end process mult_process;
72 gs_out <= std_logic_vector(result(dsp_in_width+7 downto dsp_in_width));
73 gs_out_enb <= do_out;
78 <delta value="to_define"/>
80 <input name="rgb_in_enb" pattern="to_define"/>
82 <production counter="to_define">
83 <output name="gs_out_enb" pattern="to_define"/>