Building A MUX-DEMUX Circuit Lab: Overview
Building A MUX-DEMUX Circuit Lab: Overview
Overview:
In this lab you will learn how to model a combinatorial circuit using mixed-modeling
style of Verilog HDL.
Outcome:
You will understand how to model a combinatorial circuit using various modeling styles
available in Verilog HDL. You will learn how to create a model using ISE create project
wizard. You will instantiate lower-level models to create a bigger model. You will use
ISE simulator to simulate the design. You will add user constraint file (ucf) to assign
pins so the design can be targeted to National Instruments (NI) Digital Electronics FPGA
Board. You will implement the design and create a bitstream file using ISE’s
implementation tools. Once bitstream is created, you will download using ISE’s
iMPACT program and verify the design functionality.
References:
1. National Instruments’ Digital Electronics FPGA Board user manual
2. Verilog HDL books
Stephen Brown, Zvonko G. Vranesic, “Fundamentals of Digital Logic with Verilog Design”, 2002
Zainalabedin Navabi, “Verilog Digital Systems Design: RT Level Synthesis, Testbench, and
Verification”, 2005
Samir Paltinkar, “Verilog HDL: A Guide to Digital Design and Synthesis”, 2003
Joseph Cavanagh, “Verilog HDL: Digital Design and Modeling”, 2007
Michael D. Ciletti, “Modeling, Synthesis, and Rapid Prototyping with Verilog HDL”, 2003
Douglas J. Smith, “HDL Chip Design: A Practical Guide for Designing, Synthesizing and Simulating
ASICs and FPGAs using VHDL or Verilog”, 1996
3. On-line references:
Verilog HDL Reference Card: http://www.stanford.edu/class/ee183/
handouts_win2003/VerilogQuickRef.pdf
Problem Statement:
Design a combinatorial multiplexer-demultiplexer circuit using gate-level, data-flow, and
behavioral modeling styles. The multiplexer you will design will be 4-to-1 and the
demultiplexer will be 2-to-4, requiring eight inputs which you will provide using
switches. You will use BTN0 to select either output of the multiplexer or demultiplexer.
When depressed you will output demultiplexer output otherwise multiplexer output.
Implementation:
The circuit to be designed consists of two functional blocks: mux and demux. They can
be modeled using behavioral modeling style. The output selection can be implemented
using continuous assignment statements. The hierarchical block diagram of the complete
system is shown below.
mux_demux_top.v
BTN0
mux.v
SW0
SW1
SW2
SW3 sel0 sel1 4 4
SW4
SW5
SW6
SW7
combinatorial block
demux.v
Procedure:
Extract resources.zip file in c:\NI\Verilog_Labs folder
1. Create a ISE project
• Launch ISE: Select Start → Programs → Xilinx ISE Design Suite 10.1 →
ISE → Project Navigator
• In the Project Navigator, select File → New Project. The New Project Wizard
opens
• For Project Location, use the “…” button to browse to C:\NI\Verilog_labs, and
then click OK
• For Project Name, type muxdemux_lab
• Click Next
• Select the following options and click Next
• Select all three verilog files (mux.v, demux.v, and mux_demux.v) and click
Open
• Click OK to add the three files
• Expand the mux_demux entry in Sources window and observe the lower-level
modules
• Create a new blank file and enter the following location constraints
• Save and close the file, giving mux_demux.ucf as the filename and
UCF(*.ucf) as the Save as type:
• Double-click on the Place & Route report to view the report. Look at the
resource utilization and note that 3 slices are being used
• You can see similar information by clicking on Design Summary tab and
looking at the various information
Conclusion:
In this lab exercise you learned how to model a combinatorial circuit using mixed-
modeling styles of Verilog HDL. You were able to simulate the design and then verify
the complete design in hardware board.