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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [decode_mt_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       = DECODE_MT      --
19
--  version      = 1.0            --
20
--  last update  = 25/06/01       --
21
--  author       = Jose Nunez     --
22
------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- decodes the input (Huffman) match type code to give a match type,
27
-- match length and match+literal character length
28
 
29
-- PIN LIST
30
-- CODE         = input match type code (Huffman)
31
-- M_LIT_LENGTH = length of match type code and any required literal characters
32
-- M_TYPE       = decoded match type
33
 
34
library ieee,dzx;
35
use ieee.std_logic_1164.all;
36
 
37
 
38
entity DECODE_MT_2 is
39
port
40
(
41
        CODE : in bit_vector(5 downto 0);
42
        M_LIT_LENGTH : out bit_vector(4 downto 0);
43
        RL_DETECTED : out bit;
44
        M_TYPE : out bit_vector(3 downto 0)
45
);
46
 
47
end DECODE_MT_2;
48
 
49
 
50
architecture HUFFMAN of DECODE_MT_2 is
51
begin
52
 
53
TREE_DEC : process(CODE)
54
begin
55
case CODE is
56
    when "100000" | "100010" | "100100" |"100110" | "101000"  | "101010"  | "101100" | "101110" |
57
                "110000" | "110010" | "110100" |"110110" | "111000"  | "111010"  | "111100" | "111110" |
58
                "100001" | "100011" | "100101" |"100111" | "101001"  | "101011"  | "101101" | "101111" |
59
                "110001" | "110011" | "110101" |"110111" | "111001"  | "111011"  | "111101" | "111111"
60
                =>  M_TYPE <= "0000";
61
                    M_LIT_LENGTH <= "00010";
62
                                RL_DETECTED <= '0';
63
 
64
 
65
    when "000000" | "000001"| "000010" | "000011" | "000100" | "000101" | "000110" | "000111"
66
 
67
                        =>  M_TYPE <= "1000";
68
                    M_LIT_LENGTH <= "01100";
69
                        RL_DETECTED <= '0';
70
 
71
    when "010000" | "010001"| "010010" | "010011" | "010100" | "010101" | "010110" | "010111"
72
                =>  M_TYPE <= "0001";
73
                    M_LIT_LENGTH <= "01100";
74
                        RL_DETECTED <= '0';
75
 
76
    when "011000" | "011001"| "011010" | "011011" | "011100" | "011101" | "011110" | "011111"
77
                                =>  M_TYPE <= "0000";
78
                    M_LIT_LENGTH <= "00100";
79
                        RL_DETECTED <= '1';
80
 
81
 
82
    when "001000" |"001001" | "001010" | "001011"
83
                =>  M_TYPE <= "0011";
84
                    M_LIT_LENGTH <= "10101";
85
                        RL_DETECTED <= '0';
86
 
87
    when "001111"
88
                =>  M_TYPE <= "0010";
89
                    M_LIT_LENGTH <= "01111";
90
                        RL_DETECTED <= '0';
91
 
92
    when "001110"
93
                =>  M_TYPE <= "0100";
94
                    M_LIT_LENGTH <= "01111";
95
                        RL_DETECTED <= '0';
96
 
97
    when "001101"
98
                =>  M_TYPE <= "1001";
99
                    M_LIT_LENGTH <= "10111";
100
                        RL_DETECTED <= '0';
101
 
102
    when "001100"
103
                =>  M_TYPE <= "1100";
104
                    M_LIT_LENGTH <= "10111";
105
                        RL_DETECTED <= '0';
106
 
107
    when others
108
                =>  M_TYPE <= "1111";
109
                    M_LIT_LENGTH <= "00000";
110
                        RL_DETECTED <= '0';
111
end case;
112
 
113
end process TREE_DEC;
114
 
115
 
116
end HUFFMAN; -- end of architecture
117
 
118
 
119
 

powered by: WebSVN 2.1.0

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