Académique Documents
Professionnel Documents
Culture Documents
Le langage de description
VHDL
Mohamed ATRI
Mohamed.atri@fsm.rnu.tn
VHDL pour la synthèse
for I in ENUM_TYPE
loop...
Fonction
mot-clé « function »
appel dans une expression
paramètres mode in, instruction return => rend une valeur
unique
rend immédiatement sa valeur (pas de wait)
Généralement définies dans les packages
27/12/21 VLSI Technologie VHDL M.ATRI 17
Exemple d’une fonction
function zero_count ( a: bit_vector) return
integer is
variable nb: integer:= 0;
begin
for i in 1 to a'length loop –length est un attribut
du signal
if a(i)=‘0' then nb:= nb+1; end if;
end loop;
return nb;
end zero_count;
27/12/21 VLSI Technologie VHDL M.ATRI 18
Processus en VHDL