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

Subversion Repositories xmatchpro

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 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 is
39
port
40
(
41
        CODE : in bit_vector(5 downto 0);
42
        M_LIT_LENGTH : out bit_vector(4 downto 0);
43
        SELECT_MOVE : out bit_vector(2 downto 0);
44
        RL_DETECTED : out bit;
45
        M_TYPE : out bit_vector(3 downto 0)
46
);
47
 
48
end DECODE_MT;
49
 
50
 
51
architecture HUFFMAN of DECODE_MT is
52
begin
53
 
54
TREE_DEC : process(CODE)
55
begin
56
case CODE is
57
    when "100000" | "100010" | "100100" |"100110" | "101000"  | "101010"  | "101100" | "101110" |
58
                "110000" | "110010" | "110100" |"110110" | "111000"  | "111010"  | "111100" | "111110" |
59
                "100001" | "100011" | "100101" |"100111" | "101001"  | "101011"  | "101101" | "101111" |
60
                "110001" | "110011" | "110101" |"110111" | "111001"  | "111011"  | "111101" | "111111"
61
                =>  M_TYPE <= "0000";
62
                    M_LIT_LENGTH <= "00010";
63
                                SELECT_MOVE <= "001";
64
                                RL_DETECTED <= '0';
65
 
66
 
67
    when "000000" | "000001"| "000010" | "000011" | "000100" | "000101" | "000110" | "000111"
68
 
69
                        =>  M_TYPE <= "1000";
70
                    M_LIT_LENGTH <= "01100";
71
                        SELECT_MOVE <= "010";
72
                        RL_DETECTED <= '0';
73
 
74
    when "010000" | "010001"| "010010" | "010011" | "010100" | "010101" | "010110" | "010111"
75
                =>  M_TYPE <= "0001";
76
                    M_LIT_LENGTH <= "01100";
77
                        SELECT_MOVE <= "010";
78
                        RL_DETECTED <= '0';
79
 
80
    when "011000" | "011001"| "011010" | "011011" | "011100" | "011101" | "011110" | "011111"
81
                                =>  M_TYPE <= "0000";
82
                    M_LIT_LENGTH <= "00100";
83
                        SELECT_MOVE <= "111";
84
                        RL_DETECTED <= '1';
85
 
86
 
87
    when "001000" |"001001" | "001010" | "001011"
88
                =>  M_TYPE <= "0011";
89
                    M_LIT_LENGTH <= "10101";
90
                        SELECT_MOVE <= "011";
91
                        RL_DETECTED <= '0';
92
 
93
    when "001111"
94
                =>  M_TYPE <= "0010";
95
                    M_LIT_LENGTH <= "01111";
96
                        SELECT_MOVE <= "100";
97
                        RL_DETECTED <= '0';
98
 
99
    when "001110"
100
                =>  M_TYPE <= "0100";
101
                    M_LIT_LENGTH <= "01111";
102
                        SELECT_MOVE <= "100";
103
                        RL_DETECTED <= '0';
104
 
105
    when "001101"
106
                =>  M_TYPE <= "1001";
107
                    M_LIT_LENGTH <= "10111";
108
                        SELECT_MOVE <= "101";
109
                        RL_DETECTED <= '0';
110
 
111
    when "001100"
112
                =>  M_TYPE <= "1100";
113
                    M_LIT_LENGTH <= "10111";
114
                        SELECT_MOVE <= "101";
115
                        RL_DETECTED <= '0';
116
 
117
    when others
118
                =>  M_TYPE <= "1111";
119
                    M_LIT_LENGTH <= "00000";
120
                        SELECT_MOVE <= "000";
121
                        RL_DETECTED <= '0';
122
end case;
123
 
124
end process TREE_DEC;
125
 
126
 
127
end HUFFMAN; -- end of architecture
128
 
129
 
130
 

powered by: WebSVN 2.1.0

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