P. 1
ele106_cours+tp_vol1[1]

ele106_cours+tp_vol1[1]

|Views: 3,558|Likes:
Published by Ikram Ikram

More info:

Categories:Types, School Work
Published by: Ikram Ikram on Nov 04, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/18/2013

pdf

text

original

Cette fonction convertit un argument (arg) de type signed ou unsigned (mais pas un

std_logic_vector, voir §3.3.3) en integer :

function conv_integer(arg: unsigned) return integer;

function conv_integer(arg: signed) return integer;

Exemples d’utilisation :

signal b : std_logic_vector(3 downto 0);
signal u1 : unsigned(3 downto 0);
signal s1 : signed(3 downto 0);
signal i1, i2, i3 : integer;

u1 <= "1001";
s1 <= "1001";
b <= "0001";
i1 <= conv_integer(u1); -- 9
i2 <= conv_integer(s1); -- -7
i3 <= conv_integer(b); -- erreur en simulation et synthèse

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->