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

Subversion Repositories turbocodes

[/] [turbocodes/] [trunk/] [src/] [vhdl/] [limiter_synth.vhd] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 dbrochart
----------------------------------------------------------------------
2
----                                                              ----
3
----  limiter_synth.vhd                                           ----
4
----                                                              ----
5
----  This file is part of the turbo decoder IP core project      ----
6
----  http://www.opencores.org/projects/turbocodes/               ----
7
----                                                              ----
8
----  Author(s):                                                  ----
9
----      - David Brochart(dbrochart@opencores.org)               ----
10
----                                                              ----
11
----  All additional information is available in the README.txt   ----
12
----  file.                                                       ----
13
----                                                              ----
14
----------------------------------------------------------------------
15
----                                                              ----
16
---- Copyright (C) 2005 Authors                                   ----
17
----                                                              ----
18
---- This source file may be used and distributed without         ----
19
---- restriction provided that this copyright statement is not    ----
20
---- removed from the file and that any derivative work contains  ----
21
---- the original copyright notice and the associated disclaimer. ----
22
----                                                              ----
23
---- This source file is free software; you can redistribute it   ----
24
---- and/or modify it under the terms of the GNU Lesser General   ----
25
---- Public License as published by the Free Software Foundation; ----
26
---- either version 2.1 of the License, or (at your option) any   ----
27
---- later version.                                               ----
28
----                                                              ----
29
---- This source is distributed in the hope that it will be       ----
30
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
31
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
32
---- PURPOSE. See the GNU Lesser General Public License for more  ----
33
---- details.                                                     ----
34
----                                                              ----
35
---- You should have received a copy of the GNU Lesser General    ----
36
---- Public License along with this source; if not, download it   ----
37
---- from http://www.opencores.org/lgpl.shtml                     ----
38
----                                                              ----
39
----------------------------------------------------------------------
40
 
41
 
42
 
43
architecture synth of limiter is
44
begin
45
    aLim    <=  std_logic_vector(conv_signed(-2**(SIG_WIDTH - 1) + 1, SIG_WIDTH))   when conv_integer(unsigned(a)) <= -2**(SIG_WIDTH - 1)   else
46
                std_logic_vector(conv_signed(2**(SIG_WIDTH - 1) - 1, SIG_WIDTH))    when conv_integer(unsigned(a)) >= 2**(SIG_WIDTH - 1)    else
47
                a;
48
    bLim    <=  std_logic_vector(conv_signed(-2**(SIG_WIDTH - 1) + 1, SIG_WIDTH))   when conv_integer(unsigned(b)) <= -2**(SIG_WIDTH - 1)   else
49
                std_logic_vector(conv_signed(2**(SIG_WIDTH - 1) - 1, SIG_WIDTH))    when conv_integer(unsigned(b)) >= 2**(SIG_WIDTH - 1)    else
50
                b;
51
    yLim    <=  std_logic_vector(conv_signed(-2**(SIG_WIDTH - 1) + 1, SIG_WIDTH))   when conv_integer(unsigned(y)) <= -2**(SIG_WIDTH - 1)   else
52
                std_logic_vector(conv_signed(2**(SIG_WIDTH - 1) - 1, SIG_WIDTH))    when conv_integer(unsigned(y)) >= 2**(SIG_WIDTH - 1)    else
53
                y;
54
    wLim    <=  std_logic_vector(conv_signed(-2**(SIG_WIDTH - 1) + 1, SIG_WIDTH))   when conv_integer(unsigned(w)) <= -2**(SIG_WIDTH - 1)   else
55
                std_logic_vector(conv_signed(2**(SIG_WIDTH - 1) - 1, SIG_WIDTH))    when conv_integer(unsigned(w)) >= 2**(SIG_WIDTH - 1)    else
56
                w;
57
    yIntLim <=  std_logic_vector(conv_signed(-2**(SIG_WIDTH - 1) + 1, SIG_WIDTH))   when conv_integer(unsigned(yInt)) <= -2**(SIG_WIDTH - 1) else
58
                std_logic_vector(conv_signed(2**(SIG_WIDTH - 1) - 1, SIG_WIDTH))    when conv_integer(unsigned(yInt)) >= 2**(SIG_WIDTH - 1) else
59
                yInt;
60
    wIntLim <=  std_logic_vector(conv_signed(-2**(SIG_WIDTH - 1) + 1, SIG_WIDTH))   when conv_integer(unsigned(wInt)) <= -2**(SIG_WIDTH - 1) else
61
                std_logic_vector(conv_signed(2**(SIG_WIDTH - 1) - 1, SIG_WIDTH))    when conv_integer(unsigned(wInt)) >= 2**(SIG_WIDTH - 1) else
62
                wInt;
63
end;

powered by: WebSVN 2.1.0

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