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 a separate pop-up window upon clicking "View PTM_45nm.txt"
Spice Code
  • .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

     

  • * Defining the inverter subcircuit
    .subckt inverter in out
    MP1 out in vdd vdd pmos w={Wmin} L={Lmin}
    Mn1 out in 0 0 NMOS W={Wmin} L={Lmin}
    .ends inverter

    * Defining the pass transistor subcircuit
    .subckt pass_transistor control in out
    Xinv control not inverter
    MP1 out not in vdd pmos w={Wp} L={Lmin}
    MN1 out control in 0 nmos W={Wmin} L={Lmin}
    .ends

  • * Define sub-circuit

    .subckt       
          inverter
          inverter

            pass_transistor
            pass_transistor
    .ends

  • *netlist statement to call the gate sub circuit *gate inputs are 'a', 'b' and the gate output is 'out'

           

  • *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', 'b' are the input names

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

    *plots inputs
    plot v(a) v(b)

    *plots output
    plot v(out)

    .endc
  • *End of the code
    .end
Observations