
Follow the steps given below to understand the usage of SCAP
1.If this is the first time to use SCAP type add_mgc ee584 in your command prompt and then press enter this creates a
new directory under mgc called ee584 and under it creates a tut directory where an
example file of a low pass filter is stored,students are encouraged to analyse those
files after finishing this tutorial.
2.Type sp ee584 in your command prompt and then press enter.
3.Then open your favourite text editor and type the following this is the description of
the circuit shown above
timing ; /*This defines a clock called phi1 which is high for 1/2 master clock period*/ clock phi1 1 (0 1/2) ; end ; /*this defines a subcircuit called lpf(K:phi1)*/ subckt (1 3) lpf(K:phi1) ; /*it says switch1 controlled by clock phi1 between nodes 1 and 2*/ s1 (1 2) phi1 ; s2 (2 3) #phi1 ; /*it says capacitor between nodes 2 and 0 of value 1picofarad*/ c1 (2 0) 1.0p ; c2 (3 0) 11.31527p ; end ; /*higher Level circuit description*/ circuit ; /*this describes that a voltage source is connected between 1 and 0*/ vin (1 0) ; /*the subcircuit is taken in between nodes 1 and 2 at higher level*/ x1 (1 2) lpf(phi1) ; end ; end ;
/*it calls in the file to be analysed*/ circuit ex1.swt; /*It defines a Master clock of 256 KHz*/ fsample 256K; /*range where the circuit is analysed is between 10-50KHz,200 pts logrithamically distributed are taken*/ fre 10 50K log 200; /*input is given at node 1*/ in 1; /*output is seen at node 2* out 2;

7.You will have the following menus as shown in the fig

8.Click on the menu option SVDX(with a arrow pointing to the left) and you will get the dialog box asking you to select the file to
analysed and you should select ex1.fre.svdx under the scap directory.Then you will get a message saying the file was
imported.
9.Click on the trace option you will get a trace window and the following menu option in the screen

10.Click on the ADD STK option in the menu and you will see the following dialog box appear on the screen and double click
on ex1 and you will have the waveforms in ex1. Select node 2 using left mouse button and then click on OK.

After you Click on OK you will see the following appear on the screen

The X-axis ois a linear scale so to change the X-axis to a log scale use the right mouse button and click it on the trace window. You
will get a sub menu. Then goto windows and you will see the following dialog box appear on the screen.Do the following as
shown in the dialog box

You should see the Trace window showing the output response of a low pass filter.

Note: You have the option ADD OVL if you want to compare two wave forms. You can use the option and select the two
waveforms in the dialog box and then click on OK to see the waveforms appear in the screen in two different colours.
The waveforms you generate will be saved in the ex1 directory under the scap directory.
11.Now you are done with the frequency analysis lets do the timing analysis. Type the following files and save it under the scap
directory.
/*generates a step input of 1V*/ create var step 1; /*generates a sine wave input with freq = 800Hz*/ create expr sine sin(twopi * 800 * time );
/*uses the file to be analysed*/ circuit ex1.swt; /*calls the source file to take the inputs */ source ex1.src; /*master clock with frequency 256 Khz*/ fsample 256K; /*analysed for a time = 100 time cycles of the master clk period*/ tim 100; /*calls the variable step from the source file*/ in 1 step; out 2;
circuit ex1.swt; source ex1.src; fsample 256K; tim 400; /*400 time cycles of the master clock*/ in 1 sine; out 2;