Participant Name: AAKASH.M
College Name: SRM Easwari Engineering College

Low power NAND gate based full subtractor using CMOS Technology:
Prerequisites:
1. A computer with eSim software installed (https://esim.fossee.in/downloads)
2. Skywater130 PDK (https://github.com/google/skywater-pdk)

Design Procedure:
1. The truth table for the full subtractor circuit is prepared.
	 A   B   borrow_in   Difference (D)   borrow_out  
	--- --- ----------- ---------------- ------------ 
	 0   0           0                0            0  
	 0   0           1                1            1  
	 0   1           0                1            1  
	 0   1           1                0            1  
	 1   0           0                1            0  
	 1   0           1                0            0  
	 1   1           0                0            0  
	 1   1           1                1            1  
2. The boolean expression for the difference and borrow_out are obtained using Karnaugh map.
3. eSim is opened, default workspace path is chosen.
4. A new project is created by clicking on the 'New project' button in eSim.
5. The project is opened by double clicking on the project.
6. The 'Open Schematic' button is clicked to open the schematic editor.
7. The full subtractor circuit is designed using the reference circuit using the mosfets mosfet_p and mosfet_n in eSim using the reference circuit in the literature survey.
8. Electrical rules check is performed by clicking on 'Perform electrical rules check' button and verified that there are no errors. 
9. After designing the circuit, click on the 'Generate Netlist' button, check the 'Default format' option under 'Spice' tab and click on 'Generate' button to generate the .cir file.
10. The Skywater130 PDK files are extracted in the same folder where the .cir file.
11. The .cir file is opened using a text editor like Notepad for editing.
12. The relative path for the Skywater130 PDK libraries are added to the .cir file.
13. The mosfet_p and mosfet_n are replaced with Skywater130 models.
14. The mosfet names(Eg: M1,M2 etc) are prefixed with 'x'.
15. The pulse voltage sources with proper time period and time delay are added to the .cir file in such a way that all possible input combinations can be given to the circuit.
16. The transient analysis statement (.tran) is added to the .cir file with time step and time period parameters.
17. The control statements like 'run' and 'plot' are added to the .cir file.

Simulation Procedure:
1. Command prompt window is opened.
2. The current directory in command prompt is changed using 'cd' command to the location where the .cir file is located.
3. The simulation is performed by typing 'ngspice filename.cir' in the command prompt window and pressing enter key.
4. The input and output waveforms are displayed on the screen after the completion of the simulation.

Observation:
The waveforms obtained after the simulation matched with the truth table thus verifying that the circuit is working properly.

Difficulties Faced:
The reference circuit doesn't match the truth table at some time intervals in the waveform plot. One possible explanation is that there might be noise in the reference circuit which produced incorrect waveforms at some time intervals. But, the actual full subtractor simulation which is done using eSim matched perfectly with the truth table verifying that the the circuit designed using eSim is working properly during simulation.