Documente Academic
Documente Profesional
Documente Cultură
BANGLADESH UNIVERSITY OF ENGINEERING & TECHNOLOGY
EEE 304 : Digital Electronics Laboratory
EXPT NO. 6: DESIGN, SIMULATION AND TEST OF COMIBNATION
CIRCUITS USING VERILOG AND IMPLEMENTATION IN FPGA.
PRELAB
Submit your Prelab before starting the experiment.
1. Write verilog code of a 8/1 Multiplexer.
2. Write verilog code of a 1/8 Demultiplexer
3. Write the verilog code of BCD to Seven Segment Decoder
4. Write the verilog code of a 4 bit priority encoder with the MSB to LSB
bit in order of decreasing priority.
5. Is it possible to implement a demux using a decoder? If yes, how? If no,
why?
6. Is it possible to implement a mux using an encoder? If yes, how? If no,
why?
Problem 1
Write the verilog code of 8:1 multiplexer. Simulate and test the circuit using Quratus II
software. The timing diagram must be checked after Fitter and Assembler is run.
Implement the circuit in FPGA. Assign the pins according to the following table.
© A.B.M. Harunur Rashid 20/12/2006
1
Here S0,S1 and S2 are the select bit and D0..D7 are the input signal line and f is the
output signal.
Problem 2 Design, simulation and implementation of a 8/1 DEMUX
Write the verilog code of 1:8 demultiplexer. Simulate and test the circuit using Quratus
II software. The timing diagram must be checked after Fitter and Assembler is run.
Implement the circuit in FPGA. Assign the pins according to the following table
Here S0,S1 and S2 are the select bit and Y0..Y7 are the input signal and D is the output
signal.
Problem 3 Design, simulation, test and implementation of a 8 line MUXDEMUX
Write the verilog code of 8 input multiplexerdemultiplexer circuit. Simulate and test
the circuit using Quratus II software. The timing diagram must be checked after Fitter
and Assembler is run. Implement the circuit in FPGA. Assign the pins according to the
following table
© A.B.M. Harunur Rashid 20/12/2006
2
D5 Pin 60 (SW6) Y7 Pin 14 (L8)
D6 Pin 62 (SW7) LED_COM Pin 141
D7
Problem 4 Design, simulation , test and implementation of a BCD to Seven Segment
Decoder.
Write the verilog code of a BCD to Seven Segment decoder. Simulate and test the
circuit using Quratus II software. The timing diagram must be checked after Fitter and
Assembler is run. Implement the circuit in FPGA. Assign the pins according to the
following table.
Here BCD[0]..BCD[3] are the BCD input. A,B,C,D,E,F and G are the Seven LEDs of
the seven segment display.
The signals De1 De2 and De3 are connected to a 74138 3to8 Decoder whose fist six
outputs (Y0..Y6) are connected to the common cathodes of the six seven segment
display in LP2900 board. Assign De1=1 De2=0 and De3=1 so that the rightmost seven
segment display is activated. Test your decoder with all the BCD inputs.
Problem 5 Design, simulation , test and implementation of a Priority encoder.
Write the verilog code for the priority encoder defined in the following table
W3 W2 W1 W0 Y1 Y0 Z
0 0 0 0 d d 0
0 0 0 1 0 0 1
0 0 1 X 0 1 1
0 1 x X 1 0 1
1 x x x 1 1 1
Simulate and test the circuit using Quratus II software. The timing diagram must be
checked after Fitter and Assembler is run. Implement the circuit in FPGA.
REPORT
© A.B.M. Harunur Rashid 20/12/2006
3
For each of the four problems above provide the following in your report.
• The verilog source code of the problem.
• The simulated waveform done in Quartus II
• The data sheet with signature from the instructor.
• Discussions and comment
Reviewed By: Md. Imran Momtaz
© A.B.M. Harunur Rashid 20/12/2006
4