vikramts
Junior Member
Offline
Posts: 17
|
I'm sorry Ken. I had not supplied the entire code in my posting earlier. This is the test bench I am using.
I did try adding a feedback capacitance(10pf first and then a 100 pf) but I got an error message to the effect that convergence could not be achieved.I am using the Cadence-AMS simulator for this.
`include "constants.vams" `include "disciplines.vams" `timescale 10ps/1ps
module cmossigvar(vinr,vinp1,vinn1,vout1,vinv1,vout2,vinv2,vout3,vdd,vss,vref); inout vinr,vinp1,vinn1,vout1,vinv1,vinv2,vout2,vout3,vdd,vss,vref; electrical vinr,vinp1,vinn1,vout1,vinv1,vinv2,vout2,vout3,vdd,vss,vref;
ground vref; integer results;
//Writing data into file initial begin results=$fopen("cmossigvar100.txt"); $fdisplay(results,"CMOS Sigmoid Variable Gain Model Test Bench Results:Gain=100"); forever #1000000 $fdisplay(results,"%t %f %f",$time,V(vinr),V(vout3)); $fwrite(results,"\n"); $fclose(results); end
//Component Instantiation opampcmos opamp1(vout1,vinp1,vinn1,vdd,vss,vref); mosinverter inv2(vinv1,vout2,vss,vdd,vref); mosinverter inv3(vinv2,vout3,vss,vdd,vref);
res #(.rn(40k)) resistor1(vinr,vinp1); res #(.rn(1000k)) resistor2(vinp1,vout1); capa #(.c(100p)) capacitf(vinp1,vout1);
res #(.rn(1k)) resistor3(vout1,vinv1); res #(.rn(100k)) resistor4(vinv1,vout2); res #(.rn(1k)) resistor5(vout2,vinv2); res #(.rn(100k)) resistor6(vinv2,vout3);
//Voltage sources and inputs vsource #(.type("pulse"),.val0(-2.5),.val1(2.5),.rise(1m))vin1(vinr,vref);
vsource #(.type("dc"),.dc(15))vin2(vdd,vref); vsource #(.type("dc"),.dc(-15))vin3(vss,vref);
analog V(vinn1,vref) <+ 0;
endmodule
|