Escolar Documentos
Profissional Documentos
Cultura Documentos
LAB OBSERVATION
NAME: ____________________________
REGNO :_____________________________
CLASS/SEM :____________________________
1. HDL based design entry and simulation of simple counters, state machines,
adders (min 8 bit) and multipliers (4 bit min).
2. Synthesis, P&R and post P&R simulation of the components simulated in (I)
above. Critical paths and static timing analysis results to be identified. Identify and
verify possible conditions under which the blocks will fail to work correctly.
3. Hardware fusing and testing of each of the blocks simulated in (I). Use of either
chipscope feature (Xilinx) or the signal tap feature (Altera) is a must. Invoke the
PLL and demonstrate the use of the PLL module for clock generation in FPGAs.
NAME OF THE
EXP.NO DATE PAGE NO MARKS SIGNATURE
EXPERIMENT
2-BIT
Truth Table:
2 Bit Counter
---------------------------------------------------
Clock Clear Output[2]
---------------------------------------------------
0 0 00
1 0 00
0 0 00
1 0 00
0 0 00
1 0 00
0 0 00
1 0 00
0 0 00
1 0 00
0 1 00
1 1 01
0 1 01
1 1 10
0 1 10
1 1 11
0 1 11
1 1 00
0 1 00
1 1 01
0 1 01
1 1 10
0 1 10
1 1 11
0 1 11
1 1 00
0 0 00
1 0 00
------------------------------------------------
EC-6612 VLSI DESIGN LAB – RECORD 8
Ex. No:1a IMPLEMENTATION OF COUNTERS
Date:
AIM:
To implement Counters using Verilog HDL
APPARATUS REQUIRED:
• PC with Windows XP.
• XILINX, ModelSim software.
PROCEDURE:
Program:
COUNT2BIT
UP/DOWN COUNTER:
Output Wave:
Output Wave:
q <= q - 1'b1;
end
end
end
endmodule
RIPPLE COUNTER:
Date:
AIM:
To implement state machine in Verilog HDL.
APPARATUS REQUIRED:
• PC with Windows XP.
• XILINX, ModelSim software.
PROCEDURE:
Program:
State Machine:
2'b10:
begin
if( inp ) state <= 2'b01;
else state <= 2'b11;
end
2'b11:
begin
if( inp ) state <= 2'b01;
else state <= 2'b10;
end
endcase
end
end
always @(posedge clk, posedge rst)
begin
if( rst )
outp <= 0;
else if( state == 2'b11 )
outp <= 1;
else outp <= 0;
end
endmodule
Date :
AIM:
To implement half adder and full adder using Verilog HDL.
APPARATUS REQUIRED:
PROCEDURE:
DATAFLOW MODELLING
module ha (a,b,s,c);
input a,b;
output s,c;
assign s = a^b;
assign c =a&b;
endmodule
BEHAVIOURAL MODELLING
module ha(a,b,s,c);
input a,b;
output s,c;
reg s,c;
always@(a or b)
begin
s =a^b;
c =a&b;
end
endmodule
DATAFLOW MODELLING:
module fa(a,b,cin,sum,cout);
input a,b,cin;
output sum,cout;
assign sum = a^b^cin;
assign cout =(a&b)|(b&cin)|(cin&a);
endmodule
BEHAVIOURAL MODELLING:
module fa(a,b,cin,sum,cout);
input a,b,cin;
output sum,cout;
reg sum,cout;
always @(a or b or cin)
begin
sum =a^b^cin;
cout =(a&b)|(b&cin)|(cin&a);
end
endmodule
STRUCTURAL MODELLING:
module FullAddr(i1, i2, c_in, c_out, sum);
input i1;
input i2;
input c_in;
output c_out;
output sum;
wire s1,c1,c2;
xor n1(s1,i1,i2);
and n2(c1,i1,i2);
xor n3(sum,s1,c_in);
and n4(c2,s1,c_in);
or n5(c_out,c1,c2);
endmodule
module addsub(s,cout,a,b,m);
input [7:0] a,b;
input m;
output [7:0] s;
output cout;
wire [0:6]c;
wire [0:7]t;
xor2g x1(t[0],m,b[0]);
xor2g x2(t[1],m,b[1]);
xor2g x3(t[2],m,b[2]);
xor2g x4(t[3],m,b[3]);
xor2g x5(t[4],m,b[4]);
xor2g x6(t[5],m,b[5]);
xor2g x7(t[6],m,b[6]);
xor2g x8(t[7],m,b[7]);
fa x9(s[0],c[0],a[0],t[0],m);
fa x10(s[1],c[1],a[1],t[1],c[0]);
fa x11(s[2],c[2],a[2],t[2],c[1]);
fa x12(s[3],c[3],a[3],t[3],c[2]);
fa x13(s[4],c[4],a[4],t[4],c[3]);
fa x14(s[5],c[5],a[5],t[5],c[4]);
fa x15(s[6],c[6],a[6],t[6],c[5]);
fa x16(s[7],cout,a[7],t[7],c[6]);
endmodue
PARALLEL ADDER
module adder8 (a, b, cin, sum, cout);
input [7:0] a;
EC-6612 VLSI DESIGN LAB – RECORD 21
input [7:0] b;
inputcin;
outputcout;
wire [6:0] c
endmodule.
RESULT:
Thus the verilog code for half adder, full adder and parallel adder has been
simulated and verified successfully
MULTIPLIER OUTPUT:
Date:
AIM:
To implement 4 bit multiplier using Verilog HDL.
APPARATUS REQUIRED:
• PC with Windows XP.
• XILINX, ModelSim software.
PROCEDURE:
Program:
Multiplier(Dataflow)
module mul4(a, b, result);
input [3:0] a;
input [3:0] b;
output [7:0] result;
wire [7:0] result;
assign result = a * b;
endmodule
module HA(sout,cout,a,b);
output sout,cout;
input a,b;
assign sout=a^b;
assign cout=(a&b);
endmodule
module FA(sout,cout,a,b,cin);
output sout,cout;
input a,b,cin;
assign sout=(a^b^cin);
assign cout=((a&b)|(a&cin)|(b&cin));
endmodule
module multiply4bits(product,inp1,inp2);
output [7:0]product;
input [3:0]inp1;
input [3:0]inp2;
assign product[0]=(inp1[0]&inp2[0]);
wire x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17;
HA HA1(product[1],x1,(inp1[1]&inp2[0]),(inp1[0]&inp2[1]));
FA FA1(x2,x3,inp1[1]&inp2[1],(inp1[0]&inp2[2]),x1);
FA FA2(x4,x5,(inp1[1]&inp2[2]),(inp1[0]&inp2[3]),x3);
HA HA2(x6,x7,(inp1[1]&inp2[3]),x5);
HA HA3(product[2],x15,x2,(inp1[2]&inp2[0]));
FA FA5(x14,x16,x4,(inp1[2]&inp2[1]),x15);
FA FA4(x13,x17,x6,(inp1[2]&inp2[2]),x16);
FA FA3(x9,x8,x7,(inp1[2]&inp2[3]),x17);
HA HA4(product[3],x12,x14,(inp1[3]&inp2[0]));
FA FA8(product[4],x11,x13,(inp1[3]&inp2[1]),x12);
FA FA7(product[5],x10,x9,(inp1[3]&inp2[2]),x11);
FA FA6(product[6],product[7],x8,(inp1[3]&inp2[3]),x10);
endmodule
RESULT:
Thus the verilog code for 4 bit multiplier has been simulated and verified.
THEORY:
Level model of the circuit described in VHDL, Verilog, or mixed language designs.
The netlist files contain both logical design data and constraints.
PROCEDURE:
1. Start the Xilinx ISE by using start Program files Xilinx ISE (8.1i) project navigator
2. File New Project
3. Enter the Project Name and location then click next
4. Select the Device and other category and click next twice and finish
5. Click on the symbol of FPGA device and then right click click on new source
6. Select the Verilog Module and give the file name click next and define ports click next
and finish
7. Writing the behavioral Verilog Code in Verilog Editor.
8. Run the Check syntax Process window synthesize double click check syntax and
remove errors, if present, with proper syntax & coding.
9. Synthesis your design, from the source window select, Synthesis/ implementation from the
window Now double click the Synthesis –XST
10. After the HDL synthesis phase of the synthesis process, you can display a schematic
representation of your synthesized source file. This schematic shows a representation of the
pre-optimized design in terms of generic symbols, such as adders, multipliers, counters, AND
gates, and OR gates double click View RTL Schematic
11. Double click the schematic to internal view
12. Double click outside the schematic to move one-level back
13. This schematic shows a representation of the design in terms of logic elements optimized to
the target device. For example, in terms of LUTs(Look Up Table), carry logic, I/O buffers, and
other technology-specific components
Double click View Technology Schematic
THEORY:
• Back annotation is the translation of a routed or fitted design to a timing simulation netlist.
• To define the behavior of the FPGA, a hardware description language (HDL) or a schematic
design methods are used. Common HDLs are VHDL and Verilog. Then, using an electronic design
automation (EDA) tool, a technology-mapped netlist is generated.
• The netlist can then be fitted to the actual FPGA architecture using a process called place-and-
route, usually performed by the FPGA vendor’s proprietary place-and-route software.
• The user will validate the map, place and route results via timing analysis, simulation, and other
verification methodologies. Once the design and validation process is complete, the binary file generated is
used to (re)configure the FPGA.
• In an attempt to reduce the complexity of designing in HDLs, which have been compared to the
equivalent of assembly
• In a typical design flow, an FPGA application developer will simulate the design at multiple
stages throughout the design process.
• Initially the RTL description in VHDL or Verilog is simulated by creating test benches to
simulate the system and observe results.
• Then, after the synthesis engine has mapped the design to a netlist, the netlist is translated to a
gate level description where simulation is repeated to confirm the synthesis proceeded without errors.
• Finally the design is laid out in the FPGA at which point propagation delays can be added and the
simulation run again with these values back-annotated onto the netlist.
• Place & Route, the process of optimization of logic cells for effective utilization of FPGA area
and the speed of operation, is used to modify and infer the following:
1) Re-assignment of Pins
2) Re-location of Slices
PROCEDURE:
1. Start the Xilinx ISE by using startProgram files Xilinx ISE (8.1i) project navigator
2. File New Project3. Enter the Project Name and location then click next
4. Select the Device and other category and click next twice and finish
5. Click on the symbol of FPGA device and then right click click on new source
6. Select the Verilog Module and give the file name click next and define ports click next and
finish
check syntax
9. Synthesis your design, from the source window select, synthesis/implementation from the
window Now double click the
Synthesis -XST
10. After Synthesis you assign the Pin Value for your design so, double click the Assign
Package Pins
11. Enter the Pin value for your input and output signals. if you want see your Pin assignment in
FPGA zoom in Architecture View or Package View
12. You see the Pins in FPGA. Save file as XST Default click ok and close the window
13. Design Implementation begins with the mapping or fitting of a logical design file to a specific
device and is complete when the physical design is successfully routed and a bit stream is generated.
Double Click Implementation Design
14. After implementation you see Design Summary, you get the all details
about your design. If you want edit the place and route double click
15. You see where your IOs are placed in FPGA. And zoom to view how Pins are placed in FPGA.
You can see where your pins are placed
16. Just double click View/Edit Routed Design to view interconnection wires and blocks
17. Click the pin to see where its placed in FPGA. And Zoom particular area
18. If you want to change the place of the design, click and trace to another slice.
19. Double click Back annotated Pin Location. Once back annotation is completed, constraint file
is generated.
AIM:
To simulate the synthesis for counters using verilog HDL.
APPARATUS REQUIRED:
PROCEDURE:
1. Start the Xilinx ISE by using start Program files Xilinx ISE (10.1) project
navigator
2. File New Project
3. Before enter the Project Name,check location where you can save then click next
4. Select the Device and other category and click next twice and finish.
5. Open Design summary and select synthesis.
Program:
COUNT2BIT
begin
if(updown)
begin
q <= q + 1'b1;
end
else
begin
q <= q - 1'b1;
end
end
end
endmodule
RIPPLE COUNTER:
RESULT:
Thus the Synthesis, P&R and post P&R, Static timing/ Critical path
simulation of counter was done successfully.
AIM:
To simulate the synthesis for statement using verilog HDL.
APPARATUS REQUIRED:
• PC with Windows XP.
• XILINX, ModelSim software.
PROCEDURE:
Program:
State Machine:
2'b01:
begin
if( inp ) state <= 2'b11;
else state <= 2'b10;
EC-6612 VLSI DESIGN LAB – RECORD 45
P&R REPORT:
Design Summary Report:
Number of External IOBs 4 out of 158 2%
Number of External Input IOBs 3
Number of External Input IBUFs 3
Number of External Output IOBs 1
Number of External Output IOBs 1
Number of External Bidir IOBs 0
Number of BUFGMUXs 1 out of 24 4%
Number of Slices 2 out of 4656 1%
Number of SLICEMs 0 out of 2328 0%
Overall effort level (-ol): Standard
Placer effort level (-pl): High
Placer cost table entry (-t): 1
Router effort level (-rl): Standard
Starting Placer
Phase 1.1
Phase 1.1 (Checksum:98969b) REAL time: 2 secs
Phase 2.7
Phase 2.7 (Checksum:1312cfe) REAL time: 2 secs
Phase 3.31
Phase 3.31 (Checksum:1c9c37d) REAL time: 2 secs
Phase 4.2.
Phase 4.2 (Checksum:26259fc) REAL time: 2 secs
Phase 5.30
Phase 5.30 (Checksum:2faf07b) REAL time: 2 secs
Phase 6.3
Phase 6.3 (Checksum:39386fa) REAL time: 2 secs
Phase 7.5
Phase 7.5 (Checksum:42c1d79) REAL time: 2 secs
Phase 8.8
Phase 8.8 (Checksum:98cfaf) REAL time: 5 secs
Phase 9.5
Phase 9.5 (Checksum:55d4a77) REAL time: 5 secs
Phase 10.18
Phase 10.18 (Checksum:5f5e0f6) REAL time: 5 secs
Phase 11.5
Phase 11.5 (Checksum:68e7775) REAL time: 5 secs
REAL time consumed by placer: 5 secs
CPU time consumed by placer: 4 secs
EC-6612 VLSI DESIGN LAB – RECORD 46
end
2'b10:
begin
if( inp ) state <= 2'b01;
else state <= 2'b11;
end
2'b11:
begin
if( inp ) state <= 2'b01;
else state <= 2'b10;
end
endcase
end
end
end
endmodule
RESULT:
Thus the Synthesis, P&R and post P&R simulation of state machine circuits
and Critical paths/static timing analysis was done successfully
AIM:
To simulate the synthesis for half adder and full adder using Verilog HDL.
APPARATUS REQUIRED:
DATAFLOW MODELLING
module ha (a,b,s,c);
input a,b;
output s,c;
assign s = a^b;
assign c =a&b;
endmodule
BEHAVIOURAL MODELLING
module ha(a,b,s,c);
input a,b;
output s,c;
reg s,c;
always@(a or b)
begin
s =a^b;
c =a&b;
end
endmodule
DATAFLOW MODELLING:
module fa(a,b,cin,sum,cout);
input a,b,cin;
output sum,cout;
assign sum = a^b^cin;
assign cout =(a&b)|(b&cin)|(cin&a);
endmodule
BEHAVIOURAL MODELLING:
module fa(a,b,cin,sum,cout);
input a,b,cin;
output sum,cout;
reg sum,cout;
always @(a or b or cin)
begin
sum =a^b^cin;
cout =(a&b)|(b&cin)|(cin&a);
end
endmodule
STRUCTURAL MODELLING:
Pad to Pad
---------------+---------------+---------+
Source Pad |Destination Pad| Delay |
---------------+---------------+---------+
a |c | 5.759|
a |s | 5.984|
b |c | 5.841|
b |s | 6.026|
---------------+---------------+---------+
Analysis completed Mon Apr 11 15:37:52 2016
Peak Memory Usage: 95
RESULT:
Thus the Synthesis, P&R and post P&R simulation of adder and Critical
paths/static timing analysis was done successful.
AIM:
To simulate the synthesis for multipliers using verilog HDL.
APPARATUS REQUIRED:
• PC with Windows XP.
• XILINX, ModelSim software.
PROCEDURE:
Program:
Multiplier:
module mul4(a, b, result);
input [3:0] a;
input [3:0] b;
output [7:0] result;
wire [7:0] result;
assign result = a * b;
endmodule
Pad to Pad
---------------+---------------+---------+
Source Pad |Destination Pad| Delay |
---------------+---------------+---------+
a<0> |r<0> | 10.236|
a<0> |r<1> | 9.878|
a<0> |r<2> | 10.066|
a<0> |r<3> | 9.844|
a<0> |r<4> | 10.205|
a<0> |r<5> | 9.859|
a<0> |r<6> | 10.346|
a<0> |r<7> | 10.457|
a<1> |r<1> | 10.076|
a<1> |r<2> | 10.264|
a<1> |r<3> | 10.042|
a<1> |r<4> | 10.403|
a<1> |r<5> | 10.057|
a<1> |r<6> | 10.544|
a<1> |r<7> | 10.655|
a<2> |r<2> | 9.186|
a<2> |r<3> | 8.964|
a<2> |r<4> | 9.325|
a<2> |r<5> | 8.979|
a<2> |r<6> | 9.466|
a<2> |r<7> | 9.577|
a<3> |r<3> | 9.656|
a<3> |r<4> | 10.017|
a<3> |r<5> | 9.671|
a<3> |r<6> | 10.158|
a<3> |r<7> | 10.269|
b<0> |r<0> | 9.453|
b<0> |r<1> | 9.095|
b<0> |r<2> | 9.283|
b<0> |r<3> | 9.061|
b<0> |r<4> | 9.422|
b<0> |r<5> | 9.076|
b<0> |r<6> | 9.563|
b<0> |r<7> | 9.674|
b<1> |r<1> | 9.825|
b<1> |r<2> | 10.013|
EC-6612 VLSI DESIGN LAB – RECORD 66
EC-6612 VLSI DESIGN LAB – RECORD 67
b<1> |r<3> | 9.791|
b<1> |r<4> | 10.152|
b<1> |r<5> | 9.806|
b<1> |r<6> | 10.293|
b<1> |r<7> | 10.404|
b<2> |r<2> | 10.052|
b<2> |r<3> | 9.830|
b<2> |r<4> | 10.191|
b<2> |r<5> | 9.845|
b<2> |r<6> | 10.332|
b<2> |r<7> | 10.443|
b<3> |r<3> | 10.094|
b<3> |r<4> | 10.455|
b<3> |r<5> | 10.109|
b<3> |r<6> | 10.596|
b<3> |r<7> | 10.707|
---------------+---------------+---------+
RESULT:
Thus the Synthesis, P&R and post P&R simulation of multiplier and Critical
paths/static timing analysis was done successfully.
Date :
AIM:
To implement clock generation using FPGAs for counters.
APPARATUS REQUIRED:
PROCEDURE:
1. Start the Xilinx ISE by using start Program files Xilinx ISE (10.1) project
navigator
2. File New Project
3. Before enter the Project Name,check location where you can save then click next
4. Select the Device and other category and click next twice and finish.
5. Click on the symbol of FPGA device and then right click click on
BACK ANNOTATION
24. Click OK to program the device. When programming is complete, the Program
Succeeded message is displayed.
Program:
COUNT2BIT
out=out+1;
endmodule
UP/DOWN COUNTER:
BOUNDRY SCAN:
RESULT:
Thus the clock generation of counters using FPGAs and hardware tested for
blocks was verified successfully.
Date:
AIM:
To implement state machine Verilog HDL.
APPARATUS REQUIRED:
• PC with Windows XP.
• XILINX, ModelSim software.
Program:
State Machine:
AIM:
To implement half adder and full adder using Verilog HDL.
APPARATUS REQUIRED:
DATAFLOW MODELLING
module ha (a,b,s,c);
input a,b;
output s,c;
assign s = a^b;
assign c =a&b;
endmodule
BEHAVIOURAL MODELLING
module ha(a,b,s,c);
input a,b;
output s,c;
reg s,c;
always@(a or b)
begin
s =a^b;
c =a&b;
end
endmodule
STRUCTURAL MODELLING
DATAFLOW MODELLING:
module fa(a,b,cin,sum,cout);
input a,b,cin;
output sum,cout;
assign sum = a^b^cin;
assign cout =(a&b)|(b&cin)|(cin&a);
endmodule
BEHAVIOURAL MODELLING:
module fa(a,b,cin,sum,cout);
input a,b,cin;
output sum,cout;
reg sum,cout;
always @(a or b or cin)
begin
sum =a^b^cin;
cout =(a&b)|(b&cin)|(cin&a);
end
endmodule
STRUCTURAL MODELLING:
Date:
AIM:
To implement 4 bit multiplier using Verilog HDL.
APPARATUS REQUIRED:
Hardware and software requirement:
➢ Xilinx (Alliance)/Xilinx ISE 10.1 software
➢ Personal Computer
➢ Spartan3E FPGA Trainer Kit.
➢ RS232 cable.
➢ 5V DC power cable.
Program:
Multiplier:
module mul4(a, b, result);
input [3:0] a;
input [3:0] b;
output [7:0] result;
wire [7:0] result;
assign result = a * b;
endmodule
DIFFERENTIAL AMPLIFIER:
SCHEMATIC DIAGRAM:
AIM
To design and simulate the differential amplifier circuit and measure gain,ICMR,CMRR.
SOFTWARE USED
THEORY:
Differential amplifier:
Where Vin+ and Vin- are the input voltages and Ac is the differential gain. In practice,
however, the gain is not quite equal for the two inputs. This means that if Vin+ and Vin- are
equal, the output will not be zero, as it would be in the ideal case. A more realistic expression for
the output of a differential amplifier thus includes a second term.
Ac is called the common-mode gain of the amplifier. As differential amplifiers are often
used when it is desired to null out noise or bias-voltages that appear at both inputs, a low
common-mode gain is usually considered good.
The common-mode rejection ratio, usually defined as the ratio between differential-mode
gain and common-mode gain, indicates the ability of the amplifier to accurately cancel voltages
that are common to both inputs. Common-mode rejection ratio (CMRR):
DIFFERENTIAL AMPLIFIER:
SCHEMATIC DIAGRAM:
MESFETs - 0 Diodes - 0
Capacitors - 0 Resistors - 0
Inductors - 0 Mutual inductors - 0
Transmission lines - 0 Coupled transmission lines - 0
Voltage sources - 3 Current sources - 1
VCVS - 0 VCCS - 0
CCVS - 0 CCCS - 0
V-control switch - 0 I-control switch - 0
Macro devices - 0 External C model instances - 0
Subcircuits - 0 Subcircuit instances - 0
Independent nodes - 7 Boundary nodes - 4
Total nodes - 11
SIMULATION STATISTICS:
* DC operating point
* Total DC operating points =1
* Total Newton iterations = 35
* Total Current evaluations = 180
* Transient analysis
STICK DIAGRAM
Aim:
To draw the layout of a CMOS inverter and Differential amplifier using L-Edit of Tanner EDA
tools.
SOFTWARE USED
DESCRIPTION
CMOS INVERTER
The NMOS transistor and the PMOS transistor form a typical complementary MOS
(CMOS) device. When a low voltage (0 V) is applied at the input, the top transistor (P-type) is
conducting (switch closed) while the bottom transistor behaves like an open circuit. Therefore, the
supply voltage (5 V) appears at the output. Conversely, when a high voltage (5 V) is applied at the
input, the bottom transistor (N-type) is conducting (switch closed) while the top transistor behaves
like an open circuit. Hence, the output voltage is low (0 V).
PROCEDURE
STICK DIAGRAM
EXECUTION SUMMARY
CMOS INVERTER:
Analog Simulation
Analog Simulation
Self intersections 0
Wire Join/End styles 0
RESULTS SUMMARY
MOS LAYOUT
We use MICROWIND2 to draw the MOS layout and simulate its behavior. Go to the
directory in which the software has been copied (By default MICROWIND2). Double-click on the
MicroWind2 icon. The MICROWIND2 display window includes four main windows: the main
menu, the layout display window,the icon menu and the layer palette. The layout window features
a grid, scaled in lambda units. The lambda unit is fixed to half of the minimum available
lithography of the technology. The default technology is a CMOS 6-metal layers 0.25μm
technology, consequently lambda is 0.125 μm.
RESULT:
Thus the Layout design of a CMOS inverter and differential amplifier has been drawn and
checked for DRC using L-Edit of Tanner EDA Tools.
EC-6612 VLSI DESIGN LAB – RECORD 101
DIFFERENTIAL AMPLIFER:
Aim:
To identify the power consumption of Differential amplifier using L-Edit of Tanner EDA tools.
SOFTWARE USED
PROCEDURE
Metal 2 0 0
Metal 2-Tight 0 0
Metal 3 0 0
N Select 2 2
N Well 1 1
Overglass 0 0
P Select 2 2
Pad Comment 0 0
Poly 3 3
Poly Contact 0 0
Resistor ID 0 0
Via 1 0 0
Via 2 0 0
AIM
To simulate the verilog coding for D,,T,JK and SR flip flops.
APPARATUS REQUIRED:
• PC with Windows XP.
• XILINX, ModelSim software.
PROCEDURE:
Program:
D Flip-Flop
JK Flip-Flop
module JKFF(Clock, Reset, j, k, q);
input Clock;
input Reset;
input j;
input k;
output q;
reg q;
always@(posedge Clock, negedge Reset) if(~Reset)
q=0;
else
begin
case({j,k})
2'b00: q=q;
2'b01: q=0;
2'b10: q=1;
2'b11: q=~q;
T- Flip-Flop
SR-Flip-Flop
module sr_flip_flop ( s ,r ,clk ,reset ,q ,qb ); wire clk ; else if (s==1 && r==1) begin
output q ; input reset ; wire reset; qb <= 1'bZ;
reg q ; always @ (posedge (clk)) end
begin end
output qb ; if (reset) begin end
reg qb ; q <= 0; qb <= 1; endmodule
input s ; end
wire s ; else begin
input r ; if (s!=r) begin
wire r ; q <= s;
input clk ; qb <= r;
wire reset ; end