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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [src/] [shift_literal.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       = SHIFT_LITERAL  --
19
--  version      = 2.0            --
20
--  last update  = 04/08/99       --
21
--  author       = Jose Nunez     --
22
------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- barrel shifter to remove the match location and match type
27
-- codes from the decoded data, leaving just literal characters.
28
 
29
 
30
-- PIN LIST
31
-- DIN_LIT   = input data
32
-- CM_LENGTH = length of the match location and match type codes
33
-- DOUT_LIT  = output shifted data
34
 
35
 
36
library ieee,dzx;
37
use ieee.std_logic_1164.all;
38
use dzx.attributes.all;
39
 
40
entity SHIFT_LITERAL is
41
port
42
(
43
      DIN_LIT : in bit_vector(34 downto 0) ;
44
      CM_LENGTH : in bit_vector(3 downto 0) ;
45
    --  DECOMP : in bit ;
46
      DOUT_LIT : out bit_vector(31 downto 0)
47
);
48
 
49
 
50
end SHIFT_LITERAL;
51
 
52
 
53
 
54
architecture BARREL of SHIFT_LITERAL is
55
 
56
begin
57
 
58
BSHIFT : process(DIN_LIT , CM_LENGTH )
59
begin
60
-- if (DECOMP = '0') then
61
        case CM_LENGTH is
62
            when "0000" => DOUT_LIT <= DIN_LIT(34 downto 3);
63
            when "0001" => DOUT_LIT <= DIN_LIT(33 downto 2);
64
            when "0010" => DOUT_LIT <= DIN_LIT(32 downto 1);
65
            when "0011" => DOUT_LIT <= DIN_LIT(31 downto 0);
66
            when "0100" => DOUT_LIT <= DIN_LIT(30 downto 0) & '0';
67
            when "0101" => DOUT_LIT <= DIN_LIT(29 downto 0) & "00";
68
            when "0110" => DOUT_LIT <= DIN_LIT(28 downto 0) & "000";
69
            when "0111" => DOUT_LIT <= DIN_LIT(27 downto 0) & "0000";
70
            when "1000" => DOUT_LIT <= DIN_LIT(26 downto 0) & "00000";
71
            when "1001" => DOUT_LIT <= DIN_LIT(25 downto 0) & "000000";
72
            when "1010" => DOUT_LIT <= DIN_LIT(24 downto 0) & "0000000";
73
            when "1011" => DOUT_LIT <= DIN_LIT(23 downto 0) & "00000000";
74
            when "1100" => DOUT_LIT <= DIN_LIT(22 downto 0) & "000000000";
75
            when "1101" => DOUT_LIT <= DIN_LIT(21 downto 0) & "0000000000";
76
          when others => DOUT_LIT <= x"00000000";
77
        end case;
78
-- else
79
--      DOUT_LIT <= x"00000000";
80
-- end if;
81
 
82
end process BSHIFT;
83
 
84
end BARREL; -- end of architecture
85
 
86
 
87
 

powered by: WebSVN 2.1.0

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