Instructions
  • The Spice Code is partially filled and divided into code blocks.
  • Drag and drop these code blocks to arrange them in the correct order for the code to work.
  • Complete the partially filled code blocks
  • Once you have completed the code and rearranged the blocks as required, click on validate. This will give the report and input-output graphs upon a successful code.
  • Clicking on reset will reset the experiment and you can start your practice again.
  • You can find the MOSFET model text file ("PTM_45nm.txt") in the demo section
Spice Code
  • * inverter *

    .include


    * Parameter Declarations

    .PARAM supply=1.1
    .PARAM Lmin=45nm
    .PARAM Wmin=45nm
    .PARAM Wp={2*Wmin}
    .global vdd gnd

  • * Netlist statement to define voltage source

     

  • * Define sub-circuit

    .subckt     
              pmos w={Wmin} L={Lmin}
              nmos w={Wmin} L={Lmin}
    .ends

  • *netlist statement to call the inverter sub circuit

         

  • *Declaring Input Waveform
    .PARAM trfin=10p
    .PARAM t1 = 10n
    .PARAM t2 = 20n
    .PARAM t3 = 30n
    .PARAM t4 = 40n
    .PARAM t5 = 1*8000p+1200p
    .PARAM t6 = 1*8000p+1210p
    .PARAM t7 = 1*8000p+5200p
    .PARAM t8 = 1*8000p+5210p

    *Transient Analysis
    .tran 6p 50n

    *Use below line for input (declaring input pwl Waveform)
    *'V1' is the PWL source name, 'a' is the input name

    V1 a 0 PWL (0 0 't1' 0 't1+trfin' 'supply' 't2' 'supply' 't3' 'supply' 't3+trfin' 0 't4' 0)
  • *Control Statements
    .control
    run

    *sets background color of plot
    set color0=white

    *plots input
    plot v(a)

    *plots output
    plot v(out)

    .endc
  • *End of the code
    .end
Observations