FPGA

Fermé
azwaa Messages postés 11 Date d'inscription mercredi 24 décembre 2014 Statut Membre Dernière intervention 15 janvier 2015 - 1 janv. 2015 à 17:17
Bonsoir à tous ;

je voudrais juste savoir est ce que mon code VHDL correspond bien à le schéma suivant :

library ieee;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;

entity tppreba is
port(h,r :in std_logic ;
y:out unsigned(3 downto 0));
end tppreba ;

architecture arch_tppreba of tppreba is


signal r_reg:unsigned(3 downto 0);
signal r_next:unsigned(3 downto 0);
signal sel:std_logic ;

begin

MUX:process(h,r)
begin
if(r='1')then
y<=(others=>'0') ;
elsif h'event and h='1' then
if(r_reg ="1001")then
sel<='1';
else
sel<='0' ;
end if ;
end if ; end process MUX ;

Reg:process(sel)
begin
case sel is
when '0'=>r_next<=r_reg+1 ;
when '1'=>r_next<="0000" ;
when others =>r_next<="----" ;
end case ;
r_reg<=r_next ;
end process Reg;
y<=r_reg ;

end arch_tppreba ;



Merci bien .