Sunteți pe pagina 1din 4

DEPARTMENT OF ELECTRICAL AND ELECTROINC ENGINEERING

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. 

Signal Pin of FPGA chip Signal Pin of FPGA chip


S0 Pin 67 (SW9) D0 Pin 47 (SW1)
S1 Pin 65 (SW10) D1 Pin 48 (SW1)
S2 Pin 64 (SW11) D2 Pin 49 (SW1)
D3 Pin 51 (SW1)
D4 Pin 59 (SW1)
D5 Pin 60 (SW1)
D6 Pin 62 (SW1)
D7 Pin 63 (SW1)
f Pin 7 (L1)
LED_COM Pin 141 

© A.B.M. Harun­ur 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

Signal Pin of FPGA chip Signal Pin of FPGA chip


S0 Pin 67 (SW9) D Pin 47 (SW1)
S1 Pin 65 (SW10) Y0 Pin 7 (L1)
S2 Pin 64 (SW11) Y1 Pin 8 (L2)
Y2 Pin 9 (L3)
Y3 Pin 10 (L4)
Y4 Pin 11 (L5)
Y5 Pin 12 (L6)
Y6 Pin 13 (L7)
Y7 Pin 14 (L8)
LED_COM Pin 141 

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 multiplexer­demultiplexer 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

Signal Pin of FPGA chip Signal Pin of FPGA chip


S0 Pin 67 (SW9)
S1 Pin 65 (SW10) Y0 Pin 7 (L1)
S2 Pin 64 (SW11) Y1 Pin 8 (L2)
D0 Pin 47 (SW1) Y2 Pin 9 (L3)
D1 Pin 48 (SW2) Y3 Pin 10 (L4)
D2 Pin 49 (SW3) Y4 Pin 11 (L5)
D3 Pin 51 (SW4) Y5 Pin 12 (L6)
D4 Pin 59 (SW5) Y6 Pin 13 (L7)

© A.B.M. Harun­ur 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. 

Signal Pin of FPGA chip Signal Pin of FPGA chip


BCD[0] Pin 51 (SW4) A Pin 23
BCD[1] Pin 49 (SW3) B Pin 26
BCD[2] Pin 48 (SW2) C Pin 27
BCD[3] Pin 47(SW1) D Pin 28
E Pin 29
F Pin 30 
G Pin 31
De1 Pin 33
De2 Pin 36
De3 Pin 37 

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. Harun­ur 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. Harun­ur Rashid                                                                                                      20/12/2006
4

S-ar putea să vă placă și