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

Subversion Repositories tcp_ip_core_w_dhcp

[/] [tcp_ip_core_w_dhcp/] [trunk/] [losr.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 craighaywo
-- Hi Emacs, this is -*- mode: vhdl -*-
2
----------------------------------------------------------------------------------------------------
3
--
4
-- Registro de desplazamiento a la izquierda, entrada paralelo, salida serie
5
--
6
-- Copyright (c) 2007 Javier Valcarce García, javier.valcarce@gmail.com
7
-- $Id$
8
--
9
----------------------------------------------------------------------------------------------------
10
-- This program is free software: you can redistribute it and/or modify
11
-- it under the terms of the GNU Lesser General Public License as published by
12
-- the Free Software Foundation, either version 3 of the License, or
13
-- (at your option) any later version.
14
 
15
-- This program is distributed in the hope that it will be useful,
16
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
17
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
-- GNU Lesser General Public License for more details.
19
--
20
-- You should have received a copy of the GNU Lesser General Public License
21
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
----------------------------------------------------------------------------------------------------
23
 
24
 
25
library ieee;
26
use ieee.std_logic_1164.all;
27
use ieee.std_logic_arith.all;
28
use ieee.std_logic_unsigned.all;
29
 
30
 
31
entity losr is
32
  generic (
33
    N : integer := 4);
34
  port (
35
    reset : in  std_logic;
36
    clk   : in  std_logic;
37
    load  : in  std_logic;
38
    ce    : in  std_logic;
39
    do    : out std_logic;
40
    di    : in  std_logic_vector(N-1 downto 0));
41
end losr;
42
 
43
 
44
architecture arch of losr is
45
begin
46
 
47
  process(reset, clk)
48
    variable data : std_logic_vector(N-1 downto 0);
49
  begin
50
    if reset = '1' then
51
      data := (others => '0');
52
    elsif rising_edge(clk) then
53
      if load = '1' then
54
        data := di;
55
      elsif ce = '1' then
56
        data := data(N-2 downto 0) & "0";
57
      end if;
58
    end if;
59
 
60
    do <= data(N-1);
61
  end process;
62
 
63
end arch;

powered by: WebSVN 2.1.0

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