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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [src/] [encode16_4.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       = ENCODE16_4 --
19
--  version      = 2.0         --
20
--  last update  = 16/06/98    --
21
--  author       = Jose Nunez  --
22
---------------------------------
23
 
24
 
25
-- FUNCTION
26
-- 16 to 4 encoder to convert active low 16 bit maatch bus input
27
-- to a 4 bit wide binary code.
28
 
29
 
30
--  PIN LIST
31
--  MATCH_LOC_IN  = 16 bit match location input bus (active low)
32
--  MATCH_LOC_OUT = 4 bit binary output match location bus
33
--  MISS          = active low signal to indicate that a miss has occurred
34
 
35
 
36
library ieee,dzx;
37
use ieee.std_logic_1164.all;
38
 
39
 
40
entity ENCODE16_4 is
41
port
42
(
43
        MATCH_LOC_IN : in bit_vector(15 downto 0);
44
        MATCH_LOC_OUT : out bit_vector(3 downto 0)
45
);
46
 
47
 
48
 
49
end ENCODE16_4;
50
 
51
 
52
architecture ENC2 of ENCODE16_4 is
53
 
54
begin
55
 
56
 
57
ENCODER : process (MATCH_LOC_IN)
58
 
59
begin
60
 
61
case MATCH_LOC_IN is
62
    when  x"FFFE" => MATCH_LOC_OUT <= "0000";
63
    when  x"FFFD" => MATCH_LOC_OUT <= "0001";
64
    when  x"FFFB" => MATCH_LOC_OUT <= "0010";
65
    when  x"FFF7" => MATCH_LOC_OUT <= "0011";
66
    when  x"FFEF" => MATCH_LOC_OUT <= "0100";
67
    when  x"FFDF" => MATCH_LOC_OUT <= "0101";
68
    when  x"FFBF" => MATCH_LOC_OUT <= "0110";
69
    when  x"FF7F" => MATCH_LOC_OUT <= "0111";
70
    when  x"FEFF" => MATCH_LOC_OUT <= "1000";
71
    when  x"FDFF" => MATCH_LOC_OUT <= "1001";
72
    when  x"FBFF" => MATCH_LOC_OUT <= "1010";
73
    when  x"F7FF" => MATCH_LOC_OUT <= "1011";
74
    when  x"EFFF" => MATCH_LOC_OUT <= "1100";
75
    when  x"DFFF" => MATCH_LOC_OUT <= "1101";
76
    when  x"BFFF" => MATCH_LOC_OUT <= "1110";
77
    when  x"7FFF" => MATCH_LOC_OUT <= "1111";
78
    when  x"FFFF" => MATCH_LOC_OUT <= "1111";
79
    when others => MATCH_LOC_OUT <= "1111";
80
    -- when others => null;
81
 
82
end case;
83
 
84
end process ENCODER;
85
 
86
end ENC2; -- end of architecture
87
 
88
 
89
 

powered by: WebSVN 2.1.0

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