DSD Lab-2
DSD Lab-2
Design Lab # 2
Verilog: Data-Flow Modeling
Objective: Lab #2 will familiarize students with Data-Flow Modeling of digital
circuits in Verilog Programming Language. Students will also learn about writing
test-benches in Verilog for digital designs.
Complete your Lab Assignments in Lab .Submit your lab report to Lab Instructor.
(a). Create a new ModelSim project. Project will simulate a 1-bit Full Adder Module in Data-
flow Modeling
(b). Add new file of type Verilog to the project. Write Verilog module for 1-bit full adder in data
follow modeling in the file.
(c). Add new file of type Verilog to the same project. Write Stimulus module for testing and
verification of 1-bit full adder in the file. Stimulus module should instantiate the 1-bit full adder
module.
Give all possible input combinations to test 1-bit full adder module. Use the $monitor to display
all inputs and outputs of the design module.
(e). Compile the project and correct any syntax errors. Next simulate the project and display
results in output window. Also verify timing waveform in the timing window
2 Design of 4 to 1 MUX
(a). Create a new ModelSim project. Project will simulate a 4 to 1 MUX Module in Data-flow
Modeling
(b). Add new file of type Verilog to the project. Write Verilog module for 4 to 1 MUX in data
flow modeling in the file.
(c). Add new file of type Verilog to the same project. Write Stimulus module for testing and
verification of 4 to 1 MUX in the file. Stimulus module should instantiate the 4 to 1 MUX
module.
(d). Compile the project and correct any syntax errors. Next simulate the project and display
results in output window. Also verify timing waveform of output
Lab Assignment
Activity# 01
• Create a new project in ModelSim, add the files containing 1-bit full adder module and
Stimulus module to the project
• Compile and run the simulation of 1-bit adder in ModelSim
• Create a new project in ModelSim, add the files containing 4 to 1 MUX module and
Stimulus module to the project
• Compile and run the simulation of 4 to 1 MUX in ModelSim
• Display inputs and outputs of 1-bit full adder and 4 to 1 MUX and show results to Lab
Instructor
Activity# 02
• Write Verilog code in data flow modeling for 4-bit Full Adder Circuit. 4-bit adder
module will instantiate multiple instances of 1-bit Full adder designed in Task 1
• Write Stimulus module to verify your 4-bit full adder design. Stimulus module should
give 8 different inputs to 4-bit adder and display corresponding outputs using $monitor.
Also display output waveform
Activity#03
• Write Verilog Module for an 8 to 1 MUX in data flow modeling. 8 to 1 MUX module will
instantiate multiple instances of 4 to 1 MUX already implement in Task 1. Also add any
other required logic for 8 to 1 MUX
• Write Stimulus for 8 to 1 MUX in Verilog. Stimulus should check output for different
combinations of input & select lines to 8 to 1 MUX
Lab Check-Off
• Demonstrate your design and show outputs and wave window saved file for each Task
to Lab Instructor
Why?
Marks Obtained
Total Marks: 40
Marks Obtained
LABORATORY SKILLS ASSESSMENT (Cognitive)
Total Marks: 10
( If any )
Marks Obtained