Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 48 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,40 @@ Note : File name should be with HDL Extension
*/Program to design 4 bit adder by instantiating 1 bit Full adder.also add test bench program */
Developed by: Register Number*/

module full_adder(A,B,CIN,S,COUT);
input A,B,CIN;
output S,COUT;
assign S=A^B^CIN;
assign COUT=(A&B) | (CIN&(A^B));
endmodule

module fulladd_4bit(A,B,C0,S,C4);
input [3:0] A,B;
input C0;
output [3:0] S;
output C4;
wire C1,C2,C3;
full_adder fa0 (A[0],B[0],C0,S[0],C1);
full_adder fa1 (A[1],B[1],C1,S[1],C2);
full_adder fa2 (A[2],B[2],C2,S[2],C3);
full_adder fa3 (A[3],B[3],C3,S[3],C4);
endmodule

module test_4bit;
reg [3:0] A;
reg [3:0] B; reg C0;
wire [3:0] S; wire C4;
fulladd_4bit dut (A,B,C0,S,C4);
initial
begin
A=4'b0011;B=4'b0011;C0=1'b0;
#10; A=4'b1011;B=4'b0111;C0=1'b1;
#10; A=4'b1111;B=4'b1111;C0=1'b1;
#10;
end initial
#50 $finish;
endmodule

## Functional Simulation:

 Invoke the cadence environment by type the below commands
Expand All @@ -72,6 +106,7 @@ Developed by: Register Number*/

 After this you can see the window like below


### Fig 3:Invoke the Cadence Environment

 To Launch Simulation tool
Expand All @@ -90,6 +125,7 @@ or

 Click the cds.lib file and save the file by clicking on Save option


### Fig 5:cds.lib file Creation

 Save cds.lib file and select the correct option for cds.lib file format based on the HDL Language and Libraries used.
Expand All @@ -100,8 +136,6 @@ or

• A Click “OK” in the “nclaunch: Open Design Directory” window as shown in below figure

![image](https://github.com/user-attachments/assets/781b297a-11e9-4140-89c5-ee3b0d15bbd4)

### Fig 6: Selection of Don’t include any libraries

 A ‘NCLaunch window’ appears as shown in figure below
Expand Down Expand Up @@ -131,6 +165,9 @@ i.e Cadence IES command for compile: ncverilog +access+rwc -compile fa.v

Worklib is the directory where all the compiled codes are stored while Snapshot will have output of elaboration which in turn goes for simulation




### Fig 8: Compiled database in worklib

 After compilation it will come under worklib you can see in right side window
Expand All @@ -151,8 +188,9 @@ i.e Cadence IES command for compile: ncverilog +access+rwc -compile fa.v
3. Computes parameter values
4. Checks for hierarchical names conflicts
5. It also establishes net connectivity and prepares all of this for simulation

 After elaboration the file will come under snapshot. Select the test bench and elaborate it.




### Fig 9: Elaboration Launch Option

Expand All @@ -166,13 +204,17 @@ i.e Cadence IES command for compile: ncverilog +access+rwc -compile fa.v

 Steps for simulation – Run the simulation command with simulator options

0187d4b8d95)


### Fig 10: Design Browser window for simulation




### Fig 11: Launching Simulation Waveform WindowSimulation Waveform Window

### Fig 12: Simulation Waveform Window

### Result:

The functionality of a 4-bit adder was successfully verified using a test bench and simulated with the nclaunch tool.

Expand Down