This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > Design Recipes for FPGAs Using Verilog and VHDL > Mixed Signal Modeling > Differential Equations in Verilog-AMS

TABLE OF CONTENTS

Xilinx FPGA FPGA Forum

Differential Equations in Verilog-AMS

FONT SIZE : AAA

Verilog-AMS also allows the modeling of linear differential equations using the two differential operators: 

• ddt (Differentiate the variable with respect to time) 

• idt (Integrate the variable with respect to time) We can illustrate this by taking two examples, a capacitor and an inductor. First, consider the basic equation of a capacitor:

= CdV/dt (18.8)

Using a similar model structure as the resistor, we can define a model entity and architecture, but what about the equation? In Verilog-AMS, the ddt function is used on the voltage to represent the differentiation as follows:

1 I(p,m) <+ c∗ddt(V(p,m))

Therefore, a complete capacitor model in VHDL-AMS could be implemented as follows:

1 module c(p,m)

2 inout p; / Positive Terminal

3 inout m; / Negative Terminal

45 electrical p,m; / Define ports as electrical

67 / define the capacitance with a default value of 1.0e−6 8 parameter real cap = 1.0e−6;

9

10 analog begin

11 I(p,m) <+ cap∗ddt(V(p,m));

12 end

13

14 endmodule

What about an inductor? The basic equation for an inductor is given as follows:

1.png

which could also be written as:

1.png

Obviously, the most direct way to implement this equation would be to use the i dt operator; however, care should be taken with the integration operator as some simulators do not handle the integration function in the same manner (in fact, some simulators do not support it at all well). Obviously the initial condition must be considered and in addition different implementations can occur across simulators. One standard approach is to use what is called implicit integration, whereby, using the differential equation, the integral function can be inferred. However, the resulting implementation using the differential equation in its simplest form could be as follows:

1 module l(p,m)

2 inout p; / Positive Terminal

3 inout m; / Negative Terminal

45 electrical p,m; / Define ports as electrical

67 / define the inductance with a default value of 1.0e−6 8 parameter real ind = 1.0e−6;

9

10 analog begin

11 V(p,m) <+ ind∗ddt(I(p,m));

12 end

13

14 endmodule


  • XC5VLX155-2FFG1760C

    Manufacturer:Xilinx

  • FPGA Virtex-5 LX Family 65nm Technology 1V 1760-Pin FCBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Active Active

    RoHS:

  • XC5VLX155-3FFG1760C

    Manufacturer:Xilinx

  • FPGA Virtex-5 LX Family 65nm Technology 1V 1760-Pin FCBGA
  • Product Categories: FPGAs

    Lifecycle:Active Active

    RoHS:

  • XCS30XL-5PQ240C

    Manufacturer:Xilinx

  • Spartan and Spartan-XL Families Field Programmable Gate Arrays FPGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS: -

  • XC4028XLA-9HQ208C

    Manufacturer:Xilinx

  • Xilinx QFP
  • Product Categories:

    Lifecycle:Any -

    RoHS: -

  • XCS30XL-VQ100

    Manufacturer:Xilinx

  • Xilinx QFP100
  • Product Categories:

    Lifecycle:Obsolete -

    RoHS: -

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.