Professional Documents
Culture Documents
Aim: To Perform Simulation and Synthesis of 4:1 Multiplexer and 1:4 De-Multiplexer Using
Aim: To Perform Simulation and Synthesis of 4:1 Multiplexer and 1:4 De-Multiplexer Using
Brief theory:
4:1 Multiplexer:
S1 S0 Y
0 0 I0
0 1 I1
1 O I2
1 1 I3
1:4 Demultiplexer:
A demultiplexer, sometimes abbreviated demux, is a circuit that has one input and more than
one output. It is used when a circuit wishes to send a signal to one of many devices. This
description sounds similar to the description given for a decoder, but a decoder is used to select
among many devices while a demultiplexer is used to send a signal among many devices.
In1:4 Demux, at any one instance, one signal can be send on any of four devices available
since it has one input which can be diverted over four outputs which are further used to drive
four devices.
The block schematic of 1:4 Demux is as shown below:
Din= Y0 S1barS0bar
Din= Y1S1bar S0
Din=Y2S1S0bar
Din=Y3S1S0
Procedure:
A. Synthesis:
1. Right click on the desktop, select the open terminal option, new window wil
appear.
2. Type csh then press enter.
3. Type imstat. It is used to check whether system is connected or not.
4. Type Vsim and enter.
5. New window will appear, open the file and then create the new project.
6. Give the name to the project.
7. Then add item to the project.
8. Create a new file, the name of file should be same as module name.
9. Add file type Verilog
10. Double click on file name.
11. Define your program in the new window appeared.
12. Compile the program to check whether it will work or not.
B. Simulation:
1. Right click on the desktop, select the open terminal option, new window will be
appear.
2. Type csh then press enter.
3. Type precision then press enter.
4. Precision window will open then click on add input files.
5. Add the hex file that you want to synthesize.
6. Click on compile button.
7. After successful compilation, click on Synthesize.
8. Force binary values to all input signals & add waveforms to output signals.
9. The output window will appear with different reports in drop down box.
10. Check the RTL schematic.
11. Open the Area Report to check the usage done by the program.
Code:
4:1 Multiplexer:
1:4 Demultiplexer:
module demux(i,s1,s0,y0,y1,y2,y3);
input i,s1,s0;
output y0,y1,y2,y3;
wire l, m;
assign l=~s1;
assign m=~s0;
assign y0=l&m&i;
assign y1=l&s0&i;
assign y2=s1&m&i;
assign y3=1&s0&i;
endmodule
Waveform:
4:1 Multiplexer:
1:4 Demultiplexer:
RTL Schematic:
4:1 Multiplexer:
1:4 Demultiplexer:
Area Report:
4:1 Multiplexer:
***************************************************************
Device Utilization for 3S100EVQ100
***************************************************************
Resource Used Avail Utilization
---------------------------------------------------------------
IOs 7 66 10.61%
Global Buffers 0 24 0.00%
LUTs 2 1920 0.10%
CLB Slices 1 960 0.10%
Dffs or Latches 0 2052 0.00%
Block RAMs 0 4 0.00%
Block Multipliers 0 4 0.00%
---------------------------------------------------------------
*********************************************
Library: work Cell: mux View: INTERFACE
*********************************************
Cell Library References Total Area
IBUF xis3e 6x
LUT3 xis3e 2x 1 2 LUTs
MUXF5 xis3e 1x 1 1 MUXF5
OBUF xis3e 1x
Number of ports : 7
Number of nets : 16
Number of instances : 10
Number of references to this view : 0
1:4 Demultiplexer:
***************************************************************
Device Utilization for 3S100EVQ100
***************************************************************
Resource Used Avail Utilization
---------------------------------------------------------------
IOs 7 66 10.61%
Global Buffers 0 24 0.00%
LUTs 4 1920 0.21%
CLB Slices 2 960 0.21%
Dffs or Latches 0 2052 0.00%
Block RAMs 0 4 0.00%
Block Multipliers 0 4 0.00%
---------------------------------------------------------------
***********************************************
Library: work Cell: demux View: INTERFACE
***********************************************
Cell Library References Total Area
IBUF xis3e 3x
LUT2 xis3e 1x 1 1 LUTs
LUT3 xis3e 3x 1 3 LUTs
OBUF xis3e 4x
Number of ports : 7
Number of nets : 14
Number of instances : 11
Number of references to this view : 0
Conclusion:
This experiment is to verify the working of one-to-many and many-to-one data routing
systems viz. multiplexer and de-multiplexer respectively. While writing a dataflow modeling
code, we used one new keyword wire is used to define intermediate connections of gates like
inversion.
The waveforms thus obtained clearly show the working of multiplexer and de-
multiplexer. For e.g. when s1=0 and s0=1, we got output y=current status of i1. For de-
multiplexer, when s1=0 and s0=1, the data input gets routed to output 2, i.e. y2=din. Further RTL
schematic shows the internal circuitry of both of the combinational circuits. Area report
emphasizes on the device utilization done by mux as well as de-mux.