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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.accelerator/] [dctqidct/] [1.0/] [hdl/] [common_da/] [Column_to_elements.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
------------------------------------------------------------------------------
2
-- Author               : Timo Alho
3
-- e-mail               : timo.a.alho@tut.fi
4
-- Date                 : 15.06.2004 19:00:37
5
-- File                 : Column_to_elements.vhd
6
-- Design               : VHDL Entity Column_to_elements.rtl
7
------------------------------------------------------------------------------
8
-- Description  : Parallel to serial converter.
9
------------------------------------------------------------------------------
10
LIBRARY ieee;
11
USE ieee.std_logic_1164.ALL;
12
USE ieee.std_logic_arith.ALL;
13
 
14
ENTITY Column_to_elements IS
15
   GENERIC(
16
      dataw_g : integer := 18
17
   );
18
   PORT(
19
      clk       : IN     std_logic;
20
      --enable shifting:
21
      --if '1' one value is shifted to output
22
      clk_en    : IN     std_logic;
23
      --parallel input (8 * (dataw_g-1 downto 0))
24
      column_in : IN     std_logic_vector (8*dataw_g-1 DOWNTO 0);
25
      --if '1' parallel input is loaded into shiftregister
26
      load      : IN     std_logic;
27
      rst_n     : IN     std_logic;
28
      --serial output
29
      d_out     : OUT    std_logic_vector (dataw_g-1 DOWNTO 0)
30
   );
31
 
32
-- Declarations
33
 
34
END Column_to_elements ;
35
 
36
--
37
ARCHITECTURE rtl OF Column_to_elements IS
38
  SIGNAL shiftreg_r : std_logic_vector(8*dataw_g-1 DOWNTO 0);
39
BEGIN
40
 
41
  -- purpose: loads and shifts
42
  -- type   : sequential
43
  -- inputs : clk, rst_n
44
  -- outputs: 
45
  clocked      : PROCESS (clk, rst_n)
46
    VARIABLE i : integer;
47
  BEGIN  -- PROCESS clocked
48
    IF rst_n = '0' THEN                 -- asynchronous reset (active low)
49
      shiftreg_r <= (OTHERS => '0');
50
 
51
    ELSIF clk'event AND clk = '1' THEN  -- rising clock edge
52
      IF (load = '1') THEN
53
        shiftreg_r <= column_in;
54
 
55
      ELSIF (clk_en = '1') THEN
56
        FOR i IN 0 TO 6 LOOP
57
          shiftreg_r((i+1)*dataw_g-1 DOWNTO i*dataw_g) <= shiftreg_r((i+2)*dataw_g-1 DOWNTO (i+1)*dataw_g);
58
        END LOOP;  -- i
59
 
60
      ELSE
61
        shiftreg_r <= shiftreg_r;
62
      END IF;
63
    END IF;
64
  END PROCESS clocked;
65
 
66
  d_out <= shiftreg_r(dataw_g-1 DOWNTO 0);
67
END rtl;
68
 

powered by: WebSVN 2.1.0

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