The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 3:20pm
Pages: 1
Send Topic Print
My first behaviour model . A linear voltage. (Read 1374 times)
zahrein
Junior Member
**
Offline



Posts: 14

My first behaviour model . A linear voltage.
Oct 03rd, 2011, 6:45pm
 
I manage to design a VHDL AMS on a linear voltage. The  voltage is not linear  at all but maybe some improvement on the  step size or timing.

The behaviour model is equated as V=IR.
In this VHDL AMS, i fix the current and vary the   resistor. Hence we will get the Linear  voltage.

The code

Testbench

module tb_test_ver();   //testbench  module  name

wire  pina, pinb;    // declaring wire input

basic_models_circuit out1 (.p(pinb) );


initial $vcdpluson;  //log on vpd file for dve
initial      #(50000) $finish;  //set to run for 50,000ps



endmodule
////////////////////////////////////////////////////////////////

Verilog AMS

module basic_models_circuit (p);

parameter real I =1m;
real    rinput;
integer i;
output p;                              
electrical p;      

initial begin
for (i =0; i <4000; i=i+100) begin
#1000 ;
rinput = i;

end
end                  
analog      begin                              
     V(p) <+ rinput* I;
     end
     
endmodule
////////////////////////////////////////////////////////////////////

Back to top
 

linearvolt.png
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.