summaryrefslogtreecommitdiff
path: root/pb_logique_seq.srcs/sources_1/imports/new/reg_24b.vhd
blob: 43dd7a919f2c544be250f1647513fa60aaa32f3f (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---------------------------------------------------------------------------------------------
-- circuit reg_24b.vhd
---------------------------------------------------------------------------------------------
-- Université de Sherbrooke - Département de GEGI
-- Version         : 1.0
-- Nomenclature    : 0.8 GRAMS
-- Date            : 10 janvier 2019, rev 29 janvier,  2 mai 2019, 5 mai 2019
-- Auteur(s)       : Daniel Dalle
-- Technologies    : FPGA Zynq (carte ZYBO Z7-10 ZYBO Z7-20)
--
-- Outils          : vivado 2018.2
---------------------------------------------------------------------------------------------
-- Description:
-- Registre de 24 bits
--
-- Revision 14 mai 2019 
---------------------------------------------------------------------------------------------
-- À faire :
-- 
-- 
---------------------------------------------------------------------------------------------

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;  -- pour les additions dans les compteurs

entity reg_24b is
  Port ( 
    i_clk       : in std_logic;
    i_reset     : in std_logic;
    i_en        : in std_logic;
    i_dat       : in std_logic_vector(23 downto 0);
    o_dat       : out  std_logic_vector(23 downto 0)
);
end reg_24b;

architecture Behavioral of reg_24b is

  --
    signal   q_reg   : std_logic_vector(23 downto 0);   -- registre
    
  begin
  -- registre  
  reg_dec: process (i_clk, i_reset)
     begin    
         if (i_reset = '1')  then
            q_reg  <= (others =>'0');
         elsif rising_edge(i_clk) and  (i_en = '1')  then
            q_reg  <= i_dat;
        end if;
     end process;
 
     o_dat   <=  q_reg;

end Behavioral;