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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [mt_coder.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       = MT_CODER    --
19
--  version      = 1.0         --
20
--  last update  = 16/06/98    --
21
--  author       = Jose Nunez  --
22
---------------------------------
23
 
24
 
25
-- FUNCTION
26
-- match type coder. Converts incoming match type to a Huffman code word
27
-- and associated length.
28
 
29
 
30
-- PIN LIST
31
-- MATCH_TYPE = input match type bus
32
-- CODE       = output Huffman code (left aligned)
33
-- LENGTH     = length (number of valid bits) in the output code
34
 
35
 
36
library ieee,dzx;
37
use ieee.std_logic_1164.all;
38
 
39
 
40
entity MT_CODER is
41
port
42
(
43
    MATCH_TYPE : in bit_vector(3 downto 0);
44
        CODE : out bit_vector(5 downto 0);
45
        LENGTH : out bit_vector(2 downto 0)
46
);
47
 
48
 
49
 
50
end MT_CODER;
51
 
52
 
53
architecture HUFFMAN of MT_CODER is
54
 
55
begin
56
 
57
MATCH : process(MATCH_TYPE)
58
begin
59
case MATCH_TYPE is
60
    when "0000" => CODE <= "100000"; LENGTH <= "001";
61
    when "0001" => CODE <= "010000"; LENGTH <= "011";
62
    when "0010" => CODE <= "001111"; LENGTH <= "110";
63
    when "0011" => CODE <= "001000"; LENGTH <= "100";
64
    when "0100" => CODE <= "001110"; LENGTH <= "110";
65
    when "1000" => CODE <= "000000"; LENGTH <= "011";
66
    when "1001" => CODE <= "001101"; LENGTH <= "110";
67
    when "1100" => CODE <= "001100"; LENGTH <= "110";
68
    when others => CODE <= "000000"; LENGTH <= "000";
69
end case;
70
end process MATCH;
71
 
72
end HUFFMAN; -- end of architecture
73
 
74
 
75
 

powered by: WebSVN 2.1.0

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