Professional Documents
Culture Documents
Lab 1
Lab 1
Rule: If both the inputs are 1, then output will be 1, otherwise output will be 0. (If any input is 0
then output will be 0, otherwise output is 1)
2. Truth Table:
X Y Z = X and Y
0 0 0
0 1 0
1 0 0
1 1 1
- In the main Quartus Prime window, select File > New > Verification/Debugging Files > University
Program VWF to open the Simulation Waveform Editor.
- Set the desired simulation to run from 0 to 200 ns by selecting Edit > Set End Time and entering 200 ns
in the dialog box that pops up. Selecting View > Fit in Window displays the entire simulation range of 0
to 200 ns in the window.
- Include the input and output nodes of the circuit to be simulated: Click Edit > Insert > Insert Node or
Bus to open the Insert Node or Bus window
- Waveform:
Specify the logic values to be used for the input signals X and Y during simulation and the logic
values at the output Z will be generated automatically by the simulator.
- Performing the Simulation:
Typically, functional simulation is used to verify the functional correctness of a circuit as it is being
designed.
- At the end of the simulation, a second Waveform Editor window will open the results of the simulation
as illustrated in the figure below.
4. Verilog code:
module Assignment1_Verilog(X,Y,Z);
input X, Y;
output Z;
and a1(Z,X,Y);
endmodule
- Insert a new Verilog file into the project:
- Check whether the Verilog file is selected as Top Level Entry or not:
- Re-compiling the design:
- Performing the simulation for the Verilog file:
+ The name of the top level module (Verilog) is the same as the Verilog file’ name.
+ The name of inputs and outputs are the same as the name of inputs and outputs’ pins in the
block design file.