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

Subversion Repositories special_functions_unit

[/] [special_functions_unit/] [Open_source_SFU/] [log2_vhdl/] [parts/] [log2_luts_64x23b.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 divadnauj
-----------------------------------------------------------------------------   
2
 
3
library ieee;
4
        use ieee.std_logic_1164.all;
5
        use ieee.numeric_std.all;
6
        use work.log2_pkg.all;
7
 
8
 
9
entity log2_luts_64x23b is
10
        generic (SEG                                            :               natural := 64);
11
        port      (i_lutA_addr                          : in    std_logic_vector(4 downto 0); -- f_log2(SEG)-1 downto 0)
12
                                i_lutB_addr                             : in std_logic_vector(4 downto 0); -- f_log2(SEG)-1 downto 0)
13
                                o_lutA                                  : out std_logic_vector(22 downto 0);
14
                                o_lutB                                  : out std_logic_vector(22 downto 0));
15
end entity;
16
 
17
architecture rtl of log2_luts_64x23b is
18
signal s_lutA_addr      :integer;
19
signal s_lutB_addr  :integer;
20
 
21
begin
22
 
23
s_lutA_addr <= to_integer(unsigned(i_lutA_addr));
24
s_lutB_addr <= to_integer(unsigned(i_lutB_addr));
25
 
26
        luts: process(s_lutA_addr, s_lutB_addr) -- i_lutA_addr  : in    std_logic_vector(3 downto 0);
27
        begin
28
                case s_lutA_addr is
29
                when 0 => o_lutA <= "00000000000000000000000";
30
                when 1 => o_lutA        <= "00000011010111110010111";
31
                when 2 => o_lutA        <= "00000110011001011010000";
32
                when 3 => o_lutA        <= "00001001000110100100001";
33
                when 4 => o_lutA        <= "00001011100000011011000";
34
                when 5 => o_lutA        <= "00001101101000000010010";
35
                when 6 => o_lutA        <= "00001111011110011000001";
36
                when 7 => o_lutA        <= "00010001000100010110001";
37
                when 8 => o_lutA        <= "00010010011010110001011";
38
                when 9 => o_lutA        <= "00010011100010011010110";
39
                when 10=> o_lutA        <= "00010100011100000000001";
40
                when 11=> o_lutA        <= "00010101001000001011101";
41
                when 12=> o_lutA        <= "00010101100111100100111";
42
                when 13=> o_lutA        <= "00010101111010110000100";
43
                when 14=> o_lutA        <= "00010110000010010001000";
44
                when 15=> o_lutA        <= "00010101111110100110100";
45
                when 16 => o_lutA       <= "00010101110000001111000";
46
                when 17 => o_lutA       <= "00010101010111100110111";
47
                when 18 => o_lutA       <= "00010100110101001000100";
48
                when 19 => o_lutA       <= "00010100001001001100111";
49
                when 20 => o_lutA       <= "00010011010100001011101";
50
                when 21 => o_lutA       <= "00010010010110011010111";
51
                when 22 => o_lutA       <= "00010001010000001111100";
52
                when 23 => o_lutA       <= "00010000000001111101010";
53
                when 24 => o_lutA       <= "00001110101011110110110";
54
                when 25 => o_lutA       <= "00001101001110001110000";
55
                when 26=> o_lutA        <= "00001011101001010011011";
56
                when 27=> o_lutA        <= "00001001111101010111001";
57
                when 28=> o_lutA        <= "00001000001010101000010";
58
                when 29=> o_lutA        <= "00000110010001010101001";
59
                when 30=> o_lutA        <= "00000100010001101011011";
60
                when 31=> o_lutA        <= "00000010001011111000000";
61
                when others => o_lutA <= "00000000000000000000000";
62
                end case;
63
 
64
                case s_lutB_addr is
65
                when 0 => o_lutB <= "00000001101110111011100";
66
                when 1 => o_lutB        <= "00000100111011001111000";
67
                when 2 => o_lutB        <= "00000111110010011110000";
68
                when 3 => o_lutB        <= "00001010010101110101101";
69
                when 4 => o_lutB        <= "00001100100110011100101";
70
                when 5 => o_lutB        <= "00001110100101010011101";
71
                when 6 => o_lutB        <= "00010000010011010110110";
72
                when 7 => o_lutB        <= "00010001110001011100111";
73
                when 8 => o_lutB        <= "00010011000000011001011";
74
                when 9 => o_lutB        <= "00010100000000111011010";
75
                when 10=> o_lutB        <= "00010100110011101110100";
76
                when 11=> o_lutB        <= "00010101011001011100010";
77
                when 12=> o_lutB        <= "00010101110010101010010";
78
                when 13=> o_lutB        <= "00010101111111111100001";
79
                when 14=> o_lutB        <= "00010110000001110011010";
80
                when 15=> o_lutB        <= "00010101111000101110101";
81
                when 16 => o_lutB       <= "00010101100101001011010";
82
                when 17 => o_lutB       <= "00010101000111100100111";
83
                when 18 => o_lutB       <= "00010100100000010100111";
84
                when 19 => o_lutB       <= "00010011101111110011101";
85
                when 20 => o_lutB       <= "00010010110110010111111";
86
                when 21 => o_lutB       <= "00010001110100010111010";
87
                when 22 => o_lutB       <= "00010000101010000110000";
88
                when 23 => o_lutB       <= "00001111010111110111011";
89
                when 24 => o_lutB       <= "00001101111101111101101";
90
                when 25 => o_lutB       <= "00001100011100101001111";
91
                when 26=> o_lutB        <= "00001010110100001100100";
92
                when 27=> o_lutB        <= "00001001000100110101001";
93
                when 28=> o_lutB        <= "00000111001110110010011";
94
                when 29=> o_lutB        <= "00000101010010010010010";
95
                when 30=> o_lutB        <= "00000011001111100010001";
96
                when 31=> o_lutB        <= "00000001000110101110101";
97
                when others => o_lutB <= "00000000000000000000000";
98
                end case;
99
 
100
        end process;
101
end rtl;

powered by: WebSVN 2.1.0

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