Vous êtes sur la page 1sur 15

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA


1. Objectif :
Concevoir, simuler, tester et les implmenter sur une cible CPLD/FPGA en utilisant lenvironnement de Quartus II, les
circuits de la logique combinatoire suivants :
Additionneur (Adder)
Soustracteur (Subtractor)
Comprateur (Comparator)
Encodeur (Encoder)
Dcodeur (Decoder)
Multiplexeur (MUX)
Dmultiplexeur (DMUX)

2. Activits pratiques
Activit pratique 1 : Additionneur (Adder)
Now, we proceed to the design, simulation and test of Full Adder. The circuit specification of Full adder is circuit
includes three inputs (A, B, and Cin), one Sum output and Cout output.

Truth table of Full Adder

Circuit diagrams and symbol by using graphic entries (fulladd.gdf)

Edition du schma bloc dun design


1.
2.
3.
4.

Crer un nouveau projet, puis un nouveau fichier Schmatique. Editer le schma bloc de ladditionneur complet.
Enregistrez puis compilez votre projet.
Ouvrez un nouveau fichier de simulation et ajouter les pins au fichier.
Lancez la simulation.

Simulation result of fulladd.gdf circuit (documentfulladd.wvf)


Par M. JAROU

1|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Implmentation sur la cible CPLD :


1.
2.

Ajouter un etage pour maintenir letat haut de la cathode commune des LEDs dans le fichier Schematic.
Recompilez et ouvrez lutilitaire dassignation de pins. Lassignation se fera selon le tableau suivant :
Entres/Sorties du design
PIN de CPLD
A
47
B
48
Cin
49
Sum
7
Cout
8
LED_COM
141
Assignement de Pin de EPF10K30ATC144-3

3.

Maintenant vous pouvez charger votre programme dans votre carte CPLD.

Edition du code VHDL du design


1.
2.
3.

Editer le code VHDL du design Enregistrer et compiler votre code.


Faire lassignation des pins comme vue prcdemment et recompilez votre code.
Envoyez le code vers votre carte de dveloppement CPLD.

Activit pratique 2 : Additionneur de 4bits (Ripple Carry Adder 4 Bytes)


In primary two sections, the adder only deals with add of one-bit, but actual circuit usual completes addition of four-bit and
beyond four-bit. In multiple bits addition, if carry bit of each addition state uses carry out of previous addition stage. This is
called Ripple Carry Adder as following figure.

Circuit diagrams of Ripple Carry Adder by using graphic entries (documentrip_add.gdf)

Edition du schma bloc dun design


1.
2.
3.
4.

Crer un nouveau projet, puis un nouveau fichier Schmatique. Editer le schma bloc de ladditionneur 4bits.
Enregistrez puis compilez votre projet.
Ouvrez un nouveau fichier de simulation et ajouter les pins au fichier.
Lancez la simulation :

Simulation result of circuit rip_add.gdf (documentrip_add.wvf)

Par M. JAROU

2|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Implmentation sur la cible CPLD :


1.
2.

Ajouter un etage pour maintenir letat haut de la cathode commune des LEDs dans le fichier Schematic.
Recompilez et ouvrez lutilitaire dassignation de pins. Lassignation se fera selon le tableau suivant :
Entres/Sorties du design
PIN de CPLD
A0, A1, A2, A3
68, 67, 65, 64
B0, B1, B2, B3
81, 80, 79, 78
S0, S1, S2, S3
11, 10, 9, 8
C4
7
LED_COM
141
Assignement de Pin de EPF10K30ATC144-3

3.

Maintenant vous pouvez charger votre programme dans votre carte CPLD.

Activit pratique 4 : Soustracteur de 4 bits (Substractor)


The all new digital system use 2s complement system. In other words, we can use 2s complement addition to complete
subtraction. The 2s complement can been completed by 1s complement plus one. So 2s complement of B can be
completed by taking NOT from B0B3 and setting C0 to 1.

Circuit of 2s Complement Subtractor (documentcompsub.gdf)

Edition du schma bloc dun design


1.
2.
3.
4.

Crer un nouveau projet, puis un nouveau fichier Schmatique. Editer le schma bloc du soustracteur de bits.
Enregistrez puis compilez votre projet.
Ouvrez un nouveau fichier de simulation et ajouter les pins au fichier.
Lancez la simulation :

Simulation result of circuit 2s Complement Substracter (documentcompsub.wvf)

Implmentation sur la cible CPLD :


1.
2.

Ajouter un etage pour maintenir letat haut de la cathode commune des LEDs dans le fichier Schematic.
Recompilez et ouvrez lutilitaire dassignation de pins. Lassignation se fera selon le tableau suivant :
Entres/Sorties du design
PIN de CPLD
A0, A1, A2, A3
68, 67, 65, 64
B0, B1, B2, B3
81, 80, 79, 78
S0, S1, S2, S3
11, 10, 9, 8
C4
7
LED_COM
141
Assignement de Pin de EPF10K30ATC144-3

3.

Maintenant vous pouvez charger votre programme dans votre carte CPLD.

Par M. JAROU

3|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Edition du code VHDL du design


1.
2.

Editer le code VHDL du design. Enregistrer et compiler votre code.


Faire lassignation des pins comme vue prcdemment et recompilez votre code.

Activit pratique 4 : Comparateur (Comparator)


The comparator decides the relationship between input A and input B. It compares input of two n-bit binary number and
produces three possible relation outputs (G, Eand L).

Circuit of Comparator by using graphic entries (documentcompr.gdf)

Edition du schma bloc dun design


1.
2.
3.
4.

Crer un nouveau projet, puis un nouveau fichier Schmatique. Editer le schma bloc du comparateur de mots de 2bits.
Enregistrez puis compilez votre projet.
Ouvrez un nouveau fichier de simulation et ajouter les pins au fichier.
Lancez la simulation :

Simulation result of circuit compr.gdf (documentcompr.wvf)

Par M. JAROU

4|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Implmentation sur la cible CPLD :


1.
2.

Ajouter un etage pour maintenir letat haut de la cathode commune des LEDs dans le fichier Schematic.
Recompilez et ouvrez lutilitaire dassignation de pins. Lassignation se fera selon le tableau suivant :
Entres/Sorties du design
PIN de CPLD
X0
48
X1
47
Y0
63
Y1
62
G
7
E
8
L
9
LED_COM
141
Assignement de Pin de EPF10K30ATC144-3

3.

Maintenant vous pouvez charger votre programme dans votre carte CPLD.

Edition du code VHDL du design


1.
2.

Editer le code VHDL du design Enregistrer et compiler votre code.


Faire lassignation des pins comme vue prcdemment et recompilez votre code.

Activit pratique 4 : Encodeur (Encoder)


Because the memory cell of calculator is 2-state memory way, the calculator external character set (alphabet, numeric and
symbol) need to encode by binary, then save in memory. This encoding movement usual needs encoding circuit to finish.
On the other hand, the encoded code which get from memory need to be decoded for output in its original form.
The following figure illustrates the procedure from input, save in binary, process and output data. Generally, the character
set not only express in binary, but also binary encoding. The reason is reduced binary bit length.
We see this situation from the following table, the binary of alphabetic character set09 need ten-bit and binary
encoding only need four-bit.

Input, save in binary, process and output data process flows.


Compare binary expression of alphabet character set 09 with binary encoding of alphabet character set 09

Truth table of Encoder

Par M. JAROU

5|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

The application of key binary encoding after binary


expression

Truth table of Encoder

Circuit of Encoder by using graphic entries (documentencod10.gdf)

Edition du schma bloc dun design


5.
6.
7.
8.

Crer un nouveau projet, puis un nouveau fichier Schmatique. Editer le schma bloc de lencodeur.
Enregistrez puis compilez votre projet.
Ouvrez un nouveau fichier de simulation et ajouter les pins au fichier.
Lancez la simulation :

Par M. JAROU

6|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Simulation result of circuit encod10.gdf (documentencod10.wvf)

Implmentation sur la cible CPLD :


1.
2.

Ajouter un etage pour maintenir letat haut de la cathode commune des LEDs dans le fichier Schematic.
Recompilez et ouvrez lutilitaire dassignation de pins. Lassignation se fera selon le tableau suivant :

Assignement de Pin de EPF10K30ATC144-3


3.

Maintenant vous pouvez charger votre programme dans votre carte CPLD.

Edition du code VHDL du design


1.
2.

Editer le code VHDL du design Enregistrer et compiler votre code.


Faire lassignation des pins comme vue prcdemment et recompilez votre code.

Activit pratique 4 : Dcodeur (Encoder)


An n bit to 2n Decoder can decode n bits to 2n data. The following figure is an application decoder drives 16 LEDs. We see
each LED connecting current-limit resistor and showing common anode connected. So the Decoder output 0 can cause
LED on and bright. Because it is input 0101, the sixth LED is bright.

1) Dcodeur 4 vers 16(4 to 16 Decoder)

Four-bit encoder drives 16 LEDs


Truth table of Decoder

Par M. JAROU

7|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Circuit of Decoder by using graphic entries (documentdec4x16.gdf)

2) Dcodeur BCD/7segments vers 16(BCD to 7 Segment Decoder)


7-segment display constitutes by seven rectangle LED as following , but some right-bottom of 7-segment displays have one
circle LED. In digital circuit, 7-segment display is passive component and use frequently. 7-segment display can be divided
into common anode structure and common cathode structure. If we use common anode 7-segment display, we to connect
common anode to VCC and need input 0, then corresponding rectangle LED will on and bright. The bright electric
current is supplied by Vcc. Contrary, If we use common cathode 7-segment display, we need to connect common cathode
to ground and input 1, then corresponding rectangle LED will be on and bright.

Exterior and category of 7-segment display

Par M. JAROU

8|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Decoder codes of 0~9 for 7-segment display

Truth table of 7-segment display Decoder with value 0 to 9

Par M. JAROU

9|Page

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Circuit of Decoder by using graphic entries (documentseg7dec.gdf)

Edition du schma bloc dun design


9.

Crer un nouveau projet, puis un nouveau fichier Schmatique. Editer le schma bloc du dcodeur 4vers 16 et du
dcodeur BCD/7Segements.
10. Enregistrez puis compilez votre projet.
11. Ouvrez un nouveau fichier de simulation et ajouter les pins au fichier.
12. Lancez la simulation :

Simulation result of circuit dec4x16.gdf (documentdec4x16.wvf)

Simulation result of circuit seg7dec.gdf (documentseg7dec.wvf)

Implmentation sur la cible CPLD :


1.
2.

Ajouter un etage pour maintenir letat haut de la cathode commune des LEDs dans le fichier Schematic.
Recompilez et ouvrez lutilitaire dassignation de pins. Lassignation se fera selon le tableau suivant :

Pin assignment of EPF10K30ATC144-3 (Dcodeur 4 vers 16)

Par M. JAROU

10 | P a g e

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Assignement de PIN de EPF10K30ATC144-3 (Dcodeur BCD/7sements)


4.

Maintenant vous pouvez charger votre programme dans votre carte CPLD.

Edition du code VHDL du design


1.
2.

Editer le code VHDL du design Enregistrer et compiler votre code.


Faire lassignation des pins comme vue prcdemment et recompilez votre code.

Activit pratique 5 : Multiplexeur (Multiplexer)


The multiplexer is called data selector, following left of the following figure. The figure illustrated that select one of 2n
lines to Y output by n lines. The data lines which not be selected is not be output. Usually, MUX is defined by 2n to 1.
In this
section, we
perform the
design of 8 to
1 MUX. The
selection line
includes three
due to 8
equal to 23.
Functional
diagrams of
MUX and
DMUX

Truth table of MUX

Par M. JAROU

11 | P a g e

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Circuit of MUX by using graphic entries (documentmux81.gdf)

Edition du schma bloc dun design


1.
2.
3.
4.

Crer un nouveau projet, puis un nouveau fichier Schmatique. Dessiner le schma bloc dun multipmexeur..
Enregistrez puis compilez votre projet.
Ouvrez un nouveau fichier de simulation et ajouter les pins au fichier.
Lancez la simulation :

Simulation result of circuit mux81.gdf (documentmux81.wvf)

Par M. JAROU

12 | P a g e

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Implmentation sur la cible CPLD :


1.
2.

Ajouter un etage pour maintenir letat haut de la cathode commune des LEDs dans le fichier Schematic.
Recompilez et ouvrez lutilitaire dassignation de pins. Lassignation se fera selon le tableau suivant :

Assignement de PIN de EPF10K30ATC144-3 (Dcodeur BCD/7sements))


3.

Maintenant vous pouvez charger votre programme dans votre carte CPLD.

Edition du code VHDL du design


1.
2.

Editer le code VHDL du design Enregistrer et compiler votre code.


Faire lassignation des pins comme vue prcdemment et recompilez votre code.

Activit pratique 6 : Demultiplexeur (Demultiplexer)


The demultiplexer is called data distributor, right of the following figure. The figure illustrated that Y will be distributed to
one of 2n line by n lines. The data lines which not be selected is not be output. Usually, DMUX defined by 1 to 2 n.
In this section, we perform the design of 1 to 8 DMUX. The choice line includes three due to 8 equals to 2 3.

Functional diagrams of MUX and DMUX

Truth table of DMUX (D is data of input end)

Par M. JAROU

13 | P a g e

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Circuit of DMUX by using graphic entries (documentdmux18.gdf)

Edition du schma bloc dun design


1.
2.
3.
4.

Crer un nouveau projet, puis un nouveau fichier Schmatique. Dessiner le schma bloc du dmultipmexeur.
Enregistrez puis compilez votre projet.
Ouvrez un nouveau fichier de simulation et ajouter les pins au fichier.
Lancez la simulation :

Simulation result of circuit dmux18.gdf (documentdmux18.wvf)

Implmentation sur la cible CPLD :


1.
2.
3.

Ajouter un etage pour maintenir letat haut de la cathode commune des LEDs dans le fichier Schematic.
Recompilez et ouvrez lutilitaire dassignation de pins. Lassignation se fera selon le tableau suivant :
Maintenant vous pouvez charger votre programme dans votre carte CPLD.

Par M. JAROU

14 | P a g e

TP N2 : Circuits combinatoires sous Quartus II CPLD/FPGA

Assignement de PIN de EPF10K30ATC144-3

Edition du code VHDL du design


3.
4.

Editer le code VHDL du design Enregistrer et compiler votre code.


Faire lassignation des pins comme vue prcdemment et recompilez votre code.

Par M. JAROU

15 | P a g e

Vous aimerez peut-être aussi