Université Saad Dahlab blida Département d’Elécronique Module : VHDL-FPGA Maste
Université Saad Dahlab blida Département d’Elécronique Module : VHDL-FPGA Master 1 Electronique d’instrumentation Préparer par : Lamri yasmine 04/07/2020 1 Le 15/05/2020 DEVOIR N°1 I. EXERCICE N°1 le schéma d’un PLA (Programmable Logic Array) à 3 entrées A , B , C et deux sorties X et Y permettant de réaliser les fonctions suivantes : A B C X Y II. EXERCICE N°2 a) La Description VHDL par flot de données : Le programme on VHDL : CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; - - Description externe entity exo1_a is port( A,B,C :in std_logic ; S : out std_logic ); end exo1_a ; - - Description comportementale architecteure flot de données of exo1_a is begin S <= (A xor B) xor (B xor C); end flot de données ; 2 Compte Microsoft [Nom de la société] [Date] b) La Description VHDL comportementale sans process : la table de vérité : A B C A xor B B xor C S 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 1 0 1 1 0 0 1 1 1 1 1 0 0 0 S= ´ A ´ BC+ ´ A BC+A´ B ´ C+AB ´ C= ´ AC(B+´ B)+A ´ C(B+´ B) B+´ B=1 donc S= ´ AC+A ´ C=A⨁C Le programme CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; - - Description externe entity exo1_b1 is port( A,B,C :in std_logic ; S : out std_logic ); end exo1_b1 ; - - Description comportementale architecteure comp_ sans_ process of exo1_b1 is begin S <= ‘1’when(A=’0’and C=’1’) or (A=’1’and C=’0’) else ’0’ ; end comp_ sans_ process ; 2eme version : « sans process » Le programme 3 CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; - - Description externe entity exo1_b2 is port( A,B,C :in std_logic_vector ( 2 downto 0 ); S : out std_logic ); end exo1_b2 ; - - Description comportementale architecteure comp_ sans_ process of exo1_b2 is with A B C select begin S <= ‘1’ when ”001” ‘1’ when ”011” ‘1’ when ”100” ‘1’ when ”110” ‘O’ when ”others ; end comp_ sans_ process ; c) La Description VHDL comportementale avec process : Le programme CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; - - Description externe entity exo1_c1 is port( A,B,C :in std_logic_vector ( 2 downto 0 ); S : out std_logic ); end exo1_c1 ; - - Description comportementale architecteure comp_ avec_ process of exo1_c1 is begin process (A B C) begin case A B C is when “000”=> S <=’0’ ; when “001”=> S <=’1’ ; when “010”=> S <=’0’ ; when “011”=> S <=’1’ ; when “100”=> S <=’1’ ; when “101”=> S <=’0’ ; when “110”=> S <=’1’ ; 4 24 25 26 27 when others=> S <=’0’ ; end case ; end process ; end comp_ avec_ process ; 2eme version : « sans process » Le programme CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; - - Description externe entity exo1_c2 is port( A,B,C :in std_logic ; S : out std_logic ); end exo1_c2 ; - - Description comportementale architecteure comp_ avec_ process of exo1_c2 is begin process (A B C) begin if (A=’0’ and C=’1’) or (A=’1’ and C=’0’) them S <=’1’ ; else S <=’0’ ; end if ; end process ; end comp_ avec_ process ; III. EXERCICE N°3 la description comportementale VHDL d’un compteur 4 bits avec entrée de remise à zéro RESET asynchrone et entrée de pré-chargement LOAD synchrone, les 2 signaux étant actifs au niveau haut. Remise à zéro asynchrone du compteur (RESET) Rechargement synchrone (si « LOAD =’1’ alors on transfert l’entrée DATA en sortie Q) 5 Le programme CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; Use ieee.numeric_std.all ; Use ieee.std_logic_unsigned.all ; - - Description externe entity CMP4BITS is port( LOAD,RESET,CLK :in std_logic ; DATA :in std_logic_vector ( 3 downto 0 ) ; Q : out std_logic_vector ( 3 downto 0 ) ) ; end CMP4BITS ; - - Description comportementale architecteure description of CMP4BITS is signal Q: std_logic_vector ( 3 downto 0 ) ; begin process (RESET,CLK) begin if RESET ='1' then Q <=(others=>'0') ; -- Remise à zero asynchrone du compteur elsif (CLK ='1' and CLK'event) then -- Ou elsif (rising_edge(clk)) then if (LOAD ='1') then Q <= DATA ; -- Préchargement synchrone end if ; end if ; end process ; end description ; IV. EXERCICE N°4 la description VHDL structurelle du circuit suivant : La description du XOR : 6 CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; - - Description externe entity XOR is port( I1,I2 :in std_logic ; out : out std_logic ); end XOR ; - - Description comportementale architecteure description of XOR is begin out<= I1 xor I2 ; end description ; La description de l’inversseur : CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; - - Description externe entity inversseur is port( I :in std_logic ; out : out std_logic ); end inversseur ; - - Description comportementale architecteure description of inversseur is begin out<= not I ; end description ; 7 La description structurelle : CODE : VHDL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 - - Déclaration des paquetages utiles pour le module library ieee ; use ieee . std_logic_1164.all ; - - Description externe entity description_struct is port( A ,B ,C :in std_logic ; S : out std_logic ); end description_struct ; - - Description comportementale architecteure description of description_struct is component xor port (I1 ,I2 : in std_logic ; out : out std_logic ); end component ; component inversseur port (I : in std_logic ; out : out std_logic ); end component ; signal S1,S2 : std_logic ; begin XOR1 : xor port map (A ,B,S1) ; XOR2 : xor port map (S1 ,B,S2) ; INV : inversseur port map (S2,S) ; end description ; 8 9 uploads/Societe et culture/ devoir-1-vhdl.pdf
Documents similaires
-
24
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Jan 24, 2022
- Catégorie Society and Cultur...
- Langue French
- Taille du fichier 0.2108MB