Monday, August 12, 2013

Conversion Functions in VHDL


Conversion Functions in VHDL :-

Libraries To Include :
use IEEE.std_logic_signed.all;
use IEEE.std_logic_arith.all;

(1.) CONV_INTEGER() :- (use IEEE.std_logic_signed.all)
variable temp : integer:=0;
variable output : std_logic_vector(7 downto 0):=(others=>'0');
temp := CONV_INTEGER(output);
Output: temp = 0

(2.) CONV_STD_LOGIC_VECTOR () :- (use IEEE.std_logic_signed.all)
variable slv : std_logic_vector(7 downto 0);
variable temp : integer:=8;
slv = CONV_STD_LOGIC_VECTOR(temp,slv'LENGTH);
Output: slv = 00001000

(3.) INTEGER() and REAL() :-
variable t_real : real :=0.0;
variable temp_int : integer;
temp_int := INTEGER(t_real);
t_real := REAL(t_int);

(4.) SIGNED() and UNSIGNED() :-
signal a: std_logic_vector(7 downto 0);
signal a_sign: signed(7 downto 0);
signal a_unsign: unsigned(7 downto 0);
a_sign <= signed(a);
a_unsign <= unsigned(a);

1 comment:

  1. How to make the minimum bet with a casino - Dr. Maryland
    Learn 용인 출장샵 how 태백 출장샵 to make 안성 출장마사지 a minimum bet with a casino at casinos. Learn 순천 출장샵 tips and tricks for making money at 김천 출장마사지 casinos. Don't feel like you are losing your

    ReplyDelete