Apna Vlsi
Apna Vlsi
Aim:
Software Required:
Program:
a) Structural Description
c) Behavioural Description
4
Ex no: 02
IMPLEMENTATION OF FULL ADDER
Date: 29-01-2024
25-02-23
Aim:
Software Required:
Program:
A) Structural Description
C) Behavioural Description
module FullAdder(X1,X2,Cin,Sum,Carry);
input X1,X2,Cin;
output Sum,Carry;
reg [1:0] temp;
always @(*)
begin
7
Ex no: 03
IMPLEMENTATION OF ENCODER
Date: 05-02-2024
04-03-23
Aim:
Software Required:
Program:
a) Structural Description
module Encoder(en,i,y);
// declare port list via input and output
input en;
input [7:0]i;
output [2:0]y;
wire temp1,temp2,temp3;
or o1(temp1,i[4],i[5],i[6],i[7]);
or o2(temp2,i[2],i[3],i[6],i[7]);
or o3(temp3,i[1],i[3],i[5],i[7]);
and a1(y[2],temp1,en);
and a2(y[1],temp2,en);
and a3(y[0],temp3,en);
endmodule
module Encoder(en,i,y);
// declare port list via input and output
input en;
input [7:0]i;
output [2:0]y;
// check the logic diagram and assign the outputs
assign y[2]=i[4] | i[5] | i[6] | i[7] &en;
assign y[1]=i[2] | i[3] | i[6] | i[7] &en;
assign y[0]=i[1] | i[3] | i[5] | i[7] &en;
11
Ex no: 04
IMPLEMENTATION OF DECODER
Date: 05-02-2024
04-03-23
Aim:
Software Required:
Program:
module Decoder(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7);
input a,b,c;
output d0,d1,d2,d3,d4,d5,d6,d7;
assign d0=(~a&~b&~c),
d1=(~a&~b&c),
d2=(~a&b&~c),
d3=(~a&b&c),
d4=(a&~b&~c),
d5=(a&~b&c),
d6=(a&b&~c),
d7=(a&b&c);
endmodule
b) Behavioral Description
16
Ex no: 05
IMPLEMENTATION OF MULTIPLEXER
Date: 12-02-2024
11-03-23
Aim:
Software Required:
Program:
A) Behavioral Description
module multiplexbehaviourl(I,sel,Y);
input [7:0]I;
input [2:0]sel;
output reg Y;
always@(*)
begin
case(sel)
3'b000: Y=I[0];
3'b001: Y=I[1];
3'b010: Y=I[2];
3'b011: Y=I[3];
3'b100: Y=I[4];
3'b101: Y=I[5];
3'b110: Y=I[6];
3'b111: Y=I[7];
default: Y=1'b0;
endcase
end
endmodule
B) Data flow
module muxdataflow(output out, input D0, D1, D2, D3, D4, D5, D6, D7, S0, S1, S2);
assign S1bar=~S1;
20
Ex no: 06
IMPLEMENTATION OF DEMULTIPLEXER
Date: 12-02-2024
11-03-23
Aim:
Software Required:
Program:
A) Behavioral Description
module DUMULTIPLIXER(y,s,a);
output reg [7:0]y;
input [2:0]s;
input a;
always @(*)
begin
y=0;
case(s)
3'd0: y[0]=a;
3'd1: y[1]=a;
3'd2: y[2]=a;
3'd3: y[3]=a;
3'd4: y[4]=a;
3'd5: y[5]=a;
3'd6: y[6]=a;
3'd7: y[7]=a;
endcase
end
Endmodule
B) Data flow
module Demultiplexer(in,s0,s1,s2,d0,d1,d2,d3,d4,d5,d6,d7);
input in,s0,s1,s2;
25
Ex no: 07
IMPLEMENTATION OF D FLIPFLOP
Date : 19-02-2024
18-03-23
Aim:
Software Required:
Program:
29
Ex no: 08
Aim:
To implement the SISO Shift Register using Verilog Module in Xilinx ISE.
Software Required:
Program:
32
Ex no: 09
IMPLEMENTATION OF BINARY UP/DOWN COUNTER
Date : 04-03-2024
01-04-23
Aim:
To implement the Binary Up/down counter using Verilog Module in Xilinx ISE.
Software Required:
Program:
module updown(clk,rst,UpOrDown,Count);
input clk,rst,UpOrDown;
output [3 : 0] Count;
reg [3 : 0] Count;
always @(clk)
begin
if(rst==1)
Count<=0;
else if(UpOrDown==1)
if(Count==15)
Count<=0;
else
Count<=Count+1;
else if(Count==0)
Count<=15;
else
Count<=Count-1;
end
Endmodule
36
Ex no: 10
IMPLEMENTATION OF RIPPLE CARRY ADDER
Date : 09-03-2024
08-04-23
Aim:
To implement the Ripple carry Adder using Verilog Module in Xilinx ISE.
Software Required:
Program:
module FullAdder(X,Y,Z,S,C);
input X,Y,Z;
output S,C;
assign S=X^Y^Z;
assign C=(X&Y)|(Z&(X^Y));
endmodule
module Ripple_Carry_Adder1(A,B,S,C);
input [3:0]A;
input [3:0]B;
output [3:0]S;
output C;
wire W1,W2,W3;
FullAdder L1(A[0],B[0],1'b0,S[0],W1);
FullAdder L2(A[1],B[1],W1,S[1],W2);
FullAdder L3(A[2],B[2],W2,S[2],W3);
FullAdder L4(A[3],B[3],W3,S[3],C);
Endmodule
40
Output:
Result:
Thus the Ripple carry Adder using Verilog Module in Xilinx ISE implemented and
verified.
42
Ex no: 11
IMPLEMENTATION OF BRUN MULTIPLIER
Date : 11-03-2024
15-04-23
Aim:
Software Required:
Program:
module Half(Sum,Carry,A,B);
input A,B;
output Sum,Carry;
assign Sum=A^B;
assign Carry=A&B;
endmodule
module Fulladder(S,C,X,Y,Z);
input X,Y,Z;
output S,C;
assign S=X^Y^Z;
assign C=(X&Y)|(Z&(X^Y));
endmodule
module Braunmultiplier(output [7:0] y,input [3:0] a,b);
wire [2:0] sl0, cl0, sl1, cl1, sl2, cl2, cl3;
and a0_b0(y[0],a[0],b[0]);
and a0_b1(a0b1,a[0],b[1]);
and a0_b2(a0b2,a[0],b[2]);
and a0_b3(a0b3,a[0],b[3]);
and a1_b0(a1b0,a[1],b[0]);
and a1_b1(a1b1,a[1],b[1]);
and a1_b2(a1b2,a[1],b[2]);
and a1_b3(a1b3,a[1],b[3]);
and a2_b0(a2b0,a[2],b[0]);
43
and a2_b1(a2b1,a[2],b[1]);
and a2_b2(a2b2,a[2],b[2]);
and a2_b3(a2b3,a[2],b[3]);
and a3_b0(a3b0,a[3],b[0]);
and a3_b1(a3b1,a[3],b[1]);
and a3_b2(a3b2,a[3],b[2]);
and a3_b3(a3b3,a[3],b[3]);
//layer1
Half h1(y[1],cl0[0],a0b1,a1b0);
Half h2(sl
0[1],cl0[1],a1b1,a2b0);
Half h3(sl0[2],cl0[2],a2b1,a3b0);
//layer2
Fulladder fa1(y[2], cl1[0], a0b2, cl0[0], sl0[1]);
Fulladder fa2(sl1[1], cl1[1], a1b2, cl0[1], sl0[2]);
Fulladder fa3(sl1[2], cl1[2], a2b2, cl0[2], a3b1);
//layer3
Fulladder fa4(y[3], cl2[0], a0b3, cl1[0], sl1[1]);
Fulladder fa5(sl2[1], cl2[1], a1b3, cl1[1], sl1[2]);
Fulladder fa6(sl2[2], cl2[2], a2b3, cl1[2], a3b2);
//layer4
Half h4(y[4], cl3[0], cl2[0], sl2[1]);
Fulladder fa7(y[5], cl3[1], cl3[0], cl2[1], sl2[2]);
Fulladder fa8(y[6], y[7], cl3[1], cl2[2], a3b3);
Endmodule
44
Output:
45
Report:
Device utilization summary:
Selected Device : 7a30tcsg324-1
Slice Logic Utilization:
Number of Slice LUTs: 17 out of 21000 0%
Number used as Logic: 17 out of 21000 0%
IO Utilization:
Number of IOs: 16
Number of bonded IOBs: 16 out of 210 7%
Timing Report
Timing Summary:
---------------
Speed Grade: -1
Timing Details:
---------------
All values displayed in nanoseconds (ns)
Thus the Brun Multiplier using Verilog Module in Xilinx ISE implemented and verified
46
Ex no: 12
IMPLEMENTATION OF WALLACE TREE MULTIPLIER
Date : 11-03-2024
22-04-23
Aim:
To implement the Wallace Tree Multiplier using Verilog Module in Xilinx ISE.
Software Required:
Program:
module halfadd(Sum_half,Carry_half,A,B);
input A,B;
output Sum_half,Carry_half;
assign Sum_half=A^B;
assign Carry_half=A&B;
endmodule
module fulladd(S,C,X,Y,Z);
input X,Y,Z;
output S,C;
assign S=X^Y^Z;
assign C=(X&Y)|(Z&(X^Y));
endmodule
module wallacetree(input [3:0] a,b,output [7:0] p);
wire x0, x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,s1 ,s2, s3 ,s4,s5;
wire s6,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11;
assign x0 = a[3]&b[3];
assign x1 = a[3]&b[2];
assign x2 = a[2]&b[3];
assign x3 = a[2]&b[2];
assign x4 = a[1]&b[3];
assign x5 = a[3]&b[1];
assign x6 = a[1]&b[2];
assign x7 = a[0]&b[3];
assign x8 = a[3]&b[0];
47
assign x9 = a[2]&b[1];
assign x10 = a[1]&b[1];
assign x11 = a[0]&b[2];
assign x12 = a[2]&b[0];
assign x13 = a[1]&b[0];
assign x14 = a[0]&b[1];
assign x15 = a[0]&b[0];
halfadd ha2(s1,c1,x6,x7);
halfadd ha1(s2,c2,x3,x4);
fulladd fa3(s6,c6,x1,x2,c2);
fulladd fa2(s5,c5,s2,x5,c1);
fulladd(s4,c4,s1,x8,x9);
halfadd ha3(s3,c3,x10,x11);
halfadd ha4(p[1],c7,x13,x14);
fulladd fa4(p[2],c8,s3,x12,c7);
fulladd fa5(p[3],c9,s4,c3,c8);
fulladd fa6(p[4],c10,s5,c4,c9);
fulladd fa7(p[5],c11,s6,c5,c10);
fulladd fa8(p[6],p[7],x0,c6,c11);
assign p[0] = x15;
endmodule
48
Output:
Report:
IO Utilization:
Number of IOs: 16
Number of bonded IOBs: 16 out of 210 7%
Clock Information:
------------------
No clock signals found in this design
Timing Summary:
---------------
Speed Grade: -1
Timing Details:
---------------
All values displayed in nanoseconds (ns)
========================================================================
Timing constraint: Default path analysis
Total number of paths / destination ports: 208 / 8
-------------------------------------------------------------------------
Delay: 4.744ns (Levels of Logic = 7)
Source: a<2> (PAD)
Destination: p<6> (PAD)
========================================================================
Cross Clock Domains Report:
========================================================================
Result:
Thus the Wallace Tree Multiplier using Verilog Module in Xilinx ISE implemented and
verified
51
Ex no: 13
IMPLEMENTATION OF RANDOM-ACCESS MEMORY
Date : 18-03-2024
29-04-23
Aim:
Software Required:
Program:
module Ram(datain,addr,dataout,RW,clk);
input RW,clk;
input [9:0]addr;
input [7:0]datain;
output [7:0]dataout;
reg [7:0]mem[0:1023];
reg [7:0]dataout;
always@(posedge clk)
begin
if (RW==1)
dataout<=mem[addr];
else
mem[addr]<=datain;
end
endmodule
Output:
52
Report:
IO Utilization:
Number of IOs: 28
Number of bonded IOBs: 28 out of 210 13%
Timing Summary:
---------------
Speed Grade: -1
Timing Details:
---------------
All values displayed in nanoseconds (ns)
53
=======================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock 'clk'
Total number of paths / destination ports: 20 / 20
-------------------------------------------------------------------------
Offset: 1.193ns (Levels of Logic = 1)
Source: datain<7> (PAD)
Destination: Mram_mem (RAM)
Destination Clock: clk rising
Data Path: datain<7> to Mram_mem
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
IBUF:I->O 1 0.001 0.399 datain_7_IBUF (datain_7_IBUF)
RAMB18E1:DIADI7 0.793 Mram_mem
----------------------------------------
Total 1.193ns (0.794ns logic, 0.399ns route)
(66.6% logic, 33.4% route)
=======================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock 'clk'
Total number of paths / destination ports: 8 / 8
-------------------------------------------------------------------------
Offset: 3.152ns (Levels of Logic = 1)
Source: Mram_mem (RAM)
Destination: dataout<7> (PAD)
Source Clock: clk rising
Data Path: Mram_mem to dataout<7>
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
RAMB18E1:CLKARDCLK->DOADO7 1 2.753 0.399 Mram_mem (dataout_7_OBUF)
OBUF:I->O 0.000 dataout_7_OBUF (dataout<7>)
----------------------------------------
Total 3.152ns (2.753ns logic, 0.399ns route)
(87.3% logic, 12.7% route)
Result:
Thus the RAM 1024 using Verilog Module in Xilinx ISE implemented and verified
54
Ex no: 14
IMPLEMENTATION OF ARITHMETIC LOGIC UNIT (ALU)
Date : 18-03-2024
06-05-23
Aim:
To implement the Arithmetic logic unit (ALU) using Verilog Module in Xilinx ISE.
Software Required:
Program:
module ArithmeticUnit(S,A,B,Y);
input [2:0]S;
input A,B;
output Y;
reg Y;
always@(S,A,B)
begin
case(S)
3'b000: Y<=A|B;//Logical OR
3'b001: Y<=A&B;//Logical AND
3'b010: Y<=A^B;//Logical XOR
3'b011: Y<=~(A|B);//Logical NOR
3'b100: Y<=~(A&B);//Logical NAND
3'b101: Y<=A~^B;//Logical XNOR
3'b110: Y<=A-B;//Logical Subtraction
3'b111: Y<=A*B;//Logical Multiplication
endcase
end
endmodule
55
Output:
Report:
56
IO Utilization:
Number of IOs: 6
Number of bonded IOBs: 6 out of 210 2%
Timing Report
Clock Information:
No clock signals found in this design
Asynchronous Control Signals Information:
No asynchronous control signals found in this design
Timing Summary:
Speed Grade: -1
Minimum period: No path found
Minimum input arrival time before clock: No path found
Maximum output required time after clock: No path found
Maximum combinational path delay: 1.443ns
Timing Details:
All values displayed in nanoseconds (ns)
=======================================================================
Timing constraint: Default path analysis
Total number of paths / destination ports: 5 / 1
-------------------------------------------------------------------------
Delay: 1.443ns (Levels of Logic = 3)
Source: A (PAD)
Destination: Y (PAD)
Data Path: A to Y
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
IBUF:I->O 1 0.001 0.919 A_IBUF (A_IBUF)
LUT5:I0->O 1 0.124 0.399 Mmux_Y_2_f7 (Y_OBUF)
OBUF:I->O 0.000 Y_OBUF (Y)
----------------------------------------
Total 1.443ns (0.125ns logic, 1.318ns route)
(8.7% logic, 91.3% route)
Result:
Thus the ALU using Verilog Module in Xilinx ISE implemented and verified
57
Ex no: 15
IMPLEMENTATION OF CMOS CODE
Date : 25-03-2024
13-05-23
Aim:
Software Required:
Program:
module pmos1(y,vdd,a);
input a,vdd;
output y;
reg y;
always@(a)
begin
if (a==1)
y=0;
else
y=1;
end
endmodule
module nmos1(y,gnd,a);
input a,gnd;
output y;
reg y;
always@(a)
begin
if (a==1)
y=0;
else
y=0;
end
endmodule
58
Main Program:
module cmosinv(a,y);
input a;
output y;
wire y1,y2;
supply0 gnd;
supply1 vdd;
pmos1 p1(y1,vdd,a);
nmos1 n1(y2,gnd,a);
assign {y}= y1 + y2;
endmodule
Output:
59
Number of fully used LUT-FF pairs: 0 out of 1 0%
Number of unique control sets: 0
IO Utilization:
Number of IOs: 2
Number of bonded IOBs: 2 out of 210 0%
Timing Details:
---------------
All values displayed in nanoseconds (ns)
========================================================================
Timing constraint: Default path analysis
Total number of paths / destination ports: 1 / 1
-------------------------------------------------------------------------
Delay: 0.945ns (Levels of Logic = 3)
Source: a (PAD)
Destination: y (PAD)
Data Path: a to y
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
IBUF:I->O 1 0.001 0.399 a_IBUF (a_IBUF)
INV:I->O 1 0.146 0.399 p1/y1_INV_0 (y1)
OBUF:I->O 0.000 y_OBUF (y)
----------------------------------------
Total 0.945ns (0.147ns logic, 0.798ns route)
(15.6% logic, 84.4% route)
Result:
Thus the CMOS Inverter using Verilog Module in Xilinx ISE implemented and verified
60
Ex no: 16
IMPLEMENTATION OF CMOS INVERTER
Date :20-05-23
02-04-2024
Aim:
To implement the CMOS inverter using EDA tool & analyse the characteristics.
Software Required:
Circuit:
61
Layout:
Output:
62
Program:
// DSCH 2.7f
// 27-05-2023 14:54:09
// F:\Vivek\CMos Inverter.sch
module CMos Inverter( in1,out1);
input in1;
output out1;
nmos #(1) nmos(out1,vss,in1); // 1.0u 0.12u
pmos #(1) pmos(out1,vdd,in1); // 2.0u 0.12u
endmodule
// Simulation parameters in Verilog Format
always
#10 in1=~in1;
// Simulation parameters
// in1 CLK 10 10
Result:
Thus the CMOS inverter was implemented using EDA tool & analysed its characteristics
63
Ex no: 17
IMPLEMENTATION OF CMOS NAND
Date : 02-04-2024
20-05-23
Aim:
To implement the CMOS NAND using EDA tool & analyse the characteristics.
Software Required:
Circuit:
64
Layout:
Output:
65
Program:
// DSCH 2.7f
// 27-05-2023 15:44:43
// F:\Vivek\CMos Nand 4 input.sch
module CMos Nand 4 input( in4,in2,in3,in1,out1);
input in4,in2,in3,in1;
output out1;
pmos #(1) pmos(out1,vdd,in1); // 2.0u 0.12u
pmos #(1) pmos(out1,vdd,in2); // 2.0u 0.12u
pmos #(1) pmos(out1,vdd,in3); // 2.0u 0.12u
pmos #(1) pmos(out1,vdd,in4); // 2.0u 0.12u
nmos #(1) nmos(out1,w6,in1); // 1.0u 0.12u
nmos #(1) nmos(w6,w7,in2); // 1.0u 0.12u
nmos #(1) nmos(w7,w8,in3); // 1.0u 0.12u
nmos #(1) nmos(w8,vss,in4); // 1.0u 0.12u
endmodule
// Simulation parameters in Verilog Format
always
#10 in4=~in4;
#20 in2=~in2;
#40 in3=~in3;
#80 in1=~in1;
// Simulation parameters
// in4 CLK 10 10
// in2 CLK 20 20
// in3 CLK 40 40
// in1 CLK 80 80
Result:
Thus the CMOS NAND was implemented using EDA tool & analysed its characteristics
66
Ex no: 18
IMPLEMENTATION OF PSEUDO CMOS NAND
Date : 10-04-2024
27-05-23
Aim:
To implement the PSEUDO CMOS NAND using EDA tool & analyse the characteristics.
Software Required:
Circuit:
67
Layout:
Output:
68
Program:
// DSCH 2.7f
// 27-05-2023 16:19:04
// F:\Vivek\CMos PSEUDO.sch
// Simulation parameters
// in1 CLK 10 10
// in2 CLK 20 20
// in3 CLK 40 40
// in4 CLK 80 80
Result:
Thus the PSEUDO CMOS NAND was implemented using EDA tool & analysed its
characteristics.
69
Ex no: 19
IMPLEMENTATION OF DYNAMIC CMOS NAND
Date : 10-04-2024
27-05-23
Aim:
To implement the Dynamic CMOS NAND using EDA tool & analyse the characteristics.
Software Required:
Circuit:
70
Layout:
Output:
71
Program:
Result:
Thus the Dynamic CMOS NAND was implemented using EDA tool & analysed its
characteristics.
72
Ex no: 20
IMPLEMENTATION OF CMOS NAND/AND IN CASCODE
VOLTAGE SWITCH LOGIC
Date : 18-04-2024
27-05-23
Aim:
To implement the CMOS NAND/AND in cascode voltage switch logic using EDA tool &
analyse the characteristics.
Software Required:
Circuit:
Layout:
73
Output:
74
Program:
// DSCH 2.7f
// 01-06-2023 23:44:24
module CMOS NAND-AND( in1,in2,out1,out2);
input in1,in2;
output out1,out2;
pmos #(1) pmos(out1,vdd,out2); // 2.0u 0.12u
pmos #(1) pmos(out2,vdd,out1); // 2.0u 0.12u
nmos #(1) nmos(out1,vss,w3); // 1.0u 0.12u
nmos #(1) nmos(out1,vss,w4); // 1.0u 0.12u
nmos #(1) nmos(w3,vss,in1); // 1.0u 0.12u
pmos #(1) pmos(w3,vdd,in1); // 2.0u 0.12u
pmos #(1) pmos(w4,vdd,in2); // 2.0u 0.12u
nmos #(1) nmos(w4,vss,in2); // 1.0u 0.12u
nmos #(1) nmos(out2,w7,in1); // 1.0u 0.12u
nmos #(1) nmos(w7,vss,in2); // 1.0u 0.12u
endmodule
// Simulation parameters
// in1 CLK 10 10
// in2 CLK 20 20
Result:
Thus the CMOS NAND/AND in cascode voltage switch logic was implemented using
EDA tool & analysed its characteristics.
75