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

Subversion Repositories hicovec

[/] [hicovec/] [trunk/] [cpu/] [units/] [selectunit.vhd] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 hmanske
------------------------------------------------------------------
2 4 hmanske
-- PROJECT:    HiCoVec (highly configurable vector processor)
3 2 hmanske
--
4
-- ENTITY:      selectunit
5
--
6
-- PURPOSE:     selects one word out of a vector
7
--              register
8
--
9
-- AUTHOR:      harald manske, haraldmanske@gmx.de
10
--
11
-- VERSION:     1.0
12
-----------------------------------------------------------------
13
library ieee;
14
use ieee.std_logic_1164.all;
15
use ieee.std_logic_arith.all;
16
use ieee.numeric_std.all;
17
use ieee.std_logic_unsigned.all;
18
 
19
use work.cfg.all;
20
use work.datatypes.all;
21
 
22
entity selectunit is
23
    port (
24
        data_in :   in  vectordata_type;
25
        k_in:       in  std_logic_vector(31 downto 0);
26
        data_out:   out std_logic_vector(31 downto 0)
27
    );
28
end selectunit;
29
 
30
architecture rtl of selectunit is
31
    signal index: integer range 0 to k-1;
32
begin
33
   index <= conv_integer(k_in) when (k_in < k) else 0;
34
   data_out <= data_in(index);
35
end rtl;

powered by: WebSVN 2.1.0

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