Page 1 sur 1

implementation de code RLE sur carte FPGA

Publié : 16 août 2006 11:37
par khaoula
salut ,
s'il ya qq qui peut m'aider à corriger certains erreurs dans ce programme du code RLE en VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity RLE is
Port ( RLEclk : in STD_LOGIC;
RLEreset : in STD_LOGIC;
RLEin : in STD_LOGIC_VECTOR(15 downto 0);
RLEout : out STD_LOGIC_VECTOR(31 downto 0));
end RLE;

architecture architecture_RLE of RLE is
signal i: INTEGER;
signal j: INTEGER;
signal count: INTEGER;
begin
run:process(RLEclk)
begin
if(rising_edge(RLEclk))then
wait on i > 15;
i <= 1;
count <= 1;
for j IN i+1 TO 15 LOOP
if(RLEin(i)=RLEin(j))then
count <= count + 1;
else exit;end if;
if(count>1)then
RLEout <= RLEin(i)& "<" & count & ">"; ---- les erreurs sont a ce niveau
else RLEout <= RLEin(i);end ifend LOOP; ---- les erreurs sont a ce niveau
i <= i + count;
end if;
end process;
end architecture_RLE;

--------------------------------------------------------------------------------------------
je veux connaitre comment faire la conversion d'un nombre en une chaine de caracteres

et merci

Publié : 16 août 2006 18:38
par NNCORE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity RLE is
Port ( RLEclk : in STD_LOGIC;
RLEreset : in STD_LOGIC;
RLEin : in STD_LOGIC_VECTOR(15 downto 0);
RLEout : out STD_LOGIC_VECTOR(31 downto 0));
end RLE;

architecture architecture_RLE of RLE is
signal i: INTEGER;
signal j: INTEGER;
signal count: INTEGER;
begin
run:process(RLEclk)
begin
if(rising_edge(RLEclk))then
wait on i > 15;
i <= 1;
count <= 1;
for j IN i+1 TO 15 LOOP
if(RLEin(i)=RLEin(j))then
count <= count + 1;
else exit;
end if;


if(count>1)then
RLEout <= RLEin(i)& "<" & count & ">";
else RLEout <= RLEin(i);
end if;-- y avait pas un point virgule ici


end LOOP;
i <= i + count;
end if;
end process;
end architecture_RLE;

Publié : 19 août 2006 16:19
par marsu
Non je ne pense pas que le ";" soit l'erreur..
Il s'agirait plutot de la taille des bits.
En effet il faudrait que le nombre de bit de la source soit égale au nombre de bit de la destination, or ici RLEout (32bits) <= RLEin(i) (1bit) donc erreur...