vlsibank

Log in or Sign up.
Main EDA Embedded Systems ASIC FPGA VHDL Verilog CMOS Semiconductors DSP Mixed Signal Architecture Miscellaneous

<-- Previous Next -- > TOPIC: generics in vhdl
Posted by: banerjee     8/16/2007 4:37:56 AM     Category: VHDL
Questions posted: 2         Comments Posted: 1
1. In this program i have used 'addvalue' as generic. But if i change the value as say 5 it is not reflected in the output wave. Why? Right now iam using Modelsim SE simulator....

2.Does it mean that generics are not as advantageous as Constants?

3. The value of the " in1int<= conv_integer(in1);"
in the code results in a negative value what is the reason for it?

entity iob is
generic(width:positive:=3;
       addvalue:integer:=9) ;
port(rst:in std_logic;
    clock:in std_logic;
    in1:in std_logic_vector(width-1 downto 0);
    out1:out std_logic_vector(width-1 downto 0));
end iob;    

architecture iob_arch of iob is
   signal in1int:integer;
   signal sum:integer;
begin
   process(clock)
   begin
       if (clock'event and clock='1') then
           if (rst='1')then
               in1int<=0;
               sum<=0;
               out1<="000";
           else
               out1<= in1;
               in1int<= conv_integer(in1);
               sum<= in1int + addvalue;
          end if;
      end if;
end process;
end iob_arch;




Posted by: lal87     3/10/2010 12:20:33 AM
Comments Posted:37       

hope this helps:
http://vhdlguru.blogspot.com/2010/03/generics-in-vhdl-construction-of.html
ask vhdl doubts here:
http://vhdlguru.blogspot.com/p/contact-me.html


Posted by: sri123     8/17/2007 7:12:03 AM
Comments Posted:1       

generics is nothing but we will provide static information over there imeediately after writing entity name we will mention the generics,this generics will provide the data for entire program,mostly we will give the timing details there.




You have to be logged in to be able to post a comment. To login click here. First time? Sign up. It just takes a few minutes to sign up.

Login to access the site

  Username:
  Password:
   Signup Forgot Password?    

Users with most replies

   User
 No. of Replies
100
86
77
76
70
66
61
57
54