Project Robotics - March 2009 - (Page 14) entity amp is generic (k : real := 1.0 -- model gain, a generic (parameter) declaration); port (terminal input : electrical; terminal output : electrical -- port (pin) declarations); end entity amp; figure 1 entity statement for a simple power amplifier. architecture ideal of amp is quantity vin across input to electrical_ref; quantity vout across iout through output to electrical_ref -- port (pin) declarations; begin vout == k * vin -- simultaneous statements; end architecture ideal; figure 2 architecture statement for a simple power amplifier. VoluMe 1 14 || nuMBer 1 parameters to be used in the model are also declared in the entity statement, and the name of the entity is typically the same as the name of the model itself. an architecture statement defines the behavior of the model. a single model may only have one entity, but may contain multiple architectures, with each architecture statement defining a different type of behavior. To understand how these statements are created, consider the case of an ideal single-input, singleoutput power amplifier, whose gain equation is output = k * input. The entity statement for this amplifier would be that shown in figure 1. in the entity statement (as well as the architecture statement), the keywords for the model are always given in boldface. Comments about the coding are always preceded by “--“, and the descriptive comment, of course, is not used in the simulation. in the entity’s generic statement, the value of the gain (1) is declared, while in the ports statement, the input and output ports are described. The generic k is declared as type real, so it can be assigned any real number. The value 1 is a default value here, but models do not have to have default values for generics. note that the entity begins and ends with the name of the model, in this case, “amp”. defining BehaVior Model functionality is implemented in the architecture section (figure 2), whose first line of declares an architecture called “ideal.” for the entity called “amp.” The model developer chose the name “ideal” to indicate that this is an idealized, high-level implementation. The model’s simultaneous equations and other concurrent statements appear between the begin and end keywords. in Vhdl-aMs, the “==” sign indicates that this equation is continuously evaluated during simulation, and equality is Contents Viewpoint the Cutting edge for haptiC researCh Modeling CoMplex eleCtroMeChaniCal systeMs deVeloping a two-wheeled self-BalanCing transport platforM home page product training Module online ordering suppliers Catalog http://ad.doubleclick.net/clk;212362954;32989198;w?http://www.digikey.com http://ad.doubleclick.net/clk;212362954;32989198;w?http://www.digikey.com http://ad.doubleclick.net/clk;212363051;32989198;l?http://digikey.com/PTM/PTMMaster.page?site=us&lang=en http://ad.doubleclick.net/clk;212363300;32989198;i?http://ordering.digikey.com/ordering/addpart.aspx?site=US&source=search http://ad.doubleclick.net/clk;212363091;32989198;p?http://digikey.com/Suppliers/SupplierIndex.page?site=us&lang=en http://ad.doubleclick.net/clk;212363309;32989198;r?http://dkc1.digikey.com/us/en/pdf/Current.html
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.