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

Subversion Repositories adaptive_lms_equalizer

[/] [adaptive_lms_equalizer/] [tags/] [V10/] [code/] [saturation.vhd] - Blame information for rev 5

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

Line No. Rev Author Line
1 2 digish
--  Copyright (C) 2004-2005 Digish Pandya <digish.pandya@gmail.com>
2
 
3
--  This program is free software; you can redistribute it and/or modify
4
--  it under the terms of the GNU General Public License as published by
5
--  the Free Software Foundation; either version 2 of the License, or
6
--  (at your option) any later version.
7
--
8
--  This program is distributed in the hope that it will be useful,
9
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
--  GNU General Public License for more details.
12
--
13
--  You should have received a copy of the GNU General Public License
14
--  along with this program; if not, write to the Free Software
15
--  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
16
 
17
-- A.9 saturation.vhd
18
-- saturation circuit
19
-- important for avoiding adverse effect of truncation
20
 
21
library IEEE;
22
use IEEE.STD_LOGIC_1164.ALL;
23
use IEEE.STD_LOGIC_ARITH.ALL;
24
use IEEE.STD_LOGIC_UNSIGNED.ALL;
25
 
26
 
27
entity saturation is
28
    Port ( d_in : in std_logic_vector(15 downto 0);
29
           d_out : out std_logic_vector(15 downto 0));
30
end saturation;
31
 
32
architecture Behavioral of saturation is
33
        signal sel:std_logic_vector(1 downto 0);
34
begin
35
 
36
                sel(1) <= not(d_in(12) xor d_in(13)xor d_in(14) xor d_in(15));
37
                sel(0) <= d_in(15);
38
 
39
                with sel select
40
                d_out <= d_in when "11"|"10",
41
                            "0001000000000000" when "00",
42
                            "1111000000000000" when "01",
43
                            "0000000000000000" when others;
44
 
45
end Behavioral;

powered by: WebSVN 2.1.0

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