help read a pixel for picture

Mar 02, 2007 2 Replies

hi every body , my problem is how to read a pixel for a picture (a pixel is composed by three component Red, Green and Blue ) to get the three component. this program is correct into syntax but i m not sure for the result please help me , i m a beginner and i m not sure with the result that gives me



-------------------------------------------------------------------------------------------------------------------------------------------------------------- entity lecteur_pixel is Port ( clk : in STD_LOGIC; composante : in STD_LOGIC_VECTOR (7 downto 0); R : out STD_LOGIC_VECTOR (7 downto 0); G : out STD_LOGIC_VECTOR (7 downto 0); B : out STD_LOGIC_VECTOR (7 downto 0)); end lecteur_pixel;



architecture architecture_lecteur of lecteur_pixel is signal count: STD_LOGIC_VECTOR (1 downto 0):="00";



--a meter that allows counting the number of clock top and decide the composing to read



begin



-- To the first clock top one reads the composing R, to the 2ND one reads G and to the third one reads B process(clk) begin if clk='1' and clk'event then count


--------------------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------

Your process should have a reset to put your FFs in a known state. I'd also use rising_edge(clk).

There is a separate group for the VHDL questions : comp.lang.vhdl

I think what you want is a flip-flop with enable. I don't think "when" can be used in this context. The standard way of coding this would be as shown below:

process(clk) begin if clk='1' and clk'event then count

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required