Академический Документы
Профессиональный Документы
Культура Документы
Page 1
1. Design Entry and simulation of combinational logic circuits (8 bit adders, 4 bit multipliers,
address decoders, multiplexers), Test bench creation, functional verification, and concepts of
concurrent and sequential execution to be highlighted.
2. Design Entry and simulation of sequential logic circuits (counters, PRBS generators,
accumulators). Test bench creation, functional verification, and concepts of concurrent and
sequential execution to be highlighted.
3. Synthesis, P&R and Post P&R simulation for all the blocks/codes developed in Expt. No. 1
and No. 2 given above. Concepts of FPGA floor plan, critical path, design gate count, I/O
configuration and pin assignment to be taught in this experiment.
4. Generation of configuration/fuse files for all the blocks/codes developed as part of Expt.1.
and Expt. 2. FPGA devices must be configured and hardware tested for the blocks/codes
developed as part of Expt. 1. and Expt. 2. The correctness of the inputs and outputs for each
of the blocks must be demonstrated atleast on oscilloscopes (logic analyzer preferred).
5. Schematic Entry and SPICE simulation of MOS differential amplifier. Determination of
gain, bandwidth, output impedance and CMRR.
6. Layout of a simple CMOS inverter, parasitic extraction and simulation.
7. Design of a 10 bit number controlled oscillator using standard cell approach, simulation
followed by study of synthesis reports.
8. Automatic layout generation followed by post layout extraction and simulation of the
circuit studied in Expt. No.7.
Note 1. For Expt. 1 To 4 can be carried out using Altera (Quartus) / Xilinx (Alliance)/
ACTEL (Libero) tools.
Note 2. For expt. 5-8 introduce the student to basics of IC design. These have to be
carried out using atleast 0.5u CMOS technology libraries. The S/W tools needed
Cadence / MAGMA / Tanner.
Page 2
Expt. No:
Date:
STUDY OF VERILOG HDL AND SPARTAN-3E FPGA BOARD
AIM:
To study Verilog HDL, Spartan-3E FPGA board and the related software.
SOFTWARE USED:
Xilinx 14.3
DEVICE USED:
Spartan-3E FPGA 250S
THEORY:
INTRODUCTION TO VERILOG HDL:
Verilog HDL is one of the Hardware Description Languages (HDL) used to describe a
digital system. VHDL is the other one. Verilog HDL allows a hardware designer to describe
designs at a high level of abstraction such as an the architectural or behavioral level as a set
of modules. Modules can either be specified behaviorally or structurally (for a combination of
two). A behavioral specification defines the behavior of a digital system (module) using
traditional programming language constructs. E.g. if assignment statements. A structural
specification expresses the behavior of a digital system (module) as a hierarchical
interconnection of sub modules. At the bottom of the hierarchy the components must be
primitives or specified behaviorally. Verilog provides the following gate level primitives:
And/nand
or/nor
xor/xnor
buf/not
bufif0/notif0
bufif1/notif1
logical AND/NAND
logical OR/NOR
logical XOR/XNOR
buffer/inverter
tristate with low enable
tristate with high enable
Page 3
OPERATORS:
Bitwise operators:
Arithmetic:
Unary reduction:
Logical:
Equality:
Identity:
Relational:
Logical shift :
Conditional:
Concatenate:
Replicate:
DESIGN FLOW:
Page 4
DESIGN ENTRY: The designed circuit is specified either by means of a schematic diagram
or by using a hardware description language, such as Verilog or VHDL.
SYNTHESIS: The entered design is synthesized into a circuit that consists of the logic
elements (LEs) provided in the FPGA board.
FUNCTIONAL SIMULATION: The synthesized circuit is tested to verify its functional
correctness. This simulation does not take into account any timing issues. A test bench is
HDL code that allows you to provide a repeatable set of stimuli with clock and input dat for
error checking, file input and output and conditional testing.
FITTING: The CAD filter told determines the placement of LEs defined in the netlist into
the LEs in the actual FPGA chip. It also chooses routing wires in the chip to make the
required connections between specific LEs.
TIMING ANALYSIS: Propagation delays along the various paths in the fitted circuit are
analyzed to provide an indication of the expected performance of the circuit.
TIMING SIMULATION: The fitted circuit is tested to verify both its functional correctness
and timing.
PROGRAMMING AND CONFIGURATION: The designed circuit is implemented in a
physical FPGA chip by programming the configuration switches that configure the LEs and
established the required wiring connections.
PROCEDURE OF XILINX 14.3 SOFTWARE:
1. Start Xilinx ISE 13.1, click on CREATE A NEW PROJECT and then click on
Next.
2. Select youre working directory, give the name of the project, then click on NEXT.
3. Select the device family (Spartan 3E), Device (XC3S250E), package (PQ208), Speed
grade (4), Synthesis tool (XST [VHDL/VERILOG]), simulator (ISim) and preferred
language (Verilog) from the available device list, and then click NEXT and click
FINISH.
4. Write the HDL code and be careful to give the entity name the same as project name.
After writing the code save the file and click on Synthesis XST.
5. If the HDL code is error free a green check mark will be shown on the synthesis XST.
6. Select simulation then double click on Simulate Behavioral Model (here we can
change the level of abstraction. i.e. structural/behavioral/dataflow/switch level)
7. If there is zero error a new window will be shown. Apply the desired input as 1s and
0s and check whether the outputs are correct or not in the output waveform.
8. Expand the user constraints n the processes for source window and double click
Assign package pins (with ISE 13.1 web pack is called I/O floor plan presynthesis).
This is where you tell Xilinx which pins on Spartan 3E will be used.
9. In the Design object list I/O pins window type the pin numbers in the following pin
assignments under the heading LOC. This action will create a .UCF file for the
top_level_struct file and will contain the pin assignments for the Spartan-3E.
10. Make sure that the top_level_struct file is selected in the sources window.
11. Expand the Synthesis-XST in the Processes window and then double click it. This
action will check the syntax of the source code for top_level_struct and convert the
Page 5
source code into a netlist of gates. A synthesis report will also be produced. When the
synthesis is finished, green check marks should be displayed indicating that
top_level_struct has compiled successfully.
12. Expand the Implement design process and double click on it. This is where the
netlist is translated, mapped, placed and routed for the logic circuits of the Spartan-3E
FPGA. After this process has been run, green check mark should be displayed.
13. Expand the Generate Programming file process and double click it. This process
creates
A bit file that is used to program the Spartan-3E chip. Again, after this process is
finished, green check mark should be shown.
14. Expand the Implement design and double click on Generate programming file.
15. Right click on the depiction of the Spartan-3E chip and select program. If the
download was successful, the message Program succeeded will be displayed.
RESULT:
The verilog modelling methodology and Spartan 3E FPGA board were studied.
Page 6
Expt. No:
Date:
AIM:
To design and implement the following combinational circuits using Verilog HDL and
testbench circuits.
1. 8 bit adders,
2. 4 bit multipliers,
3. Address decoders,
4. Multiplexers
APPARATUS REQUIRED:
THEORY:
8-Bit Addition (Ripple Carry Adder)
The n-bit adder built from n one bit full adders is known as ripple carry adder
because of the carry is computed. The addition is not complete until n-1th adder has
computed its Sn-1 output; that results depends upon ci input, n and so on down the line, so
the critical delay path goes from the 0-bit inputs up through cis to the n-1 bit.(We can find
the critical path through the n-bit adder without knowing the exact logic in the full adder
because the delay through the n-bit adder without knowing the exact logic in the full adder
because the delay through the n-bit carry chain is so much longer than the delay from a and b
to s). The ripple-carry adder is area efficient and easy to design but it is when n is large. It can
also be called as cascaded full adder.
4-Bit Multiplier
Binary multiplication can be accomplished by several approaches. The approach
presented here is realized entirely with combinational circuits. Such a circuit is called an
array multiplier. The term array is used to describe the multiplier because the multiplier is
organized as an array structure. Each row, called a partial product, is formed by a bit-by-bit
multiplication of each operand.
For example, a partial product is formed when each bit of operand a is multiplied by
b0, resulting in a3b0, a2b0,a1b0, a0b0. The binary multiplication table is identical to the
AND truth table.
Each product bit {o(x)}, is formed by adding partial product columns. The product
equations, including the carry-in {c(x)}, from column c(x-1), are (the plus sign indicates
addition not OR). Each product term, p(x), is formed by AND gates and collection of product
terms needed for the multiplier. By adding appropriate p term outputs, the multiplier output
equations are realized, as shown in figure.
Page 7
Address Decoder
A decoder is a combinational circuit that converts binary information from n input
lines to a maximum of 2n unique output lines. It performs the reverse operation of the
encoder. If the n-bit decoded information has unused or dont-care combinations, the decoder
output will have fewer than 2n outputs. The decoders are represented as n-to-m line decoders,
where m 2n. Their purpose is to generate the 2n (or fewer) minterms of n input variables.
The name decoder is also used in conjunction with some code converters such as BCD-toseven-segment decoders. Most, if not all, IC decoders include one or more enable inputs to
control the circuit operation. A decoder with an enable input can function as a de-multiplexer
4x1 Multiplexer
A digital multiplexer is a combinational circuit that selects binary information from
one of many input lines and directs it to a single output line. Multiplexing means transmitting
a large number of information units over a smaller number of channels or lines. The selection
of a particular input line is controlled by a set of selection lines. Normally, there are 2n input
lines and n selection lines whose bit combinations determine which input is selected. A
multiplexer is also called a data selector, since it selects one of many inputs and steers the
binary information to the output lines. Multiplexer ICs may have an enable input to control
the operation of the unit.
The size of the multiplexer is specified by the number 2n of its input lines and the
single output line. In general, a 2n to 1 line multiplexer is constructed from an n to 2n
decoder by adding to it 2n input lines, one to each AND gate. The outputs of the AND gates
are applied to a single OR gate to provide the 1 line output.
PROCEDURE:
1. Start Xilinx ISE 14.3, click on CREATE A NEW PROJECT and then click on
Next.
2. Select your working directory, give the name of the project, then click on NEXT.
3. Select the device family (Spartan 3E), Device (XC3S250E), package (PQ208), Speed
grade (4), Synthesis tool (XST [VHDL/VERILOG]), simulator (ISim) and preferred
language (Verilog) from the available device list, and then click NEXT and click
FINISH.
4. Write the HDL code and be careful to give the entity name the same as project name.
5. In the design window change into simulation and double click behavioral check
syntax.
6. If the HDL code is error free a green check mark will be shown on the behavioral
check syntax.
7. Select simulation then double click on Simulate Behavioral Model (here we can
change the level of abstraction. i.e. structural/behavioral/dataflow/switch level)
8. If there is zero error a new window will be shown. Apply the desired input as 1s and
0s and check whether the outputs are correct or not in the output waveform.
9. Create a new verilog test fixture and give the various input constraints and save the
file and check if any errors are present.
10. Simulate the testbench and analyze the output waveform.
Page 8
8-Bit Addition (Ripple Carry Adder)
Logic Diagram:
MULTIPLEXER
Truth Table
Select lines
Output
Logic Diagram
sel1
sel0
i0
i1
i2
i3
Page 9
4-Bit Multiplier
4 X 4 Array Multiplier:
a3b3
a3
a2
a1
b3
b2
b1
a3b0 a2b0 a1b0
a3b1 a2b1 a1b1 a0b1
a3b2 a2b2 a1b2 a0b2
a2b3 a1b3 a0b3
o7
o6
o5
a0b0 = p0
a1b0 = p1
a0b1 = p2
a2b0 = p3
a1b1 = p4
a0b2 = p5
a3b0 = p6
a2b1 = p7
o4
o3
o2
a0
b0
a0b0
o1
a1b2 = p8
a0b3 = p9
a3b1 = p10
a2b2 = p11
a1b3 = p12
a3b2 = p13
a2b3 = p14
a3b3 = p15
Logic Diagram:
P15
P14 P13
P11,P10
FA
FA
P4 P3
P2 P1
HA
HA
HA
FA
FA
P7 P6
P0
P8
P12
FA
P9
FA
O7
O6
FA
O5
FA
O4
HA
O3
O2
O1
O0
Page 10
Address Decoder
Truth Table:
INPUTS
DIN
X
Y
1
0
0
Logic Diagram
OUTPUTS
D0 D1 D2 D3
1
0
0
0
Page 11
Programs:
Addition using Dataflow modeling
module addition8bit(a,b,oup);
input [7:0] a;
input [7:0] b;
output [8:0] oup;
assign oup = a + b;
endmodule
Page 12
Page 13
input [1:0]sel;
output y;
wire [3:0]w;
and g0(w[0],d[2],~sel[0],~sel[1]);
and g1(w[1],d[1],sel[0],~sel[1]);
and g2(w[2],d[2],~sel[0],sel[1]);
and g3(w[3],d[3],sel[0],sel[1]);
or g4(y,w[0],w[1],w[2],w[3]);
endmodule
4x1 Multiplexer Dataflow Modelling
module mux_4X1_dataflow(d,sel,y);
input [3:0]d;
input [1:0]sel;
output y;
assign y = (d[0] & ~sel[0]& ~sel[1])|(d[1] & sel[0] & ~sel[1])| (d[2] & ~sel[0] & sel[1])|
(d[3] & sel[0] & sel[1]);
endmodule
4x1 Behaviour (CASE) Modelling
module mux_4X1_behav_case(d,sel,y);
input [3:0]d;
input [1:0]sel;
output y;
reg y;
always @(d or sel)
begin
case (sel)
2'b00:y=d[0];
2'b01:y=d[1];
2'b10:y=d[2];
2'b11:y=d[3];
default:y=1'bx;
endcase
end
endmodule
RESULT:
The combinational circuits were designed and, HDL codes were written and verified using
Testbench circuits.
Page 14
Expt No:
Date:
THEORY:
Counters
Synchronous counters are distinguished from asynchronous counters in that clock
pulses are applied to the CP inputs of all flip-flops. The common pulse triggers all the flipflops simultaneously, rather than one at a time in succession as in asynchronous counter. The
decision whether a flip-flop is to be complemented or not is determined from the values of
the J and K inputs at the time of the pulse. If J = K = 0, the flip-flop remains unchanged. If J
= K = 1, the flip-flop complements. In a synchronous binary ripple counter, the flip-flop in
the lowest-order position is complemented with very pulse. This means that its J and K
inputs must be maintained at logic-1. A flip-flop in any other position is complemented with
a pulse provided all the bits in the lower-order positions are equal to 1, because the lowerorder bits (when all 1s) will change to 0s on the next count pulse. The binary count dictates
the next higher-order bit is complemented. Synchronous binary counters have a regular
pattern and can easily be constructed with complementing flip-flops ( J K or T Type) and
gates.
PRBS Generator
PRBS generator generates pseudo random binary sequence based on the concept
of linear feedback shift register.It is pseudo because it is deterministic and after n
elements it starts to repeat itself, unlike real random sequences.
Random numbers for polynomial equations are generated by using the shift register
circuit. The random number generator is nothing but the Linear Feedback Shift Register
(LFSR). The shift registers are very helpful and versatile modules that facilitate the design of
many sequential circuits whose design may otherwise appear very complex. In its simplest
form, a shift register consists of a series of flip-flops having identical interconnection
between two adjacent flip-flops. Two such registers are shift right registers and the shift left
registers. In the shift right register, the bits stored in the flip-flops shift to the right when shift
Page 15
pulse is active. Like that, for a shift left register, the bits stored in the flip-flops shift left when
shift pulse is active. In the shift registers, specific patterns are shifted through the register.
There are applications where instead of specific patterns, random patterns are more
important.
For a 4-bit PRBS generator, LFSR consist of 4-registers connected together as a shift
register. Here, we used D flipflop as a register. The input to the first register comes from the
XOR of third and fourth output bits of the register. The inputs fed to the XOR are called
the tap sequence and are often specified with characteristic polynomial. On reset the
register must be initialized to a non zero value(all 1s).The output sequences through
all 2^n-1 combinations when clock signal is given. Obviously, its possible to get a longer msequence using more stages to the shift register. The formula connecting these is: m=2^n1.Where m is the length of the m-sequence and n is the number of shift register
stages. The pseudo-random sequences are handy for built-in-test and bit-error-rate
testing
in communication links. They are also used in many spread spectrum
communications systems such as GPS and CDMA and encoding and decoding the error
control codes. LFSRs used as a generators of pseudorandom sequences have proved
externally useful in the area of testing of VLSI chips.
PROCEDURE:
1. Start Xilinx ISE 14.3, click on CREATE A NEW PROJECT and then click on
Next.
2. Select your working directory, give the name of the project, then click on NEXT.
3. Select the device family (Spartan 3E), Device (XC3S250E), package (PQ208), Speed
grade (4), Synthesis tool (XST [VHDL/VERILOG]), simulator (ISim) and preferred
language (Verilog) from the available device list, and then click NEXT and click
FINISH.
4. Write the HDL code and be careful to give the entity name the same as project name.
5. In the design window change into simulation and double click behavioral check
syntax.
6. If the HDL code is error free a green check mark will be shown on the behavioral
check syntax.
7. Select simulation then double click on Simulate Behavioral Model (here we can
change the level of abstraction. i.e. structural/behavioral/dataflow/switch level)
8. If there is zero error a new window will be shown. Apply the desired input as 1s and
0s and check whether the outputs are correct or not in the output waveform.
9. Create a new verilog test fixture and give the various input constraints and save the
file and check if any errors are present.
10. Simulate the testbench and analyze the output waveform.
Page 16
COUNTER
Logic Diagram:
PRBS GENERATOR
Logic Diagram:
Page 17
Page 18
Page 19
PRBS using Behavioral Level
module prbs(q,qb,clk,clr);
output [3:0] q,qb;
input clk,clr;
reg [3:0] tmp, tmpb;
always @(negedge clk or posedge clr)
begin
if(clr)
begin
tmp = 4'b1111;
tmpb = 4'b0000;
end
else
tmp = { tmp[2],tmp[1],tmp[0], tmp[3]^tmp[2]};
end
assign q=tmp;
assign qb=tmpb;
endmodule
Page 20
ACCUMULATOR
Accumulator using Behavioral Level
module accum (c, clr, d, q);
input c,clr;
input [3:0] d;
output [3:0] q;
reg [3:0] tmp;
always @(posedge c or posedge clr)
begin
if (clr)
tmp = 4'b0000;
else
tmp = tmp + d;
end
assign q= tmp;
endmodule
RESULT:
The Sequential circuits were designed and, HDL codes were written and verified using
Testbench circuits
Page 21
Expt No:
Date:
PROCEDURE:
1. Start Xilinx ISE 14.3, click on CREATE A NEW PROJECT and then click on
Next.
2. Select your working directory, give the name of the project, then click on NEXT.
3. Select the device family (Spartan 3E), Device (XC3S250E), package (PQ208), Speed
grade (4), Synthesis tool (XST [VHDL/VERILOG]), simulator (ISim) and preferred
language (Verilog) from the available device list, and then click NEXT and click
FINISH.
4. Write the HDL code and be careful to give the entity name the same as project name.
5. In the design window change into simulation and double click behavioral check
syntax.
6. If the HDL code is error free a green check mark will be shown on the behavioral
check syntax.
7. In the design window change into implementation and click on Synthesis XST. If
the HDL code is error free a green check mark will be shown on the Synthesize
XST.
8. Note down the Device Utilization Summary (Number of Slices , Number of LUTs and
Number of bonded IOBs)
9. Double Click the View RTL Schematic in the process window and RTL Schematic
view of your HDL code.
10. Double Click View Technology Schematic in the process window and View the
Technology Schematic view of your HDL code.
11. In User Constraints, double click I/O Pin Planning (PlanAhead) Post synthesize.
PlanAhead window is opened.
12. Give the input ports and output port 9n the PlanAhead tool and save the configuration
and close the PlanAhead window.
Page 22
13. Double Click the Implementation Design and green check mark will be shown on the
Implementation Icon.
14. In the Design window, change into Post Route Simulation and by double clicking
the Post-Place & Route Check Syntax and if code is error free a green check mark
will be shown on the Post-Place & Route Check Syntax.
15. Double Click Simulate Post-Place & Route Model and analyze the output waveform.
16. In the design window change into Implementation and process window under
implementation Place & Route, double click the View/Edit Routed Design (FPGA
Editor), now we can see the routed design of our circuit.
Page 23
Programs:
Combinational Circuits:
Ripple Carry Adder using Structural
Modelling
module ripplecarry_adder(a,b,oup);
input [7:0] a,b;
output [8:0] oup;
wire [6:0]c;
parameter cin=1'b0;
Sequential Circuits;
Counter Design using Structural
Page 24
Modelling
module counter_strutural(q,qbar,clk,reset);
output [3 : 0] q;
output [3 : 0] qbar;
input clk,reset;
wire [0 : 1] temp;
reg high;
initial
high = 1'b1;
jkff ff1 (q[0],qbar[0],high,high,clk,reset);
jkff ff2 (q[1],qbar[1],high,high,q[0],reset);
jkff ff3 (q[2],qbar[2],high,high,q[1],reset);
jkff ff4 (q[3],qbar[3],high,high,q[2],reset);
endmodule
Counter Design using Behavioral
Modelling
module counter(clk, reset,result); //,ena
input clk, reset;
output [3:0]result;
reg [3:0] result;
always @(negedge clk or posedge
reset)
begin
if (reset)
result = 0;
else
result = result + 1;
end
endmodule
Modelling
module jkff (q,qbar,j,k,clk,reset);
output q,qbar;
input j,k,clk,reset;
reg q,qbar;
always @ (negedge clk or reset)
if (~reset)
begin
q = 1'b0;
qbar = 1'b1;
end
else if (reset)
begin
if (j==0 && k ==0)
begin
q = q;
qbar = qbar;
end
else if ( j== 0 && k ==1)
begin
q = 1'b0;
qbar = 1'b1;
end
else if (j==1 && k == 0)
begin
q = 1'b1;
qbar = 1'b0;
end
else if (j ==1 && k ==1)
begin
q = ~q;
qbar = ~qbar;
end
else
begin
q = 1'bz;
qbar = 1'bz;
end
end
endmodule
Page 25
PRBS using Behavioral Level
module prbs(q,qb,clk,clr);
output [3:0] q,qb;
input clk,clr;
reg [3:0] tmp, tmpb;
always @(negedge clk or posedge clr)
begin
if(clr)
begin
tmp = 4'b1111;
tmpb = 4'b0000;
end
else
tmp = { tmp[2],tmp[1],tmp[0], tmp[3]^tmp[2]};
end
assign q=tmp;
assign qb=tmpb;
endmodule
RESULT:
The Combinational and Sequential circuits were designed and Verilog HDL codes were
written and verified. The verilog codes are Synthesized and Post Place and Route was done.
Page 26
Expt No:
Date:
HARDWARE IMPLEMENTATION OF COMBINATIONAL AND
SEQUENTIAL CIRCUITS
AIM:
To synthesize and post place and route simulations the following combinational and
sequential circuits using Verilog HDL
1. 8 bit adders,
2. 4 bit multipliers,
3. Address decoders,
4. Multiplexers
5. Counters,
6. PRBS generators,
7. Accumulators
APPARATUS REQUIRED:
PROCEDURE:
1. Start Xilinx ISE 14.3, click on CREATE A NEW PROJECT and then click on
Next.
2. Select your working directory, give the name of the project, then click on NEXT.
3. Select the device family (Spartan 3E), Device (XC3S250E), package (PQ208), Speed
grade (4), Synthesis tool (XST [VHDL/VERILOG]), simulator (ISim) and preferred
language (Verilog) from the available device list, and then click NEXT and click
FINISH.
4. Write the HDL code and be careful to give the entity name the same as project name.
5. In the design window change into simulation and double click behavioral check
syntax.
6. If the HDL code is error free a green check mark will be shown on the behavioral
check syntax.
7. In the design window change into implementation and click on Synthesis XST. If
the HDL code is error free a green check mark will be shown on the Synthesize
XST.
8. Note down the Device Utilization Summary (Number of Slices , Number of LUTs and
Number of bonded IOBs)
9. Double Click the View RTL Schematic in the process window and RTL Schematic
view of your HDL code.
10. Double Click View Technology Schematic in the process window and View the
Technology Schematic view of your HDL code.
11. In User Constraints, double click I/O Pin Planning (PlanAhead) Post synthesize.
PlanAhead window is opened.
Page 27
12. Give the input ports and output port 9n the PlanAhead tool and save the configuration
and close the PlanAhead window.
13. Double Click the Implementation Design and green check mark will be shown on the
Implementation Icon.
14. In the Design window, change into Post Route Simulation and by double clicking
the Post-Place & Route Check Syntax and if code is error free a green check mark
will be shown on the Post-Place & Route Check Syntax.
15. Double Click Simulate Post-Place & Route Model and analyze the output waveform.
16. In the design window change into Implementation and process window under
implementation Place & Route, double click the View/Edit Routed Design (FPGA
Editor), now we can see the routed design of our circuit.
17. A BIT file will be generate by double clicking the Generate Programming File.
18. The BIT file is loaded in the FPGA processor through JTAG or USB cable and the
output can be verified using the hardware kit.
19. MCS file is created and loaded into the PROM for verification.
20. By using ChipScope tool outputs waveforms in the PC can be controlled by Hardware
kit for Clock based circuits.
Procedure for ChipScope:
1. Click the project menu and then select new source.
2. Select Chip Scope Definition and Connection File and enter the file name, click Next
and click finish.
3. Double click your .cdc File.
4. Now your chip scope pro application will open, and then click next.
5. Mention the Number of Input Trigger Port and Mention the Trigger Width then Click
Next.
6. Click Modify Connections and Select your clk_BUFGP then click Make connections.
7. Mention your Trigger input then click Make connections, click OK.
8. Click Return to Project Navigator and then click YES.
9. Right click the Analyze Design Using Chip scope and Click Run.
10. Connect your board using JTAG or USB.
11. Open the Chip scope Pro Analyzer.
12. Click JTAG Chain and select Xilinx Parallel cable, Click Auto Detect Cable Type
then click OK.
13. Your IC has been detected then clicks OK. Now Select My Device and click
configure.
14. Click Select New File and Select your .bit file and click open.
15. Click Select New File Select your .cdc file and click open and then click OK.
16. Open the UNIT: 0 then Right click the Trigger setup and open the trigger setup.
17. Now the Trigger setup will be appear.
18. Right Click the Waveform and Open Waveform.
19. Right Click the Trigger setup => click trigger run mode =>click Repetitive, click
RUN.
20. You can change the input in your board the corresponding output is show in your PC.
Page 28
RESULT:
The Combinational and Sequential circuits were designed and Verilog HDL codes were
written and verified. The verilog codes are Synthesized and Post Place and Route was done.
Also the outputs were verified using the Spartan3E FPGA hardware kit.
Page 29
Expt No:
Date:
SCHEMATIC ENTRY AND SPICE SIMULATION OF
MOS DIFFERENTIAL AMPLIFIER
AIM:
To design and simulate the MOS differential amplifier and determine the bandwidth,
output impedance and CMRR cadence tool.
APPARATUS REQUIRED:
1. Personal Computer with Linux Operating System
2. Cadence tool
PROCEDURES:
Schematic Entry:
Creating a new library:
1. In the library manager, execute File - New library. The new library form appears.
2. In the new library form, type my design lib in the name section.
3. In the field of directory section, verify that the path to the library is set to ~/Database /
Cadence- analog lab bl3 and click ok.
4. In the next technology file for new library form select option attach to an existing
tech file and click ok.
5. In the attach design library to technology file form, select gpdk180 form the cyclic
field and click ok.
6. After creating a new library you can verify it from the library manager.
7. If you right click on the my design lib and select properties, you wil find that
gpdk180 library is attached as techlib to my design lib.
Creating a schematic cell view:
1. In the CIW or library manager, execute file new cell view.
2. Setup the new file form as follows, Do not edit the library path file and the above
might be different from the path shown in your form.
3. Click ok when done the above setting. A black schematic window for the inverter
design appears.
Adding components to schematic:
1. In the inverter schematic window, click the instance fixed menu icon to display the
add instance form.
2. Click on the browse button. This opens up a library browser from which you can
select components and the symbol view.
3. After you complete the add instance form move your cursor to the schematic window
and click left to place a component.
4. This is a table of components for building the inverter schematic.
Page 30
5. After entering components, click cancel in the add instance form or press ESC with
your cursor in the schematic window.
LIBRARY NAME
CELL NAME
gpdk180
PMOS
gpdk180
NMOS
PROPERTIES/COMMENTS
For M0 : model name PMOS1,
W = wp, L =180n
For M1 : model name NMOS1,
W = 2u, L =180n
DIRECTION
Vin
Input
Vout
output
3. Select cancel and then the schematic window enter window file or press the f bind
key.
Adding wires to schematic:
1. Click the wire (narrow) icon in the schematic window.
2. In the schematic window click on a pin of one of your components as the first point
for your wiring. A diamond shape appears over the starting point of this wire.
3. Follow the prompts at the bottom of design window and click left on the destination
point for your wire. A wire is routed between the source and destination points.
4. Complete the wiring as shown in the figure and when done wiring press ECS key in
the schematic window to cancel wiring.
Saving the design:
Click the check and save icon in the schematic editor window observe CIW output for
any errors.
Building the inverter test design:
Creating the inverter test cell view:
1. In the CIW or library manager, execute file new cell view.
2. Setup the newfile as shown below.
3. Click ok when done. A blank schematic window for the inverter test design appears.
Page 31
4. Using the components list and properties/ comments in this table build the inverter
test schematic.
5. Add the above components using create instance or by pressing I.
6. Click the wire (narrow) icon and wire your schematic.
7. Click create wirename or press c to name the i/p (vin) and output wires as in below
schematic.
8. Click on the check and save icon to save the design.
Page 32
Selecting o/ps for plotting:
1. Execute the o/ps to be plotted -select on sschematic in the simulation window.
2. Follow the prompt at the bottom. Click on the o/p net vout input vin of the inverter.
Press esc with the cursor after selecting.
Running the simulation:
1. Execute the simulation Netlist and run in the simulation window to start the
simulation on the icon. This will create the netlist as well as run the simulation.
2. When the simulation finishes the transient DC plots automatically with the log file.
V3
+15v
R1
10k
R2
10k
R4
100k
Q1
BC548A
BC548A
Q2
V1
VOFF = 0v
VAMPL = 50mv
FREQ = 4k
0
R3
8k
V2
-15
RESULT:
The Differential Amplifier Schematic and symbol was created and DC and Transient analysis
were done.
Page 33
Expt No:
Date:
CMOS INVERTER LAYOUT DESIGN
AIM:
To design and simulate the CMOS inverter and observe the DC and transient
responses and to create the layout of CMOS inverter and extract the parasitic values using
cadence tool.
APPARATUS REQUIRED:
1. Personal Computer with Linux Operating System
2. Cadence tool
PROCEDURES:
Schematic Entry:
Creating a new library:
1. In the library manager, execute File - New library. The new library form appears.
2. In the new library form, type my design lib in the name section.
3. In the field of directory section, verify that the path to the library is set to ~/Database /
Cadence- analog lab bl3 and click ok.
4. In the next technology file for new library form select option attach to an existing
tech file and click ok.
5. In the attach design library to technology file form, select gpdk180 form the cyclic
field and click ok.
6. After creating a new library you can verify it from the library manager.
7. If you right click on the my design lib and select properties, you wil find that
gpdk180 library is attached as techlib to my design lib.
Creating a schematic cell view:
8. In the CIW or library manager, execute file new cell view.
9. Setup the new file form as follows, Do not edit the library path file and the above
might be different from the path shown in your form.
10. Click ok when done the above setting. A black schematic window for the inverter
design appears.
Adding components to schematic:
11. In the inverter schematic window, click the instance fixed menu icon to display the
add instance form.
12. Click on the browse button. This opens up a library browser from which you can
select components and the symbol view.
13. After you complete the add instance form move your cursor to the schematic window
and click left to place a component.
14. This is a table of components for building the inverter schematic.
Page 34
15. After entering components, click cancel in the add instance form or press ESC with
your cursor in the schematic window.
LIBRARY NAME
CELL NAME
gpdk180
PMOS
gpdk180
NMOS
PROPERTIES/COMMENTS
For M0 : model name PMOS1,
W = wp, L =180n
For M1 : model name NMOS1,
W = 2u, L =180n
DIRECTION
Vin
Input
Vout
output
18. Select cancel and then the schematic window enter window file or press the f bind
key.
Adding wires to schematic:
19. Click the wire (narrow) icon in the schematic window.
20. In the schematic window click on a pin of one of your components as the first point
for your wiring. A diamond shape appears over the starting point of this wire.
21. Follow the prompts at the bottom of design window and click left on the destination
point for your wire. A wire is routed between the source and destination points.
22. Complete the wiring as shown in the figure and when done wiring press ECS key in
the schematic window to cancel wiring.
Saving the design:
Click the check and save icon in the schematic editor window observe CIW output for
any errors.
Building the inverter test design:
Creating the inverter test cell view:
23. In the CIW or library manager, execute file new cell view.
24. Setup the newfile as shown below.
25. Click ok when done. A blank schematic window for the inverter test design appears.
Page 35
26. Using the components list and properties/ comments in this table build the inverter
test schematic.
LIBRARY NAME
PROPERTIES/COMMENTS
My design lib
Inverter
Symbol
Analog lib
Vpulse
V1 = 0, v2 = 1, td = 0,
tr=tf=1ns, ton = 10ns, T=
20ns
Analog lib
Vdc, gnd
Vdc = 1.8v
Page 36
Setting deign variables:
39. Click on the edit variable icon and its corresponding form appears.
40. Click copy from at the bottom of the form. The design is scanned. All variables
formed in the design are listed.In the few moments the wp variable name wp and
enter.
Value (ixpr) 2u
41. Click change and notice the update and then click ok or cancel (in the editing design
variable window)
Selecting o/ps for plotting:
42. Execute the o/ps to be plotted -select on sschematic in the simulation window.
43. Follow the prompt at the bottom. Click on the o/p net vout input vin of the inverter.
Press esc with the cursor after selecting.
Running the simulation:
44. Execute the simulation Netlist and run in the simulation window to start the
simulation on the icon. This will create the netlist as well as run the simulation.
45. When the simulation finishes the transient DC plots automatically with the log file.
Page 37
56. From the layout window, execute create shape path / create wire or create shape
rectangle and select the appropriate layers from the LSW window and vias for
making the interconnections.
Creating contacts/vias:
Execute create-via to place different contacts.
Connection
For metal 1 Polyconnection
For metal 1 psubstrate connection
For metal 1 nwell connection
Contact Type
Metal 1 Poly
Metal 1 psub
Metal 1 - nwell
Page 38
73. In the filtering tab of the form enter power nets as vdd! , vss! And enter ground nets
as gnd!
74. Click ok in the assura parasitic extraction form when done. The RCX progress form
appears, in the progress form click watch log file to see the output log file.
75. When RCX completes, a dialog box appears, informs you that Assura RCX run
completed successfully.
76. You can open the av-extracted view from the library manager and view the parasitic.
RESULT:
The CMOS inverter Schematic and symbol was created and DC and Transient analysis were
done. Manual layout was drawn and parasitic extraction was done.
Page 39
Expt No:
Date:
Page 40
PROGRAM:
Up Counter Design using Behavioral Modelling
module counter_up_down(out,clk,reset,control);
output [3:0]out;
input clk, reset,control;
reg [3:0] out;
always @(negedge clk or posedge reset)
if(reset)
out <=4'b0000;
else
out<=out+1;
endmodule
RESULT:
The counter circuit was designed, simulated and synthesized and generated the
automatic layout and simulate through post layout extraction using Cadence tool.
Page 41
Expt No:
Date:
Page 42
PROGRAMS:
Phase Incrementer:
`ifndef width
`define data_width 6
`define addr_width 6
`define width
`endif
module phase_inc(fclk,M,rst,addr_out);
parameter addr_width = 6;
input fclk,rst;
input [addr_width-1:0]M;
output reg [addr_width-1:0]addr_out;
reg [addr_width-1:0]count;
reg [addr_width-1:0]count_reg;
always@(M) count_reg = M;
always@(posedge fclk) begin
if(rst) addr_out = 0;
else begin
if (count!=0) count = count - 1'b1;
else begin
addr_out = addr_out + 1;
count = count_reg;
end
end
end
endmodule
Multiplexer:
module mux_2to1(addr_in,addr_load,load,addr_out);
parameter addr_width = 6;
input [addr_width-1:0]addr_in;
input [addr_width-1:0]addr_load;
input load;
output [addr_width-1:0]addr_out;
assign addr_out = load?addr_load:addr_in;
endmodule
Page 43
Memory:
`ifndef width
`define data_width 6
`define addr_width 6
`define width
`endif
module mem(clk,rw,addr,data_in,data_out);
parameter data_width = 6;
parameter addr_width = 6;
input clk,rw;
input [addr_width-1:0]addr;
input [data_width-1:0]data_in;
output reg [data_width-1:0]data_out;
reg [data_width-1:0]memory[0:(2**addr_width-1)];
always@(posedge clk) begin
if (!rw) begin
memory[addr] = data_in;
data_out = `data_width'bZ;
end
else if (rw) begin
data_out = memory[addr];
end
end
endmodule
Top Module:
`ifndef width
`define data_width 6
`define addr_width 6
`define width
`endif
module top(clk,M,rst,rw,data_in,load,addr_load,data_out);
parameter data_width = 6;
parameter addr_width = 6;
input clk,rst,rw,load;
input [addr_width-1:0]M;
input [data_width-1:0]data_in;
input [addr_width-1:0]addr_load;
output [data_width-1:0]data_out;
wire [addr_width-1:0]addr_ph;
wire [addr_width-1:0]addr_out;
phase_inc PHASE_INC(.fclk(clk),.M(M),.rst(rst),.addr_out(addr_ph));
mux_2to1 MUX(.addr_in(addr_ph),.addr_load(addr_load),.load(load),.addr_out(addr_out));
mem RAM(.clk(clk),.rw(rw),.addr(addr_out),.data_in(data_in),.data_out(data_out));
endmodule
Page 44
TESTBENCH:
`ifndef width
`define data_width 6
`define addr_width 6
`define width
`endif
module testbench;
parameter data_width = 6; parameter addr_width = 6;
reg clk,rst,rw,load; reg [addr_width-1:0]M;
reg [addr_width-1:0]addr_load; reg signed [data_width-1:0]data_in;
wire signed [data_width-1:0]data_out;
integer fh,i,r;
initial begin
clk = 0;
rst = 1;
data_in = 0;
M = `addr_width'b0;
addr_load = `addr_width'h3f;
fh = $fopen("sine_values.txt","r");
#10 rst = 0;
#1000000 $stop;
end
always #1 clk = ~clk;
// Writing into memory
initial begin
load = 1;
for (i = 0; i <= (2**addr_width); i = i+1) begin
r = $fscanf(fh,"%d",data_in);
addr_load = addr_load + 1;
rw = 0;
@(posedge clk);
end
load = 0;
rw = 1;
end
initial begin
forever #100000 M = M+2;
end
top
TOP(.clk(clk),.M(M),.rst(rst),.rw(rw),.data_in(data_in),.load(load),.addr_load(addr_load),.data_out(da
ta_out));
endmodule
RESULT:
The 10 bit Number Controlled Oscillator circuit was designed, simulated and
synthesized and generated the automatic layout and simulated through post layout extraction
using Cadence tool.