********************************************************Read me file of 2-input NAND Gate**************************************************************************************

(1)Download esim from FOSSEE website 
(2) also, download it's manual and after esim downloaded setup it as according to given in it's manual.
(3) Open esim
(4) Click on new project
(5) Give name to your project using only underscore and alphabet do not use any ,special characters,etc. in project name.
(6) open schematic a pop up display box comes that, wish to create new schematic it ? Yes
 
I made the circuit of 2-input NAND_GATE in the esim schematic using 2 PMOS,2 NMOS , 2 Pulse Voltage,1 Dc voltage Vcc1 of 5v, Ground and connect all these according 
to the given circuit diagram of NAND Gate using CMOS by connecting wires. After that using labels. And for plotting the waveform 
I uses 3 plot i.e., Two for input Ain and Bin and one for output.
After that annotate the circuit, checking ERC, Then generate netlist in default Format. save schemtaic. 

*** Simulation of NAND_GATE*********

When I simulated the circuit then, in that when I run it's simulation by kicad to ngspice conversion in the Transient analysis , then at first I give values 
in micro second and in source details I give all the values of both pulse voltage in micro second and after that add the respective in-built libraries of 180nm of PMOS 
and NMOS in the device modelling with values of w,l,m just to check that my waveform of NAND_Gate circuit is coming correct or not . After Entering all the values 
I click on convert when it is successfully converted.

Analysis:-Transient 0s 1ms 100ms
Source details:pulse voltage v1(0 10 0.1us 0.1us 0.1us 15us 20us)
Source details:pulse voltage v2(0 10 0.1us 0.1us 0.1us 15us 10us)


To get the waveform plot now I click on Simulation in the esim environment then When my waveform is plotted it comes wrong which is not giving the correct waveform 
according to the truth table of NAND Gate 
 So, to get the correct the waveform I add resitors in the schematic i.e., now I connected the load in parallel with pulse voltage at both input Ain and Bin and 
also at output with the specification :
R1=10k
R2=10k
R3=20k
After that, When I again run the simulation with the same values as I provided above then, the waveform was came on the negative side of y-axis it goes on negative 
side then, to correct that waveform so, that it comes on positive side I takes the same value means now in transient analysis and in source details 
I converted from  micro second to milli second means I increased the value from micro second to milli second and then run the simulation . This time the simulation 
comes correct of it.

Analysis:-Transient 0ms 1ms 100ms
Source details: pulse voltage v1(0 15 0s 0s 0s 5ms 25ms)
Source details:pulse voltage v2(0 10 0s 0s 0s 10ms 20ms)

Now this time , waveform or simulation of NAND Gate comes correctly.

 **************Conversion of Given circuit now into SKY130nm Technology**************

Now, I have to deal with the SKY130nm Technology that, I have to convert my circuit into 130nm Technology so, to convert it into first I downloaded the Zip file of 
SKY130nm technology from this link: https://github.com/google/skywater-pdk-libs-sky130_fd_pr
then, extract it to specified folder and created a new folder on the desktop with the name new130nm and copying all the files of sky130_fd_pr in 
this folder then, I go to c drive and go to FOSSEE and into that then go to esim and then, go to the folder of NAND Gate and open that folder then, in that NAND Gate
folder there is a file with the name .cir.out and I Save the .cir.out file in the sky_fd_pr folder as .cir file. and I changed all the specifications from 
180nm to 130nm of NMOS , PMOS and also of resistor by opening .cir file into notepad and deleted the libraries of 180nm and add the libraray of 130nm then ,
 I have to run it into ngspice .

**Problem coming in running circuit using ngspice**
When I right click on the .cir file and open it with ngspice then, I did not found the ngspice app then, I also try .cir file to run using Cmd but also
that fails and then , what I do to solve this problem is that I close this folder and open only ngspice from start menu and checks it's location after checking the 
location I again open that folder and again right click on .cir file and now I find the location of ngspice as I go to 
(i)cdrive 
(ii)FOSSEE
(iii)spice
(iv)bin
(v)ngspice.exe 
I click on it and run it then, it runs and showing Fatal error.
Failed to find the given library 
Then, 
I open again the  sky130_fd_pr folder and then, what I found that there is another folder inside it sky130_fd_pr folder and then here, I paste the .cir file and then,
run it using the same process as specified above this time it runs in ngspice and takes some time to generate the output then , When output generated I matched 
that output with the truth table of NAND GATE and now it's showing the correct waveform plot this time . Means , that now my circuit is completely converted into 130nm 
technology.

**Merging the inputs, output waveform separately in paint **

When I start merging inputs, output waveform in paint then, I face some issues as When I try to resize the graph to set it accordingly then sometimes it's values are
 hiding and sometimes it becomes blur also sometimes it becomes soo much compressed that I even cannot recognize the lines of the waveform in the plot 
then, I again generated all the graph again and adjust it on screen of the laptop then, I use snipping tool and took the picture and paste it into paint and also add
the combine waveform of input-output in the below of that picture and adjust it accordingly and at the end finally , all the four waveform is adjusted and I merged all the individual inputs 
and output waveform with the combine waveform of input-output . And save that picture in paint.
 

*****************circuit completed with 130nm technology of NAND gate in esim************************
Finally , the circuit is completed of 2-input NAND Gate using CMOS in esim using SKY130nm Technology.


