Вы находитесь на странице: 1из 39

Verilog Lab

MdKhwajaMuinuddinChisti
chisti09@gmail.com
Ph:9573412381
Verilog HDL description of any circuit you will need to write a
modulewhich is the fundamental descriptive unit in Verilog.
A module is a set of text describing your circuit and is
enclosed by the keywords moduleand endmodule.
A program describes a physical circuit, for which we need to
specify the inputs, the outputs, the behavior of the circuit
and how the gates are wired.
To accomplish this, you need the keywords input, output,
and wire to define the inputs, outputs and the wiring
between the gates, respectively.
There are multiple ways to model a circuit
gate-level modeling,
dataflow modeling,
behavioral modeling,
or a combination of the above.
Single line comments begin with //
Multi-line comments are enclosed by /* */
Verilog is case sensitive.
Identifiers can describe multiple bits known as vectors.
[0:2] X it means we have three bits with the index 0
representing the MSB.
[2:0] X in this case the index 2 represents the MSB.
Identifier [7:0] X we can assign it values by
assign [7:0] X =8b00101011;
where the 8b specifies that we are defining an 8-bit binary
number and 00101011 is that 8-bit binary number.
we can also assign parts of the numberas assign [2:0] X =
3b101; assigns only the last three bits of X.
How to implement the circuits design on the
CPLD. Key steps are:
1. Write your program using Verilog HDL.
2. Compile your code.
3. Correct any syntax errors.
4. Simulate your circuit to make sure that you are
getting the behavior you expect.
5. Download your program onto the CPLD.
6. Test the operation of circuit.
To run the wave form, the following setting needed
1. Start> Run services.msc
2. Enable " WebClient" only.
3. Return ISE simulation, and
4. RerunSimulation Behavioral Model
Double click here
DIP Switch Output LEDs Seven Segment
Display
Clock and Reset Key
Function Pin
Number
Function Pin
Number
Function Pin
Number
Function Pin
Number
Function Pin
Number
IN1 4 LED1 8 SEG A 24 GCK1 5 KEY 35
IN2 3 LED2 9 SEG B 25 GCK2 6
IN3 2 LED3 11 SEG C 26 RESET 39
IN4 1 LED4 12 SEG D 27
IN5 7 LED5 13 SEG E 28
IN6 20 LED6 14 SEG F 29
IN7 22 LED7 18 SEG G 33
IN8 36 LED8 19 SEG DP 34
IN9 37 LED9 42
IN10 38 LED10 40
IN11 43
IN12 44
Hardware simulation
Jumper Settings
Extension Connector
Jumpers: J3 J7 J8
Short J3 and J7: To use input DIP
Switches IN5 to IN12
Jumper J6
Short 1 2: for 3.3V Operation
Short 2 3: for 5V Operation
Right click properties

Вам также может понравиться