OpenCores
URL https://opencores.org/ocsvn/epc_rfid_transponder/epc_rfid_transponder/trunk

Subversion Repositories epc_rfid_transponder

[/] [epc_rfid_transponder/] [trunk/] [shiftreg.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 erwing
-------------------------------------------------------------------------------
2
--     Politecnico di Torino                                              
3
--     Dipartimento di Automatica e Informatica             
4
-------------------------------------------------------------------------------
5
-------------------------------------------------------------------------------     
6
--
7
--     Title          : Shift Register
8
--
9
--     File name      : shiftreg.vhd 
10
--
11
--     Description    : Simple Shift Register    
12
--
13 3 erwing
--     Authors        : Erwing R. Sanchez <erwing.sanchez@polito.it>
14 2 erwing
--                                 
15
-------------------------------------------------------------------------------            
16
-------------------------------------------------------------------------------
17
 
18
library IEEE;
19
use IEEE.STD_LOGIC_1164.all;
20
use IEEE.std_logic_unsigned.all;
21
 
22
 
23
entity shiftreg is
24
 
25
  generic (
26
    REGWD : integer := 16);
27
 
28
  port (
29
    clk   : in  std_logic;
30
    rst_n : in  std_logic;
31
    ce    : in  std_logic;
32
    sin   : in  std_logic;
33
    pout  : out std_logic_vector(REGWD - 1 downto 0));
34
 
35
end shiftreg;
36
 
37
architecture shreg1 of shiftreg is
38
 
39
  signal shreg : std_logic_vector(REGWD-1 downto 0);
40
 
41
begin  -- shreg1
42
 
43
  process (clk , rst_n)
44
  begin
45
    if rst_n = '0' then
46
      shreg <= (others => '0');
47
    elsif clk'event and clk = '1' then
48
      if ce = '1' then
49
        shreg <= shreg((REGWD - 2) downto 0) & sin;
50
      end if;
51
    end if;
52
    pout <= shreg;
53
  end process;
54
 
55
end shreg1;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.