Beruflich Dokumente
Kultur Dokumente
Issue Number: 1
Revision: 0
Prepared by
LIST OF EXPERIMENTS 1. Study of Synthesis tools a. Half and full adder. b. Decoder 2 x 4 c. Priority encoder. d. Ripple adder. e. 4 Bit ripple counter. f. Code conversion. 2. Study of Simulation using tools a. Half adder. b. Multiplexer 2 x 1, 4 x 1 c. Demultiplexer 1 x 2, 1 x 4 3. Study of Simulation using tools a. Flipflop D, T b. Priority encoder. c. Ripple adder. d. 4 Bit ripple counter. 4. Study of development tool for FPGAs for schematic entry and verilog a. Full adder, half adder. b. Demultiplexer 1 x 2, 1 x 4. 5. Design and simulation of pipelined serial and parallel adders. 6. Study of Placing,Rooting and Back annotation for FPGAs 7. Design and simulation of back annotated verilog files for multiplying two signed, 8 bit numbers in 2's complement. 8. Study of FPGA board and testing on board LEDs and switches using verilog code. 9. Design a Realtime Clock (2 digits, 7 segments LED displays each for HRS., MTS, and SECS.) a. Demonstrate its working on the FPGA board. b. To display binary number on the FPGA. 10. Design of traffic light controller using verilog tools . a. Movement of vehicles in any direction or pedestrian in any direction.
3
CYCLE-1
1) Study Of Synthesis Tools-Gate realization 2) Half Adder and Full Adder 3) Decoder 4) Priority Encoder 5) Ripple Adder 6) 4-bit Ripple counter 7) Code conversion 8) Study Of Simulation Using Tools for Half adder, Multiplex, De-multiplexer, 9) D&T-Flip flop 10) Study Of Development Tool For FPGA-Full and Half adder, De-multiplexer
CYCLE-2
11.)Design and Simulation of pipelined serial and parallel adder to add/subtract 8 number of size,12 bits each in 2s complement 12.)Study of place and root and back annotation for FPGAs. 13.) Design and Simulation of back annotated verilog files for multiplying two signed 8 bit numbers in 2s complement
14.)Design And Testing Onboard Switches And LEDS In FPGA
15.)Design and Implementation of real time clock 16.) Design of traffic light controller using Verilog tool
Step 3: In the New Project window enter project name and project location.
Step 6: Enter the file name and then select Verilog module.
Step 7: Define the input and output port names ,then click Next for all successive windows.
Step 9: Double click the Verilog file and enter the logic details and save the file.
Step 10: Double click Synthesize XST for checking the syntax .
Step 11: Right click the halfadd.v file and select new source ,then click Implementation Constraints File and enter the filename.
10
Step13: Open the .ucf file and enter the pin location and save the file
11
Step14: Goto Generate programming file and select Generate PROM,ACE or JTAG file in the processes window.
Step 15: In Slave Serial mode ,right click and select Add Xilinx Device.
12
Step 16: In the Add Device window select the .bit file to add the device.
Step 17: Connect the RS232 cable between computer and kit. Connect the SMPS to kit and switch on the kit. Step 18: Right click the device and select Program to transfer the file to kit. Step 19: After successful transmission of file Programming Succeeded will be displayed. Step 20 : Verify the Results in Kit Using Function/Truth Table.
13
Ex No: 1
AIM: To study the Synthesis tools. THEORY: Now that you have created the source files, verified the designs behavior with simulation, and added constraints, you are ready to synthesize and implement the design. IMPLEMENTING THE DESIGN: 1. Select the counter source file in the Sources in Project window. 2. In the Processes for Source window, click the + sign next to Implement Design. The Translate, Map, and Place & Route processes are displayed. Expand those processes as well by clicking on the + sign. You can see that there are many subprocesses and options that can be run during design implementation. 3. Double-click the top level Implement Design process.ISE determines the current state of your design and runs the processes needed to pull your design through implementation. In this case, ISE runs the Translate, Map and PAR processes. Your design is now pulled through to a placed-and-routed state. This feature is called the pull through model. 4. After the processes have finished running, notice the status markers in the Processes for Source window. You should see green checkmarks next to several of the processes, indicating that they ran successfully. If there are any yellow exclamation points, check the warnings in the Console tab or the Warnings tab within the Transcript window. If a red X appears next to a process, you must locate and fix the error before you can continue. VERIFICATION OF SYNTHESIS: Your synthesized design can be viewed as a schematic in the Register Transfer Level (RTL) Viewer. The schematic view shows gates and elements independent of the targeted Xilinx device. 1. In the Processes for Source window, double-click View RTL Schematic found in the Synthesize - XST process group. The top level schematic representation of your synthesized design opens in the workspace.
14
2. Right-click on the symbol and select Push Into the Selected Instance to view the schematic in detail. The Design tab appears in the Sources in Project window, enabling you to view the design hierarchy. In the schematic, you can see the design components you created in the HDL source, and you can push into symbols to view increasing levels of detail. 3. Close the schematic window.
Ex No: 1. (a)
AIM: Realize the AND gate using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: AND Gate is a circuit which performs, one of the basic logical or switching operation, namely AND operation. It has N inputs (N 2) and one output. Digital signals are applied at the input terminals A, B, CN. The output is obtained at the output terminal marked Y and it is also a digital signal. The AND operation is defined as: the output of an AND gate is 1 if and only if all the inputs are 1. Mathematically, it is written as Y = A AND B AND C AND N = A.B.C N = ABCN where A, B, C N are the input variables and Y is the output variable. The variables are binary, i.e. each variable can assume only one of the possible values, 0 or 1. The binary variables are also referred to as logical variable. The mathematical equation is known as the Boolean equation or the logical equation of the AND gate. The term gate is used because of the similarity between the operation of a digital circuit and a gate. For example, for an AND operation the gate opens (Y = 1) only, when all the inputs are present.
PROCEDURE: 1. The Verilog Module Source for the AND Gate is written. 2. It is implemented in Model Sim and Simulated. 3. Signals are provided and Output Waveforms are viewed.
16
LOGIC DIAGRAM:
17
WAVEFORM:
CONCLUSION: Thus the AND Gate is designed Verilog HDL and the output is verified
18
Ex No: 1. (b)
OR GATE REALISATION
AIM: Realize the OR gate using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: OR Gate is a circuit which performs, one of the basic logical or switching operation, namely the OR operation. It has N inputs (N 2) and one output. Digital signals are applied at the input terminals A, B, CN. The output is obtained at the output terminal marked Y and it is also a digital signal. The OR operation is defined as: the output of an OR gate is 0 if and only if all the inputs are 0. Mathematically, it is written as Y = A OR B OR C OR N = A+B+C +N where A, B, C N are the input variables and Y is the output variable. The variables are binary, i.e. each variable can assume only one of the possible values, 0 or 1. The binary variables are also referred to as logical variable. The mathematical equation is known as the Boolean equation or the logical equation of the OR gate. The term gate is used because of the similarity between the operation of a digital circuit and a gate. For example, for an OR operation the gate closes (Y = 0) only, when all the inputs are absent.
PROCEDURE: 1. The Verilog Module Source for the OR Gate is written. 2. It is implemented in Model Sim and Simulated. 3. Signals are provided and Output Waveforms are viewed.
19
OR GATE: TRUTH
INPUT A 0 0 1 1 B 0 1 0 1 OUTPUT QN+1 0 1 1 1
TABLE:
LOGIC DIAGRAM:
20
WAVEFORM:
CONCLUSION: Thus the OR Gate is designed Verilog HDL and the output is verified.
21
Ex No: 1. (c)
AIM: Realize the NOT gate using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: NOT Gate is a circuit which performs, the one of the basic logic or Boolean operation, namely the NOT operation. It has one input and one output. Digital signal is applied at the input terminal A. The output is obtained at the output terminal marked Y and it is also a digital signal. The NOT operation is referred to as Inversion or Complementation. Mathematically, it is written as
Y = NOT A. = A
where A is the input variable and Y is the output variable. The variables are binary, i.e. each variable can assume only one of the possible values, 0 or 1. The binary variables are also referred to as logical variable. The mathematical equation is known as the Boolean equation or the logical equation of the NOT gate. This is to be read as Y equals NOT A or Y equals complement of A.
PROCEDURE: 1. The Verilog Module Source for the NOT Gate is written. 2. It is implemented in Model Sim and Simulated. 3. Signals are provided and Output Waveforms are viewed. TRUTH TABLE: NOT
INPUT a 0 1
OUTPUT y 1 0
22
LOGIC DIAGRAM:
WAVEFORM:
CONCLUSION: Thus the NOT Gate is designed in Verilog HDL and the output is verified.
23
Ex No: 1. (d)
AIM: Realize the NAND gate using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: NAND Gate is a circuit which performs, the logic or Boolean operation derived from the basic logic operations NOT and AND, namely the NAND operation. It has N inputs (N 2) and one output. Digital signals are applied at the input terminals A, B, CN. The output is obtained at the output terminal marked Y and it is also a digital signal. The NAND operation is defined as: the output of an NAND gate is 0 if and only if all the inputs are 1. It is the inverse of the AND operation. The NAND gate is known to be one of the Universal gates. Mathematically, it is written as
Y=ABN
where A, B, C N are the input variables and Y is the output variable. The variables are binary, i.e. each variable can assume only one of the possible values, 0 or 1. The binary variables are also referred to as logical variable. The mathematical equation is known as the Boolean equation or the logical equation of the NAND gate. The term gate is used because of the similarity between the operation of a digital circuit and a gate. For example, for an NAND operation the gate closes (Y = 0) only, when all the inputs are present. PROCEDURE: 1. The Verilog Module Source for the NAND Gate is written. 2. It is implemented in Model Sim and Simulated. 3. Signals are provided and Output Waveforms are viewed.
24
LOGIC DIAGRAM:
25
WAVEFORM:
CONCLUSION: Thus the NAND Gate is designed in Verilog HDL and the output is verified.
26
Ex No: 1. (e)
AIM: Realize the NOR gate using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: NOR Gate is a circuit which performs, the logic or Boolean operation derived from the basic logic operations NOT and OR, namely the NOR operation. It has N inputs (N 2) and one output. Digital signals are applied at the input terminals A, B, CN. The output is obtained at the output terminal marked Y and it is also a digital signal. The NOR operation is defined as: the output of an NOR gate is 1 if and only if all the inputs are 0. It is the inverse of the OR operation. The NOR gate is known to be one of the Universal gates. Mathematically, it is written as
Y = A +B+ +N
where A, B, C N are the input variables and Y is the output variable. The variables are binary, i.e. each variable can assume only one of the possible values, 0 or 1. The binary variables are also referred to as logical variable. The mathematical equation is known as the Boolean equation or the logical equation of the NOR gate. The term gate is used because of the similarity between the operation of a digital circuit and a gate. For example, for an NOR operation the gate opens (Y = 1) only, when all the inputs are absent.
PROCEDURE: 1. The Verilog Module Source for the NOR Gate is written. 2. It is implemented in Model Sim and Simulated. 3. Signals are provided and Output Waveforms are viewed.
27
LOGIC DIAGRAM:
28
WAVEFORM
CONCLUSION: Thus the NOR Gate is designed Verilog HDL and the output is verified.
29
Ex No: 1. (f)
AIM: Realize the XNOR gate using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: XNOR Gate or EX-NOR Gate or Exclusive-NOR Gate is a circuit which performs, the logic or Boolean operation derived from the basic logic operations AND, OR and NOT or the Universal gates NAND or NOR, namely the XNOR operation. It has N inputs (N 2) and one output. Digital signals are applied at the input terminals A, B, CN. The output is obtained at the output terminal marked Y and it is also a digital signal. The XNOR operation is defined as: the output of an XNOR gate is 1 if all the inputs are same, whereas the output is 0, if the inputs are not the same. It is the inverse of the NOR gate. Mathematically, it is written as Y = A EX-NOR B =A
X
where A, B, C N are the input variables and Y is the output variable. The variables are binary, i.e. each variable can assume only one of the possible values, 0 or 1. The binary variables are also referred to as logical variable. The mathematical equation is known as the Boolean equation or the logical equation of the XNOR gate. The term gate is used because of the similarity between the operation of a digital circuit and a gate. For example, for an XNOR operation the gate opens (Y = 1) only, when all the inputs are not same. PROCEDURE: 1. The Verilog Module Source for the XNOR Gate is written. 2. It is implemented in Model Sim and Simulated. 3. Signals are provided and Output Waveforms are viewed.
30
INPUT A 0 0 1 1 B 0 1 0 1
OUTPUT Y 1 0 0 1
LOGIC DIAGRAM:
31
WAVEFORM:
CONCLUSION: Thus the XNOR Gate is designed in Verilog HDL and the output is verified.
32
Ex No: 2. (a)
AIM: Realize the half adder using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: A combinational circuit that performs the addition of two bits is called a halfadder. This circuit needs two binary inputs and produces two binary outputs. One of the input variables designates the augend and other designates the addend. The output variables produce the sum and the carry. The simplified Boolean functions of the two outputs can be obtained as below: Sum S = xy + xy Carry C = xy Where x and y are the two input variables. PROCEDURE: 1. The half-adder circuit is designed and the Boolean function is found out. 2. The Verilog Module Source for the circuit is written. 3. It is implemented in Model Sim and Simulated. 4. Signals are provided and Output Waveforms are viewed. TRUTH TABLE: HALF ADDER
INPUT A 0 0 1 1 B 0 1 0 1 OUTPUT SUM 0 1 1 0 CARRY 0 0 0 1
33
LOGIC DIAGRAM:
WAVEFORM:
CONCLUSION: Thus the Half Adder is designed in Verilog HDL and the output is verified.
34
Ex No: 2. (b)
AIM: Realize the full adder using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: A combinational circuit that performs the addition of three bits is called a half-adder. This circuit needs three binary inputs and produces two binary outputs. One of the input variables designates the augend and other designates the addend. Mostly, the third input represents the carry from the previous lower significant position. The output variables produce the sum and the carry. The simplified Boolean functions of the two outputs can be obtained as below: Sum S = x
+ +
35
LOGIC DIAGRAM:
WAVEFORM:
CONCLUSION:
Thus the Full Adder is designed Verilog HDL and the output is verified. 36
Ex No: 3.
AIM:
TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator PROCEDURE: 1. Write and draw the Digital logic system. 2. Write the Verilog code for above system. 3. Enter the Verilog code in Xilinx software. 4. Check the syntax and simulate the above verilog code (using ModelSim or Xilinx) and verify the output waveform as obtained. LOGIC DIAGRAM: 2 to 4 Decoder:
00 01 10 11
WAVEFORM:
3 TO 8 DECODER REALIZATION IN VERILOG THEORY: 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-to-seven-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.
38
PROCEDURE: 1. The decoder circuit is designed and the Boolean function is found out. 2. The Verilog Module Source for the circuit is written. 3. It is implemented in Model Sim and Simulated. 4. Signals are provided and Output Waveforms are viewed.
-------INPUT-------C 0 B 0 A 0 ------------------------ DECIMAL (OUTPUT)--------------------i1 1 i2 0 i3 0 i4 i5 0 i6 0 i7 0 i8 0 0
39
CONCLUSION: Thus the logic circuit for the 2 to 4 Decoder and 3 to 8 decoder are designed in Verilog HDL and the outputs are verified.
40
Ex No: 4
AIM: Realize the 4 to 2 Encoder in Verilog TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator; THEORY: An encoder has 2n (or fewer) input lines and n output lines. The output lines generate the binary code corresponding to the input value. In encoders, it is assumed that only one input has a value of 1 at any given time. The encoders are specified as m-ton encoders where m 2n. PROCEDURE: 1. 2. 3. 4. The encoder circuit is designed and the Boolean function is found out. The Verilog Module Source for the circuit is written. It is implemented in Model Sim and Simulated. Signals are provided and Output Waveforms are viewed.
LOGIC DIAGRAM:
41
TRUTH TABLE:
I/P 0 1 I/P1 0 I/P 2 0 I/P3 0 O/P0 0 O/P1 0
0 0
1 0
0 1
0 0
0 1
1 0
42
WAVEFORM:
CONCLUSION: Thus the logic circuit for the 4 to 2 encoder is designed in Verilog HDL and the output is verified.
43
Ex No: 5
AIM: To Design Ripple Adder using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: 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. The simplified Boolean functions of the two outputs can be obtained as below: Sum si = ai xor bi xor ci Carry ci+1 = aibi +bi ci +ai ci Where x, y & z are the two input variables. PROCEDURE: 1. The ripple carry generator circuit is designed and the Boolean function is found out. 2. The full-adder circuit is designed and the Boolean function is found out. 3. The Verilog Module Source for the circuit is written. 4. It is implemented in Model Sim and Simulated. 5. Signals are provided and Output Waveforms are viewed.
44
LOGIC DIAGRAM:
45
WAVE FORM:
CONCLUSION: Thus the logic circuit for the ripple carry adder is designed in Verilog HDL and the output is verified.
46
Ex No: 6(a)
AIM: To realize an asynchronous ripple counter in Verilog . TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator
THEORY: In a ripple counter, the flip-flop output transition serves as a source for triggering other flip-flops. In other words, the Clock Pulse inputs of all flip-flops (except the first) are triggered not by the incoming pulses, but rather by the transition that occurs in other flip-flops. A binary ripple counter consists of a series connection of complementing flip-flops (JK or T type), with the output of each flip-flop connected to the Clock Pulse input of the next higher-order flip-flop. The flip-flop holding the LSB receives the incoming count pulses. All J and K inputs are equal to 1. The small circle in the Clock Pulse /Count Pulse indicates that the flip-flop complements during a negativegoing transition or when the output to which it is connected goes from 1 to 0. The flipflops change one at a time in rapid succession, and the signal propagates through the counter in a ripple fashion. A binary counter with reverse count is called a binary downcounter. In binary down-counter, the binary count is decremented by 1 with every input count pulse.
PROCEDURE: 1. 2. 3. 4. The 4 bit asynchronous ripple counter circuit is designed. The Verilog Module Source for the circuit is written. It is implemented in Model Sim and Simulated. Signals are provided and Output Waveforms are viewed.
47
LOGIC DIAGRAM:
STATE TABLE:
my_jkffbehaviorvlog ff3 (q[2],qbar[2],high,high,q[1],reset); my_jkffbehaviorvlog ff4 (q[3],qbar[3],high,high,q[2],reset); endmodule module my_jkffbehaviorvlog (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;
49
WAVEFORMS: IN BINARY
IN DECIMAL
CONCLUSION: Thus the asynchronous ripple counter is designed in Verilog HDL and the output is verified.
50
Ex No:6 (b)
AIM:
To realize a synchronous ripple counter in Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: 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 flip-flops 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 lower-order 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. PROCEDURE: 1. The 4 bit synchronous ripple counter circuit is designed. 2. The Verilog Module Source for the circuit is written.
3. It is implemented in Model Sim and Simulated. 4. Signals are provided and Output Waveforms are viewed.
51
LOGIC DIAGRAM:
STATE TABLE:
J 0 0 1 1
K 0 1 0 1
Qn+1 Qn 0 1 Qn
52
WAVEFORMS:
CONCLUSION: Thus the synchronous ripple counter is designed in Verilog HDL and the output is verified.
54
Ex No: 7(a)
CODE CONVERSION
BCD TO DECIMAL DECODER REALIZATION IN VERILOG AIM: Realize the BCD to Decimal decoder in Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator; THEORY: A BCD to decimal 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 dontcare 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-to-seven-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.
PROCEDURE: 1. The BCD to decimal decoder circuit is designed . 2. The Verilog Module Source for the circuit is written. 3. It is implemented in Model Sim and Simulated. 4. Signals are provided and Output Waveforms are viewed.
55
TRUTH TABLE:
-------INPUT-------X3 0 0 X2 0 X1 0 X0 0 ------------------------ DECIMAL (OUTPUT)--------------------D0 0 D1 0 0 D2 0 D3 0 D4 0 D5 0 D6 0 D7 0 D8
56
LOGIC DIAGRAM:
X3 X2 X1 X0
PROGRAM:
module bcd(x, d); output[0:9] d; input[0:3] x; wire [0:3]temp; not n1 (temp[0],x[0]); not n2 (temp[1],x[1]); not n3 (temp[2],x[2]); not n4 (temp[3],x[3]); and a0 (d[0],temp[0],temp[1],temp[2],temp[3]); and a1 (d[1],temp[0],temp[1],temp[2],x[3]); and a2 (d[2],temp[0],temp[1],x[2],temp[3]); and a3 (d[3],temp[0],temp[1],x[2],x[3]); and a4 (d[4],temp[0],x[1],temp[2],temp[3]); and a5 (d[5],temp[0],x[1],temp[2],x[3]); and a6 (d[6],temp[0],x[1],x[2],temp[3]); and a7 (d[7],temp[0],x[1],x[2],x[3]); and a8 (d[8],x[0],temp[1],temp[2],temp[3]); and a9 (d[9],x[0],temp[1],temp[2],x[3]); endmodule
57
WAVE FORM:
CONCLUSION: Thus the logic circuit for the BCD to decimal decoder is designed in Verilog HDL and the output is verified.
58
Ex No: 7(b)
TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator
THEORY: An encoder is a digital circuit that performs the inverse operation of a decoder. An encoder 2^n input lines and n output lines. In encoder the output lines generate the binary code corresponding to the input lines the decimal to BCD encoder, it has ten
input lines and four output lines. Both input and output lines are asserted active low. It is important to note that there is no input line for decimal zero.
PROCEDURE: 1. The decimal to BCD encoder is designed. 2. The verilog HDL program source code for the circuit is written. 3. It is implemented in Model sim and simulated. 4. Signals are provided and output waveforms are viewed.
59
TABLE TRUTH
------------------------ DECIMAL (INPUT)--------------------i1 i2 i3 i4 i5 i6 i7 i8 i9 -------OUTPUT-----D C B A
60
LOGIC DIAGRAM:
PROGRAM:
module encod(i1,i2,i3,i4,i5,i6,i7,i8,i9, a,b,c,d); input i1,i2,i3,i4,i5,i6,i7,i8,i9; output a,b,c,d; or (a,i1,i3,i5,i7,i9); or (b,i2,i3,i6,i7); or (c,i4,i5,i6,i7); or (d,i8,i9); endmodule
CONCLUSION: Thus the logic circuit for the decimal to BCD encoder is designed in Verilog HDL and the output is verified.
61
Ex No: 7. (c)
AIM: Realize the universal code converter in Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator.
THEORY:
The availability of a large variety of codes for the same discrete elements of information results in the use of different codes by different digital system. It is sometimes necessary to use the output of one system as the input to another. A conversion circuit must be inserted between the two systems if each uses different codes for the same information. Thus, a code converter is a circuit that makes the two systems compatible even though each uses a different binary code. To convert from binary code A to binary code B, the input lines must supply the bit combination of elements as specified by code A and the output lines must generate the corresponding bit combination of code B. A combinational circuit which performs this transformation by means of logic gates, is known to be Code Converter. PROCEDURE: 1. The various code converter circuits are designed and their Boolean functions are found out. 2. The Verilog Module Sources for the circuits are written. 3. They are implemented in Model Sim and Simulated. 4. Signals are provided and Output Waveforms are viewed.
62
63
64
65
66
GRAY TO BINARY
BINARY CODE B3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 B2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 B1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 B0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
GRAY CODE G3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 G2 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 G1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 G0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
GRAY CODE G3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 G2 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 G1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 G0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
BINARY CODE B3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 B2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 B1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 B0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
67
end 4: begin
op[0] = ~(ip[0]); op[1] = (ip[0]^ip[1]); op[2] = (( ( (~(ip[2]))&(~(ip[1])))) | (ip[3] & ip[1] & (~(ip[0])))); end begin op[0] = op[1] = op[2] = op[3] = op[4] = (ip[1] ^ ip[0]); (ip[2] ^ ip[1]); (ip[3] ^ ip[2]); ip[3]; 1'b 0;
(ip[2]&ip[1]&ip[0]) |
5:
end 6: begin
$display ("Entered a Wrong Option"); $display ("To Know the choices Enter 1'd0");
69
70
71
72
73
74
CONCLUSION:
Thus the logic circuit for the universal code converter is designed in Verilog HDL and the output is verified.
75
EX.NO : 8 AIM:
To study the Simulation tools. THEORY: CREATING A TEST BENCH FOR SIMULATION: In this section, you will create a test bench waveform containing input stimulus you can use to simulate the counter module. This test bench waveform is a graphical view of a test bench. It is used with a simulator to verify that the counter design meets both behavioral and timing design requirements. You will use the Waveform Editor to create a test bench waveform (TBW) file. 1. Select the counter HDL file in the Sources in Project window. 2. Create a new source by selecting Project _ New Source. 3. In the New Source window, select Test Bench Waveform as the source type, and type test bench in the File Name field. 4. Click Next. 5. The Source File dialog box shows that you are associating the test bench with the source file: counter. Click Next. 6. Click Finish. You need to set initial values for your test bench waveform in the Initialize Timing dialog box before the test bench waveform editing window opens. 7. Fill in the fields in the Initialize Timing dialog box using the information below: Clock Time High: 20 ns. Clock Time Low: 20 ns. Input Setup Time: 10 ns. Output Valid Delay: 10 ns. Initial Offset: 0 ns Global Signals: GSR (FPGA) Leave the remaining fields with their default values.
76
8. Click OK to open the waveform editor. The blue shaded areas are associated with each input signal and correspond to the Input Setup Time in the Initialize Timing dialog box. In this tutorial, the input transitions occur at the edge of the blue cells located under each rising edge of the CLOCK input.
Fig 3:Waveform Editor - Expected Results 9. In this design, the only stimulus that you will provide is on the DIRECTION port. Make the transitions as shown below for the DIRECTION port: Click on the blue cell at approximately the 300 ns clock transition. The signal switches to high at this point. Click on the blue cell at approximately the 900 ns clock transition. The signal switches back to low.
77
Click on the blue cell at approximately the 1400 ns clock transition. The signal switches to high again. 10. Select File _ Save to save the waveform. In the Sources in Project window, the TBW file is automatically added to your project. 11. Close the Waveform Editor window. ADDING EXPECTED RESULTS TO THE TEST BENCH WAVEFORM: In this step you will create a self-checking test bench with expected outputs that correspond to your inputs. The input setup and output delay numbers that were entered into the Initialize Timing dialog when you started the waveform editor are evaluated against actual results when the design is simulated. This can be useful in the Simulate Post- Place & Route HDL Model process, to verify that the design behaves as expected in the target device both in terms of functionality and timing. To create a self-checking test bench, you can edit output transitions manually, or you can run the Generate Expected Results process: 1. Select the testbench.tbw file in the Sources in Project window. 2. Double-click the Generate Expected Simulation Results process. This process converts the TBW into HDL and then simulates it in a background process. 3. The Expected Results dialog box will open. Select Yes to post the results in the waveform editor. 4. Click the + to expand the COUNT_OUT bus and view the transitions that correspond to the Output Valid Delay time (yellow cells) in the Initialize Timing dialog box. 5. Select File _ Save to save the waveform. 6. Close the Waveform Editor.Now that you have a test bench, you are ready to simulate your design. SIMULATING THE BEHAVIORAL MODEL (ISE SIMULATOR): If you are using ISE Base or Foundation, you can simulate your design with the ISE Simulator. If you wish to simulate your design with a ModelSim simulator, skip this section and proceed to the Simulating the Behavioral Model (ModelSim) section.
78
Fig 5:Behavioral Simulation in ISE Simulator To run the integrated simulation processes in ISE: 1. Select the test bench waveform in the Sources in Project window. You can see the Xilinx ISE Simulator processes in the Processes for Source window. 2. Double-click the Simulate Behavioral Model process. The ISE Simulator opens and runs the simulation to the end of the test bench. 3. To see your simulation results, select the test bench tab and zoom in on the transitions. You can use the zoom icons in the waveform view, or right click and select a zoom command.The ISE window, including the waveform view. 4. Zoom in on the area between 300 ns and 900 ns to verify that the counter is counting up and down as directed by the stimulus on the DIRECTION port.
79
5. Close the waveform view window. You have completed simulation of your design using the ISE Simulator. Skip past the ModelSim section below and proceed to the Creating and Editing Timing and Area Constraintssection. SIMULATING THE BEHAVIORAL MODEL (MODELSIM): If you have a ModelSim simulator installed, you can simulate your design using the integrated ModelSim flow. You can run processes from within ISE which launches the installed ModelSim simulator. To run the integrated simulation processes in ISE: 1.Select the test bench in the Sources in Project window. You can see ModelSim Simulator processes in the Processes for Source window in Fig 6.
80
Fig 7:Behavioral Simulation in ModelSim 2. Double-click the Simulate Behavioral Model process. The ModelSim simulator opens and runs your simulation to the end of the test bench. The ModelSim window, including the waveform, should look like Fig 7. To see your simulation results, view the Wave window. 1. Right-click in the Wave window and select a zoom command. 2. Zoom in on the area between 300 ns and 900 ns to verify that the counter is counting up and down as directed by the stimulus on the DIRECTION port. 3. Close the ModelSim window.
81
82
Ex No:8(a)
AIM: Realize the half adder using Verilog. TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: A combinational circuit that performs the addition of two bits is called a half-adder. This circuit needs two binary inputs and produces two binary outputs. One of the input variables designates the augend and other designates the addend. The output variables produce the sum and the carry. The simplified Boolean functions of the two outputs can be obtained as below: Sum S = xy + xy Carry C = xy Where x and y are the two input variables. PROCEDURE: 1. The half-adder circuit is designed and the Boolean function is found out. 2. The Verilog Module Source for the circuit is written. 3. It is implemented in Model Sim and Simulated.
4. Signals are provided and Output Waveforms are viewed.
83
B 0 1 0 1
LOGIC DIAGRAM:
84
WAVEFORM:
CONCLUSION: Thus the Half Adder is designed in Verilog HDL and the output is verified.
85
The multiplexer circuit is designed and the Boolean function is found out. The Verilog Module Source for the circuit is written. It is implemented in Model Sim and Simulated. Signals are provided and Output Waveforms are viewed.
86
2. 3. 4.
LOGIC DIAGRAM:
87
WAVEFORM:
CONCLUSION: Thus the logic circuit for the 4 to 1 multiplexer is designed in Verilog HDL and the output is verified.
89
THEORY: The de-multiplexer performs the reverse operation of a multiplexer. It is a combinational circuit which accepts a single input and distributes it over several outputs. The number of output lines is n and the number of select lines is 2n lines. Demultiplexer ICs may have an enable input to control the operation of the unit. When the enable input is in a given binary state (the disable state), the outputs are disabled, and when it is in the other state (the enable state), the circuit functions as normal demultiplexer. The size of the de-multiplexer is specified by the single input line and the number 2n of its output lines.
PROCEDURE: 1. The de-multiplexer circuit is designed and the Boolean function is found out. 2. The Verilog Module Source for the circuit is written. 3. It is implemented in Model Sim and Simulated. 4. Signals are provided and Output Waveforms are viewed.
90
LOGIC DIAGRAM:
TRUTH TABLE:
INPUTS I 1 1 1 1 S0 0 0 1 1 S1 0 1 0 1 OUTPUTS Q0 1 0 0 0 Q1 0 1 0 0 Q2 0 0 1 0 Q3 0 0 0 1
91
92
WAVEFORM:
CONCLUSION: Thus the logic circuit for the 1 to 4 de-multiplexer is designed in Verilog HDL and the output is verified.
93
Exno:9(a)
AIM: Realize the D Flip-Flop in Verilog TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: A flip-flop circuit can maintain a binary state indefinitely (as long as power is delivered to the circuit) until directed by an input signal to switch states. The basic flipflop has two outputs Q and Q. The outputs Q and Q are always complementary. The flip-flop has two stable states which are known as the 1 state and 0 state. In the 1 state, the output Q = 1 and hence called Set state. In the 0 state, the output Q = 0 and also called as Reset or Clear state. The basic flip-flop can be obtained by using NAND or NOR gates. The basic flip-flop circuit is also called latch, since the information is latched or locked in this circuit. The basic flip-flop is also called the basic binary memory cell, since it maintains a binary state as long as power is available. It is often required to set or reset the basic memory cell in synchronism with a train of pulses known as clock. Such a circuit is referred to as clocked set-reset (S-R) Flip-Flop. In a flip-flop, when the power is switched on, the state of the circuit is uncertain. It is desired to initially set or reset the flip-flop, i.e. the initial state of the flip-flop is to be assigned. This is accomplished by using the direct or asynchronous inputs, referred to as preset and clear inputs. The uncertainty in the state of an S-R Flip Flop when Sn = Rn = 1 can be eliminated by ensuring that the inputs S and R are never equal to 1 at the same time. This is done in the D Flip-Flop. This D Flip-Flop has only two inputs: D and Cp. The D input goes directly to the S input and its complement is applied to the R input. As long as the clock pulse input is 0, the D flip-flop cannot change the state regardless of the value of D. The D input is sampled when CP = 1. If D is 1, the Q output goes to 1, placing the FlipFlop in the set state. If D is 0, the output Q goes to 0 and the Flip-Flop switches to clear
94
or reset state. The D flip-flop is so called because of its ability to hold data into its internal storage. This type of flip-flop is sometimes called gated D- latch. PROCEDURE: 1. The D flip-flop circuit is designed and the Boolean function is found out. 2. The Verilog Module Source for the circuit is written. 3. It is implemented in Model Sim and Simulated. 4. Signals are provided and Output Waveforms are viewed.
*** //
96
TRUTH TABLE:
INPUT OUTPUT STATE RESET SET NO CHANGE
CLK D QN QN+1 0 0 1 X X X X 0 1 QN
LOGIC DIAGRAM:
97
WAVEFORMS:
CONCLUSION: Thus the D flip-flop is realized in Verilog HDL and the output is verified.
98
Exno:9(b)
AIM:
Realize the T Flip-Flop in Verilog TOOLS REQUIRED: Synthesis tool: Xilinx ISE. Simulation tool: ModelSim Simulator THEORY: A flip-flop circuit can maintain a binary state indefinitely (as long as power is delivered to the circuit) until directed by an input signal to switch states. The basic flip-flop has two outputs Q and Q. The outputs Q and Q are always complementary. The flip-flop has two stable states which are known as the 1 state and 0 state. The basic flip-flop can be obtained by using NAND or NOR gates. The basic flipflop circuit is also called latch, since the information is latched or locked in this circuit. The basic flip-flop is also called the basic binary memory cell, since it maintains a binary state as long as power is available. It is often required to set or reset the basic memory cell in synchronism with a train of pulses known as clock. Such a circuit is referred to as clocked set-reset (S-R) Flip-Flop. In a flip-flop, when the power is switched on, the state of the circuit is uncertain. It is desired to initially set or reset the flip-flop, i.e. the initial state of the flip-flop is to be assigned. This is accomplished by using the direct or asynchronous inputs, referred to as preset and clear inputs. In a JK Flip Flop, if J = K, the resulting flip-flop obtained is referred to as a Ttype flip-flop. It has only one input, referred to as T-input. If T = 1, it acts as a toggle switch, i.e. for every clock pulse, the output Q changes. The designation T comes from the ability of the flip-flop to toggle, or complement, its state. PROCEDURE: 1. The T Flip-Flop circuit is designed and the Boolean function is found out. 2. The Verilog Module Source for the circuit is written. 3. It is implemented in Model Sim and Simulated. 4. Signals are provided and Output Waveforms are viewed.
99
TRUTH TABLE:
PREVIOUS STATE QN 0 0 1 1 INPUT T 0 1 0 1 OUTPUT Qn+1 0 1 1 1
LOGIC DIAGRAM:
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
WAVEFORMS:
CONCLUSION: Thus the T flip-flop is realized in Verilog HDL and the output is verified
101
EX.No:10 AIM:
To study the development tool for FPGA and simulate the adders and demux. TOOLS REQUIRED: FPGA Spartan 3E kit Xilinx software PROCEDURE: Step 1: Open Xilinx software Step 2: Select File New Project.
Step 3: In the New Project window enter project name and project location
102
103
Step 6: Enter the file name and then select Verilog module
Step 7: Define the input and output port names, then click Next for all successive windows
104
Step 9: Double click the Verilog file and enter the logic details and save the file.
105
Step 10: Double click Synthesize XST for checking the syntax .
Step 11: Right click the half add.v file and select new source, then click implementation constraints file and enter the file name.
106
Step
12:.ucf
file
will
be
created
Step 13: open the .ucf file and enter the pin location and save the file
107
Step14: Goto Generate programming file and select Generate PROM,ACE or JTAG file in the processes window.
Step 15: In Slave Serial mode ,right click and select Add Xilinx Device
108
Step 16: In the Add Device window select the .bit file to add the device.
109
Step 17: Connect the RS232 cable between computer and kit. Connect the SMPS to kit and switch on the kit. Step 18: Right click the device and select Program to transfer the file to kit.
Step 19: after sucecessful transmission of the programming succeeded will be displayed
110
RESULT:Thus the development tool for FPGA for schematic entry and verilog was studied
111
EX NO: 11 DESIGN AND SIMULATION OF PIPELINED SERIAL AND PARALLEL ADDER TO ADD/SUBTRACT 8 NUMBER OF SIZE,12 BITS EACH IN 2S COMPLEMENT SERIAL ADDER: AIM: To design, synthesize, simulate pipelined serial and parallel adder to add 8 numbers of 12bit size each in 2s complement and to implement and program the same in FPGA. TOOLS REQUIRED: SOFTWARE: XILINX ISE 9.1i HARDWARE: XILINX - Spartan kit XC3S400TQ144, Power supply Adapter, Parallel port cable, FRC connector, AU card - I THEORY: SERIAL ADDER: Serial Adder uses a simple adder and constructs the sum sequentially. At a time t, the Sun is calculated and the carry is stored in a register. At time t+1, the sum uses carry[t] to calculate a new sum. Carry [ t + 1] = A [ t +1].B[ t + 1 ] . ( A [ t + 1 ] + B [ t + 1 ] ) Sum [ t + 1 ] = Carry [ t + 1 ] . ( A [ t + 1 ] + B [ t + 1 ] + c [ t ] ) +A[t+1].B[t+1].c[t] The two inputs to the adder are stored in a n-bit register. Sum bit is stored in a n-bit register. Addition is commenced by clearing the carry register. Then the operands are serially applied to the inputs of the adder. The sum and carry array are advantageous because these delays determine the fastest clock frequency at which the adder can operate. Bit serial architecture has been used widely for a variety of signal processing applications, especially with technologies in the 2-5 micro range. Reasons for using bit serial architecture include reduced signal routing, reduced module sizes and higher speed operation.
112
PARALLEL ADDER: An n-bit parallel adder may be constructed by cascading n 1-bit adders. This is called Ripple Carry Adder. The inputs are n bit A and B values. The carry signal of stage i is fed to the C signal of the stage i+1 and the sum signal forms the n bit output. The nth bit of the sum indicates whether overflow has occurred. Because the carry output signal is used in the generation of the sum, the sum will be delayed with respect to the carry. In case of n-bit parallel adder, the carry delay has to be minimized because the delay associated the adder is Tn = nTc Where Tn is the Total Add Time, n is the number of stages and Tc is the delay of one carry stage. To optimize the Carry delay, the inverter at the output of the carry gate can be omitted. In this case, every other stage operates on complement data. PROGRAM: Verilog code for serial adder
module serial_adder(clk,addr,load,clear,data_in,calc,result); input clk,clear,calc,load; input [2:0]addr; input [11:0]data_in; output reg [11:0]result; reg [11:0]ram[7:0]; reg [6:0]temp; always@(negedge clk) begin if(clk) temp[0] = ram[0] + ram[1]; temp[1] = (temp[0] + ram[2]); temp[2] = (temp[1] + ram[3]); temp[3] = (temp[2] + ram[4]); temp[4] = (temp[3] + ram[5]); temp[5] = (temp[4] + ram[6]); temp[6] = (temp[5] + ram[7]); end always@(posedge clk) begin if(~clear) begin ram[0]=12'b0; ram[1]=12'b0; ram[2]=12'b0; ram[3]=12'b0; ram[4]=12'b0; ram[5]=12'b0; ram[6]=12'b0; ram[7]=12'b0; 113
end else if(~load) begin result=data_in; ram[addr] = data_in; end else if(~calc) result = temp; else result = ram[addr]; end endmodule
PROCEDURE: Software part 1. Click on the Xilinx ISE9.1i or Xilinx Project navigator icon on the desktop of PC. 2. Write the Verilog code, check syntax, view RTL schematic and note the device utilization summary by double clicking on the synthesis in the process window. 3. Perform the functional simulation using ModelSim XE Verilog simulator. 4. Open a new UCF file and lock the pins of the design with FPGA I/O pins. 5. Implement the design by double clicking on the implementation tool selection. 6. Create programming file (i.e., bit file) for downloading into the device.
115
Hardware part Connect the power supply cable to the FPGA kit using power supply adapter. Connect the FPGA kit to the parallel port of the PC through the cable provided along with the kit. Connect FRC1 of main board to CN8 of AU card - I using FRC cable. Connect FRC2 of main board to CN7 of AU card - I using FRC cable. Connect FRC7 of main board to CN6 of AU card - I using FRC cable. Connect FRC6 of main board to CN5 of AU card - I using FRC cable. Connect FRC4 of main board to CN4 of AU card - I using FRC cable. Connect FRC5 of main board to CN1 of AU card - I using FRC cable. Working 1. Download the program into the FPGA and connect the FRC connectors as specified. 2. On AU card I, load the 12 bit data by using the specified switches (SW0-SW11) and selection of 8 numbers are made one by one by selecting the assigned lines A0, A1 and A2. 3. After selecting each 12 bit numbers by pressing the LOAD switch, the values are assigned to concerned memory locations. 4. After loading all values, keep pressing CALC switch in AU card I for verifying the result in LEDs on card I. SYNTHESIS REPORT: (FOR SERIAL ADDER) Device Utilization Summary (estimated values) Logic Utilization Number of Slices Number of Slice Flip Flops Number of 4 input LUTs Number of bonded IOBs Number of GCLKs Used 142 120 221 31 1 Available 3584 7168 7168 97 8 Utilization 3% 1% 3% 31% 12%
116
117
SYNTHESIS REPORT: (FOR PARALLEL ADDER) Device Utilization Summary (estimated values) Logic Utilization Number of Slices Number of Slice Flip Flops Number of 4 input LUTs Number of bonded IOBs Number of GCLKs Used 115 108 202 31 1 Available 3584 7168 7168 97 8 Utilization 3% 1% 2% 31% 12%
118
OBSERVATION: Location 000 001 010 011 12-bit Input Data 0000 0000 0000 0000 0000 0001 0000 0000 0010 0000 0000 0011 Location 100 101 110 111 12-bit Input Data 0000 0000 0100 0000 0000 0101 0000 0000 0110 0000 0000 0111
RESULT:
Thus the serial adder and parallel adder were designed using Verilog HDL for 8 datas, each of 12 bit size and it was simulated, synthesized, implemented and programmed in the FPGA device.
119
EX. NO: 12
AIM: To study the Place and Root and Back annotation for FPGAs. THEORY: After implementation is complete, you can verify your design before downloading it to a device. VIEWING PLACEMENT: In this section, you will use the Floor planner to verify your pin outs and placement. Floor planner is also very useful for creating area groups for designs. 1. Select the counter source file in the Sources in Project window. 2. Click the + sign to expand the Place & Route group of processes. 3. Double-click the View/Edit Placed Design (Floorplanner) process. The Floorplanner view opens. 4. Select View _ Zoom _ ToBox and then use the mouse to draw a box around the counter instance, shown in green on the right side of the chip. 5. This Fig 1 shows where the entire design was placed. Click on any of the components listed in the Design Hierarchy window to see where each component is placed. 6. Zoom in to the right side of the chip even more, and place your mouse over the K13pad. You can see that your pinout constraint was applied - the DIRECTION pin is placed at K13. 7. Close the Floorplanner without saving. VIEWING RESOURCE UTILIZATION IN REPORTS: Many ISE processes produce summary reports which enable you to check information about your design after each process is run. Detailed reports are available from the Processes for Source window. You can also view summary information and access most often-utilized reports in the Design Summary. 1. Click on the Design Summary tab at the bottom of the window. If you closed the summary during this tutorial, you can reopen it by double-clicking the View Design Summary process.
120
FIGURE 4: FPGA EDITOR - DETAILED VIEW 2. In the Device Utilization Summary section, observe the number of Slice Flip Flops that were used during implementation. You should see 4 flip flops, since you implemented a 4-bit counter. 3. To see other reports, scroll to the bottom of the Design Summary. You can click on a report from here to view it in the ISE Text Editor. TIMING CLOSURE: In this section, you will run timing analysis on your design to verify that your timing constraints were met. Timing closure is the process of working on your design to ensure that it meets your necessary timing requirements. ISE provides several tools to assist with timing closure.
121
1. In the Processes for Source window, under the Place & Route group of processes, expand the Generate Post-Place & Route Static Timing group by clicking the +sign. 2. Double-click the Analyze Post-Place & Route Static Timing process. The Timing Analyzer opens. 3. To analyze the design, select Analyze Against Timing Constraints. The Analyze with Timing Constraints dialog box opens. 4. Click OK. When analysis is complete, the timing report opens. 5. Select Timing summary from the Timing Report Description tree in the left window. This displays the summary section of the timing report, where you can see that no timing errors were reported. 6. Close the Timing Analyzer without saving. VIEWING THE PLACED AND ROUTED DESIGN: In this section, you will use the FPGA Editor to view the design. You can view your design on the FPGA device, as well as edit the placement and routing with the FPGA Editor. 1. Double-click the View/Edit Routed Design (FPGA Editor) process found in the Place & Route group of processes. Your implemented design opens in the FPGA Editor. 2. Look in the List window to examine your design components. 3. Click on the COUNT_OUT K12 IOB in the List window to select the row. This is one of the outputs in your design. 4. With the COUNT_OUT K12 row selected, select View _ Zoom Selection. In the editor window, you can see the COUNT_OUT<0> IOB highlighted in red. 5. Push into (double-click) the red-highlighted COUNT_OUT K12 IOB. You should see Fig 4. 6. Enlarge the window and zoom in so you can see more detail. This view shows the inside of an FPGA at the lowest viewable level. The blue line shows the route that is used through the IOB. The red lines show the routes that are available.
122
FIGURE 6: TIMING SIMULATION IN ISE SIMULATOR 7. Verify that the signal goes to the pad as an output. 8. Close the FPGA Editor. TIMING SIMULATION (ISE SIMULATOR): You can verify that your design meets your timing requirements by running a timing simulation. You can use the same test bench waveform that was used earlier in the design flow for behavioral simulation. When running timing simulation, the ISE tools create a structural HDL file which includes timing information available after Place and Route is run. The simulator will run on a model that is created based on the design to be downloaded to the FPGA.
123
If you are using ISE Base or Foundation, you can simulate your design with the ISE Simulator. To simulate your design with ModelSim, skip to the Timing Simulation (ModelSim) section. To run the integrated simulation processes: 1. Select the test bench waveform in the Sources in Project window. You can see the ISE Simulator processes in the Processes for Source window. 2. Double-click the Simulate Post-Place & Route Model process. This process generates a timing-annotated netlist from the implemented design and simulates it. The resulting simulation is displayed in the Waveform Viewer. These results look different than those you saw in the behavioral simulation earlier in this tutorial. These results show timing delays. 3. To see your simulation results, zoom in on the transitions and view the area between 300 ns and 900 ns to verify that the counter is counting up and down as directed by the stimulus on the DIRECTION port. 4. Zoom in again to see the timing delay between a rising clock edge and an output transition. 5. Click the Measure Marker button and then click near the 300 ns mark. Drag the second marker to the point where the output becomes stable to see the time delay between the clock edge and the transition. 6. Close the waveform view window.You have completed timing simulation of your design using the ISE Simulator. Skip past the ModelSim section below, and proceed to the Creating Configuration Data section. TIMING SIMULATION (MODELSIM): If you have a ModelSim simulator installed, you can simulate your design using theintegrated ModelSim flow. You can run processes from within ISE which launches the installed ModelSim simulator. 1. To run the integrated simulation processes, select the test bench in the Sources in Project window. You can see the ModelSim Simulator processes in the Processes for Source window.
124
FIGURE 8: TIMING SIMULATION IN MODELSIM 2. Double-click the Simulate Post-Place & Route VHDL/Verilog Model process.
125
3. Zoom in on the area between 300 ns and 900 ns to verify that the counter is counting up and down as directed by the stimulus on the DIRECTION port. 4. Zoom in on the rising clock edges to see that the output transitions occur slightly later due to the timing delay. 5. Close the ModelSim window.
126
EX.13 DESIGN AND SIMULATION OF BACKANNOTATED VERILOG FILES FOR MULTIPLYING TWO SIGNED 8 BIT NUMBERS IN 2S COMPLEMENT AIM: To design, synthesize, simulate pipelined multiplier to multiply two 8 bit signed numbers in 2s complement and to implement and program the same in FPGA. TOOLS REQUIRED: SOFTWARE: XILINX ISE 9.1i HARDWARE: XILINX - Spartan kit XC3S400TQ144, Power supply Adapter, Parallel port cable, FRC connector, AU card - I THEORY: MULTIPLIER: In many digital signal processing applications such as correlations, convolutions, filtering and frequency analysis, one needs to perform multiplication. Multiplication algorithms will be used to illustrate methods of designing different cells so they fit into a larger structure. In order to introduce these designs, simple serial and parallel multipliers will be introduced. The appropriate tests should be consulted for more definite system architecture. The most basic form of multiplication consists of forming the products of two positive binary numbers. This may be accomplished through the traditional technique of Successive Addition and shifts in which each additive is conditional on one of the multiplier bits. The multiplication process may be viewed to consist of the following steps: 1. Evaluation of Partial Products, 2. Accumulation of the shifted partial products It should be noted that binary multiplication is equal to partial AND operations. Thus evaluation of partial products consists of the logical AND of the Multiplicand and the relevant Multiplier bit. Each column of partial products must then be added and if necessary any carry values is passed to the next column. There are a number of techniques that may be used to perform multiplication. In general the choice is based on the factors such as speed, throughput, numerical accuracy and area. As a rule, multiplication may be classified by the format, in which the words are accessed namely, 1. Serial Form 2. Serial / Parallel Form 3. Parallel Form
127
PROCEDURE: Software part 1. Click on the Xilinx ISE9.1i or Xilinx Project navigator icon on the desktop of PC. 2. Write the Verilog code, check syntax, view RTL schematic and note the device utilization summary by double clicking on the synthesis in the process window.
129
3. Perform the functional simulation using ModelSim - XE Verilog simulator. 4. Open a new UCF file and lock the pins of the design with FPGA I/O pins. 5. Implement the design by double clicking on the implementation tool selection. 6. Create programming file (i.e., bit file) for downloading into the device. Hardware part Connect the power supply cable to the FPGA kit using power supply adapter. Connect the FPGA kit to the parallel port of the PC through the cable provided along with the kit. Connect FRC1 of main board to CN8 of AU card - I using FRC cable. Connect FRC2 of main board to CN7 of AU card - I using FRC cable. Connect FRC7 of main board to CN6 of AU card - I using FRC cable. Connect FRC6 of main board to CN5 of AU card - I using FRC cable. Connect FRC4 of main board to CN4 of AU card - I using FRC cable. Connect FRC5 of main board to CN1 of AU card - I using FRC cable. Working 1. Download the program into the FPGA and connect the FRC connectors as specified. 2. On AU card I, load two 8 - bit data by using the specified switches (SW0SW7) in address location 0 and 1. 3. By pressing the LOAD switch in AU card - I, the two values are assigned to concerned memory locations. 4. After loading all values, keep pressing CALC switch in AU card I for verifying the result in LEDs on card I. SYNTHESIS REPORT: Device Utilization Summary (estimated values) Logic Utilization Number of Slices Number of Slice Flip Flops Number of 4 input LUTs Number of bonded IOBs Number of 18X18s Number of GCLKs Used 50 32 95 29 1 1 Available 3584 7168 7168 97 16 8 Utilization 1% 0% 1% 29% 6% 12%
130
OBSERVATION: Location 0 1 8-bit Input Data 0000 0001 1000 0001 1111 1111 1000 0001 16-bit Result
RESULT: Thus the 8 bit multiplier was designed using Verilog HDL and it was simulated, synthesized, implemented and programmed in the FPGA device.
131
To simulate and test onboard switches and LEDs using Verilog code and to implement the same in FPGA. TOOLS REQUIRED: SOFTWARE: XILINX ISE 9.1i HARDWARE: XILINX - Spartan kit XC3S400TQ144, Power supply Adapter, Parallel port cable, FRC connector, GPIO card - II ALGORITHM: 1. 2. 3. 4. Start the program. Declare the input and output variables. Declare the output as register data type. Use PROCEDURAL construct statements (behavioral modeling) for Verilog code. 5. Terminate the program. THEORY: TESTING ON BOARD LEDS AND SWITCHES: XC3S400 is an array of Configurable Logic Blocks (CLBs) and is embedded within a set of horizontal and vertical channels that contain Routing that can be personalized to interconnect CLBs. The configuration of the interconnect is achieved by turning ON n channel pass transistors. The state that determines a given interconnect pattern is held in the Static RAM cells distributed across the chip close to the controlled elements. The CLBs and routing channels are surrounded by a set of programmable Inputs / Outputs. PROGRAM: Verilog Code for Testing Onboard Switches and LEDs in FPGA
module buffer(a, y); input [7:0] a; 132
PROCEDURE: Software part 1. Click on the Xilinx ISE9.1i or Xilinx Project navigator icon on the desktop of PC. 2. Write the Verilog code by choosing HDL as top level source module. 3. Check syntax, view RTL schematic and note the device utilization summary by double clicking on the synthesis in the process window. 4. Perform the functional simulation using Xilinx ISE simulator. 5. Open a new UCF file and lock the pins of the design with FPGA I/O pins. 6. Implement the design by double clicking on the implementation tool selection. 7. Create programming file (i.e., bit file) for downloading into the specified device. Hardware part 1. Connect the power supply cable to the FPGA kit using power supply adapter. 2. Connect FPGA board to parallel port of PC using parallel port cable. 3. Connect FRC1 of FPGA board with the switches (i/ps) of GPIO card - II using FRC cable. 4. Connect FRC2 of FPGA board with the LEDs (o/ps) of GPIO card - II using FRC cable.
133
SYNTHESIS REPORT: Device Utilization Summary (estimated values) Logic Utilization Number of Slices Number of bonded IOBs Used 0 16 Available 3584 97 Utilization 0% 16%
SIMULATION REPORT:
RESULT:
Thus the onboard switches and LEDs were designed using Verilog HDL and it was simulated and tested in the FPGA device.
134
To design a Real Time Clock (2 digits, 7 segment LED displays each for Hours, Minutes and Seconds) and demonstrate its working on the FPGA Board. TOOLS REQUIRED: SOFTWARE: XILINX ISE 9.1i HARDWARE: XILINX - Spartan kit XC3S400TQ144, Power supply Adapter, Parallel port cable, FRC connector, AU card - I PROGRAM: Verilog Code for Real Time Clock
module real_time_clk_verilog (clk,clear,hour1,hour2,minute1,minute2,second1, second2, hour_A2, min_A1, sec_A0, load, data_in); input clk,clear; output reg [6:0]hour1,hour2,minute1,minute2,second1,second2; input load; input hour_A2,min_A1,sec_A0; input [7:0]data_in; reg clk_sec,clk_msec; reg [7:0]sec,min,hr; integer timer_count1=0,timer_count2=0; always@(posedge clk) begin if(timer_count1==3999) begin timer_count1=0; clk_msec=1'b1; end else begin timer_count1=timer_count1+1; clk_msec=1'b0; end end always@(posedge clk_msec) begin if(timer_count2==999) 135
begin timer_count2=0; clk_sec=1'b1; end else begin timer_count2=timer_count2+1; clk_sec=1'b0; end end always@(negedge clk_sec) begin if(~clear) begin sec=0; min=0; hr=0; end else if(~load) begin if(hour_A2) begin if(hr[7:4] == 4'b0010) begin if(hr[3:0] < 4'b0100) hr = data_in; end else if(hr[7:4] < 4'b0010) hr = data_in; else hr = 8'b0; end if(min_A1) begin if(min[7:4] < 4'b0110) min = data_in; else min = 8'b0; end if(sec_A0) begin if (sec[7:4] < 4'b0110) sec = data_in; else sec = 8'b0; end end else begin 136
if(sec[3:0]==4'b1001) begin sec[3:0]=4'b0; if(sec[7:4]==4'b0101) begin sec[7:4]=4'b0; if(min[3:0]==4'b1001) begin min[3:0]=4'b0; if(min[7:4]==4'b0101) begin min[7:4]=4'b0; if(hr==8'b00100011) hr=0; else if(hr[3:0]==4'b1001) begin hr[3:0]=4'b0; hr[7:4]=hr[7:4]+1; end else hr[3:0]=hr[3:0]+1; //hours count completed end else min[7:4]=min[7:4]+1; end else min[3:0]=min[3:0]+1; // minutes count completed end else sec[7:4]=sec[7:4]+1; end else sec[3:0]=sec[3:0]+1; //seconds count completed end end always@(sec) begin case (sec[3:0]) 4'b0000: second1=7'b1111110; 4'b0001: second1=7'b0110000; 4'b0010: second1=7'b1101101; 4'b0011: second1=7'b1111001; 4'b0100: second1=7'b0110011; 4'b0101: second1=7'b1011011; 4'b0110: second1=7'b1011111; 4'b0111: second1=7'b1110000; 4'b1000: second1=7'b1111111; 4'b1001: second1=7'b1111011; default: second1=7'b0; 137
endcase end always@(sec) begin case(sec[7:4]) 4'b0000: second2=7'b1111110; 4'b0001: second2=7'b0110000; 4'b0010: second2=7'b1101101; 4'b0011: second2=7'b1111001; 4'b0100: second2=7'b0110011; 4'b0101: second2=7'b1011011; 4'b0110: second2=7'b1011111; 4'b0111: second2=7'b1110000; 4'b1000: second2=7'b1111111; 4'b1001: second2=7'b1111011; default: second2=7'b0; endcase end always@(min) begin case(min[3:0]) 4'b0000: minute1=7'b1111110; 4'b0001: minute1=7'b0110000; 4'b0010: minute1=7'b1101101; 4'b0011: minute1=7'b1111001; 4'b0100: minute1=7'b0110011; 4'b0101: minute1=7'b1011011; 4'b0110: minute1=7'b1011111; 4'b0111: minute1=7'b1110000; 4'b1000: minute1=7'b1111111; 4'b1001: minute1=7'b1111011; default: minute1=7'b0; endcase end always@(min) begin case(min[7:4]) 4'b0000: minute2=7'b1111110; 4'b0001: minute2=7'b0110000; 4'b0010: minute2=7'b1101101; 4'b0011: minute2=7'b1111001; 4'b0100: minute2=7'b0110011; 4'b0101: minute2=7'b1011011; 4'b0110: minute2=7'b1011111; 4'b0111: minute2=7'b1110000; 4'b1000: minute2=7'b1111111; 4'b1001: minute2=7'b1111011; default: minute2=7'b0; endcase 138
end always@(hr) begin case(hr[3:0]) 4'b0000: hour1=7'b1111110; 4'b0001: hour1=7'b0110000; 4'b0010: hour1=7'b1101101; 4'b0011: hour1=7'b1111001; 4'b0100: hour1=7'b0110011; 4'b0101: hour1=7'b1011011; 4'b0110: hour1=7'b1011111; 4'b0111: hour1=7'b1110000; 4'b1000: hour1=7'b1111111; 4'b1001: hour1=7'b1111011; default: hour1=7'b1111110; endcase end always@(hr) begin case(hr[7:4]) 4'b0000: hour2=7'b1111110; 4'b0001: hour2=7'b0110000; 4'b0010: hour2=7'b1101101; default: hour2=7'b1111110; endcase end end module
139
"hour2<6>" LOC = "p93" ; "hour_A2" LOC = "p78" ; "load" LOC = "p83" ; "min_A1" LOC = "p82" ; "minute1<0>" LOC = "p14" ;
"second2<2>" LOC = "second2<3>" LOC = "second2<4>" LOC = "second2<5>" LOC = "second2<6>" LOC =
PROCEDURE: Software part 1. Click on the Xilinx ISE9.1i or Xilinx Project navigator icon on the desktop of PC. 2. Write the Verilog code, check syntax, view RTL schematic and note the device utilization summary by double clicking on the synthesis in the process window. 3. Open a new UCF file and lock the pins of the design with FPGA I/O pins. 4. Implement the design by double clicking on the implementation tool selection. 5. Create programming file (i.e., bit file) for downloading into the device. Hardtware part Connect the power supply cable to the FPGA kit using power supply adapter. Connect the FPGA kit to the parallel port of the PC through the cable provided along with the kit. Connect FRC1 of main board to CN8 of AU card - I using FRC cable. Connect FRC2 of main board to CN7 of AU card - I using FRC cable. Connect FRC7 of main board to CN6 of AU card - I using FRC cable. Connect FRC10 of main board to CN1 of AU card - I using FRC cable. Connect FRC5 of main board to CN2 of AU card - I using FRC cable. Connect FRC8 of main board to CN3 of AU card - I using FRC cable. Working: Connections are made as above and implement the design into the FPGA device and the REAL TIME clock is ON, all 7 segments displays will be in ON position and starts counting, the time can be set by the switches SW0 SW7 using A2, A1, A0 switches in card - I and the RESET pin RESETS the clock.
140
SYNTHESIS REPORT: Device Utilization Summary (estimated values) Logic Utilization Number of Slices Number of Slice Flip Flops Number of 4 input LUTs Number of bonded IOBs Number of GCLKs Used 98 90 189 56 3 Available 3584 7168 7168 97 8 Utilization 2% 1% 2% 57% 37%
RESULT:
Thus the real time clock was designed using verilog code and its working was demonstrated in FPGA board.
141
To design a Traffic Light Controller using Verilog code and to test its working on the FPGA Board. TOOLS REQUIRED: SOFTWARE: XILINX ISE 9.1i HARDWARE: XILINX - Spartan kit XC3S400TQ144, Power supply Adapter, Parallel port cable, FRC connector, AU card - II PROGRAM: Verilog Code for Traffic Light Controller
module traffic_verilog(seg_1,seg_2,R1,R2,R3,G1,G2,G3,Y1,Y2,Y3,PR,PG,clk,rst); output reg R1,R2,R3,G1,G2,G3,Y1,Y2,Y3,PR,PG; output reg [6:0]seg_1,seg_2; input clk,rst; integer timer_count1 = 0,timer_count2 = 0; reg clk_msec,clk_sec; reg [7:0]count; reg [1:0]state = 2'b0; always@(posedge clk) begin if(timer_count1==3999) begin timer_count1=0; clk_msec=1'b1; end else begin timer_count1=timer_count1+1; clk_msec=1'b0; end end always@(posedge clk_msec) begin if(timer_count2==999) begin timer_count2=0; 142
clk_sec=1'b1; end else begin timer_count2=timer_count2+1; clk_sec=1'b0; end end always@(posedge clk_sec) begin if(~rst) begin R1 = 1'b1; G1 = 1'b0; Y1 = 1'b0; R2 = 1'b1; G2 = 1'b0; Y2 = 1'b0; R3 = 1'b1; G3 = 1'b0; Y3 = 1'b0; state=2'b00; end else begin case(state) 2'b00://SIGNAL AT SIGNAL LIGHTS ONE begin if(count==8'b00100101) begin G1 = 1'b0; R1 = 1'b0; Y1 = 1'b1; R3 = 1'b0; Y3 = 1'b0; G3 = 1'b0; end if(count==8'b00101001) begin G1 = 1'b1; Y1 = 1'b0; R3 = 1'b1; state=2'b01; end else state=2'b00; end 2'b01://SIGNAL AT SIGNAL LIGHTS TWO begin if(count==8'b00100101) begin Y1 = 1'b1; G1 = 1'b0; R3 = 1'b1; R2 = 1'b0; 143
Y2 = 1'b1; G2 = 1'b0;
R1 = 1'b1; Y1 = 1'b0; Y2 = 1'b0; G2 = 1'b1; state = 2'b10; end else state=2'b01; end 2'b10://SIGNAL AT SIGNAL LIGHTS THREE begin if(count==8'b00100101) begin Y2 = 1'b1; G2 = 1'b0; R3 = 1'b0; Y3 = 1'b1; G3 = 1'b0; end if(count==8'b00101001) begin R2 = 1'b1; Y2 = 1'b0; Y3 = 1'b0; G3 = 1'b1; state = 2'b11; end else state=2'b10; end 2'b11://ALL SIGNAL HIGH TO ALLOW PEDESTRIALS TO CROSS begin if(count==8'b00100101) begin Y1= 1'b0; Y3 = 1'b1; G3 = 1'b0; end if(count==8'b00101001) begin Y1 =1'b0; R3 = 1'b1; Y3 = 1'b0; state = 2'b00; end 144
else state=2'b11; end endcase end end always@(count,state) begin if((state==2'b00)&&(count<=8'b00101001)) begin PR = 1'b1; PG = 1'b0; end else begin PR = 1'b0; PG = 1'b1; end end always@(posedge clk_sec) begin if(rst==1'b0) count=8'b00000000; else if(clk_sec) begin if(count[3:0]==4'b1001) begin count[3:0]=4'b0000; if(count[7:4]==4'b0010) count[7:4]=4'b0000; else else end end end count[3:0]=count[3:0]+1; count[7:4]=count[7:4]+1;
always@(count) begin case(count[3:0]) 4'b0000:seg_1 = 8'b1111110; //0 4'b0001:seg_1 = 8'b0110000; 4'b0010:seg_1 = 8'b1101101; 4'b0011:seg_1 = 8'b1111001; 4'b0100:seg_1 = 8'b0110011; 4'b0101:seg_1 = 8'b1011011; 4'b0110:seg_1 = 8'b1011111; 4'b0111:seg_1 = 8'b1110000; 145
end endmodule NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET NET
4'b1000:seg_1 = 8'b1111111; //8 4'b1001:seg_1 = 8'b1111011; //9 default:seg_1 = 8'b0000000; //off endcase case(count[7:4]) 4'b0000:seg_2 = 8'b1111110; //0 4'b0001:seg_2 = 8'b0110000; //1 4'b0010:seg_2 = 8'b1101101; //2 4'b0011:seg_2 = 8'b1111001; //3 4'b0100:seg_2 = 8'b0110011; //4 4'b0101:seg_2 = 8'b1011011; //5 4'b0110:seg_2 = 8'b1011111; //6 4'b0111:seg_2 = 8'b1110000; //7 4'b1000:seg_2 = 8'b1111111; //8 4'b1001:seg_2 = 8'b1111011; //9 default:seg_2 = 8'b0000000; //off endcase
; ; ; ; ; ; ; ; ; ; ; ; ;
146
PROCEDURE: Software part 1. Click on the Xilinx ISE9.1i or Xilinx Project navigator icon on the desktop of PC. 2. Write the Verilog code, check syntax, view RTL schematic and note the device utilization summary by double clicking on the synthesis in the process window. 3. Open a new UCF file and lock the pins of the design with FPGA I/O pins. 4. Implement the design by double clicking on the implementation tool selection. 5. Create programming file (i.e., bit file) for downloading into the device.
Hardware part Connect the power supply cable to the FPGA kit using power supply adapter. Connect the FPGA kit to the parallel port of the PC through the cable provided along with the kit. Connect FRC1 of main board to CN2 of AU card - II using FRC cable. Connect FRC8 of main board to CN3 of AU card - II using FRC cable. Connect FRC5 of main board to CN1 of AU card - II using FRC cable. Working: 1. Connections are made as above and implement the design into the FPGA device and the Traffic Light Controller (AU card II) will be ON. 2. Initially, the Pedestrians on all the three signals will be in GREEN for 30 seconds to allow the Pedestrians to pass through. 3. After 30 seconds, the pedestrian goes to RED and the GREEN in signal1 goes ON for 25 seconds. 4. After 25 seconds, the YELLOW will be ON for 5 seconds and then it goes to RED, simultaneously the GREEN in signal2 will be ON.
147
5. Similar procedure is repeated for all the signals. Then the procedure is repeated again by switching the GREEN in all the Pedestrians. SYNTHESIS REPORT: Device Utilization Summary (estimated values) Logic Utilization Number of Slices Number of Slice Flip Flops Number of 4 input LUTs Number of bonded IOBs Number of GCLKs Used 78 87 151 27 3 Available 3584 7168 7168 97 8 Utilization 2% 1% 2% 27% 37%
RESULT: Thus the traffic light controller was designed using verilog code and its working was tested in FPGA board.
148