DS-SE-VHDL-2022
DS-SE-VHDL-2022
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
Entity ALU is
Port ( ENTREEA : in std_logic_vector (7 downto 0) ;
ENTREEB : in std_logic_vector (7 downto 0) ;
INALU : in std_logic ;
OPALU : in std_logic ;
START : in std_logic ;
LDFLAG : in std_logic ;
CLK : in std_logic ;
FLAG : out std_logic ;
RESULTAT : out std_logic_vector (7 downto 0));
end ALU ;
DFF : process(CLK)
Begin
if (CLK’event AND CLK = ‘1’) then
if (START = ‘1’) then
if (LDFLAG = ‘1’) then
Temp <= FLALU ;
else
Temp <= Temp ;
end if;
end if;
end if;
end process ;
End arch;
Exercice 2 (8 pts)
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
Entity compteur is
Port ( H : in std_logic ;
Up : in std_logic ;
Down : in std_logic ;
Compteur_out : out std_logic_vector (3 downto 0));
end compteur ;
library ieee;
use ieee.std_logic_1164.all;
Entity comparateur is
Port ( N_max : in std_logic_vector (3 downto 0) ;
Compteur_out : in std_logic_vector (3 downto 0) ;
PC : out std_logic ;
PD : out std_logic ) ;
end comparateur ;
End arch;