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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [length_selection_2.vhd] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 eejlny
--This library is free software; you can redistribute it and/or
2
--modify it under the terms of the GNU Lesser General Public
3
--License as published by the Free Software Foundation; either
4
--version 2.1 of the License, or (at your option) any later version.
5
 
6
--This library is distributed in the hope that it will be useful,
7
--but WITHOUT ANY WARRANTY; without even the implied warranty of
8
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9
--Lesser General Public License for more details.
10
 
11
--You should have received a copy of the GNU Lesser General Public
12
--License along with this library; if not, write to the Free Software
13
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
14
 
15
-- e_mail : j.l.nunez-yanez@byacom.co.uk
16
 
17
---------------------------------------------
18
--  ENTITY       = MAX_PBC_LENGTH          --
19
--  version      = 1.0                     --
20
--  last update  = 20/07/01                 --
21
--  author       = Jose Nunez              --
22
---------------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- produces two possible start for the match type code depending on the PBC code
27
 
28
--  PIN LIST
29
 
30
 
31
--  NFL_MINUS_ONE = next free location minus one
32
--  CODE = all the bits that can contain match location plus match type code
33
--  POS_MT_K_1 = match type when using k-1 bits
34
--  POS_MT_K = match type when using k bits
35
 
36
 
37
library ieee,dzx;
38
use ieee.std_logic_1164.all;
39
use dzx.bit_arith.all;
40
 
41
entity LENGTH_SELECTION_2 is
42
 
43
port (MATCH_LOC_K : in bit_vector(3 downto 0);
44
          MATCH_LOC_K_1 : in bit_vector(3 downto 0);
45
          SUB : in bit_vector(4 downto 0);
46
          MAX_MATCH_LENGTH : in bit_vector(2 downto 0);
47
          MATCH_LENGTH : out bit_vector(2 downto 0);
48
          SEL_MATCH_LOC : out bit_vector(3 downto 0);
49
          K_BITS: out bit
50
         );
51
 
52
end LENGTH_SELECTION_2;
53
 
54
architecture STRUCTURAL of LENGTH_SELECTION_2 is
55
 
56
begin
57
 
58
SEL : process(SUB, MATCH_LOC_K, MATCH_LOC_K_1, MAX_MATCH_LENGTH)
59
 
60
variable MATCH_LOC_TEMP : bit_vector(4 downto 0);
61
 
62
begin
63
 
64
        MATCH_LOC_TEMP := '0' & MATCH_LOC_K - SUB;
65
 
66
        if ( '0' & MATCH_LOC_K_1 < SUB) then
67
                K_BITS <= '0';
68
                MATCH_LENGTH <= MAX_MATCH_LENGTH - "001";
69
                SEL_MATCH_LOC <= MATCH_LOC_K_1;
70
        else
71
                K_BITS <= '1';
72
                MATCH_LENGTH <= MAX_MATCH_LENGTH;
73
                SEL_MATCH_LOC <= MATCH_LOC_TEMP(3 downto 0);
74
        end if;
75
end process SEL;
76
 
77
end STRUCTURAL;

powered by: WebSVN 2.1.0

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