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

Subversion Repositories raytrac

[/] [raytrac/] [trunk/] [sqrtdiv/] [shifter2xstage.vhd] - Blame information for rev 67

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

Line No. Rev Author Line
1 60 jguarin200
------------------------------------------------
2
--! @file shifter2xstage.vhd
3
--! @brief RayTrac Arithmetic Shifter 
4
--! @author Julián Andrés Guarín Reyes
5
--------------------------------------------------
6
 
7
 
8
-- RAYTRAC
9
-- Author Julian Andres Guarin
10
-- shifter2xstage.vhd
11
-- This file is part of raytrac.
12
-- 
13
--     raytrac is free software: you can redistribute it and/or modify
14
--     it under the terms of the GNU General Public License as published by
15
--     the Free Software Foundation, either version 3 of the License, or
16
--     (at your option) any later version.
17
-- 
18
--     raytrac is distributed in the hope that it will be useful,
19
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
20
--     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
--     GNU General Public License for more details.
22
-- 
23
--     You should have received a copy of the GNU General Public License
24
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>
25
 
26
library ieee;
27
use ieee.std_logic_1164.all;
28
use ieee.math_real.all;
29
use work.arithpack.all;
30
 
31
entity shifter2xstage is
32
        generic (
33
                address_width   : integer := 9;
34
                width                   : integer := 16
35
        );
36
        port (
37
                data    : in std_logic_vector (width-1 downto 0);
38
                exp             : out std_logic_vector (2*integer(ceil(log(real(width),2.0)))-1 downto 0);
39
                add             : out std_logic_vector (2*address_width-1 downto 0);
40 67 jguarin200
                zero    : out std_logic
41 60 jguarin200
        );
42
end shifter2xstage;
43
 
44
architecture shifter2xstage_arch of shifter2xstage is
45
 
46
        signal exp0     : std_logic_vector (integer(ceil(log(real(width),2.0)))-1 downto 0);
47
        signal exp1     : std_logic_vector (integer(ceil(log(real(width),2.0)))-1 downto 0);
48
        signal add0     : std_logic_vector (address_width-1 downto 0);
49
        signal add1     : std_logic_vector (address_width-1 downto 0);
50 67 jguarin200
        signal szero: std_logic_vector (1 downto 0);
51 60 jguarin200
 
52
begin
53 67 jguarin200
        zero <= szero(1) and szero(0);
54 60 jguarin200
        evenS:shifter
55
        generic map (address_width,width,"YES")
56 67 jguarin200
        port map (data,exp0,add0,szero(0));
57 60 jguarin200
        oddS:shifter
58
        generic map (address_width,width,"NO")
59 67 jguarin200
        port map (data,exp1,add1,szero(1));
60 60 jguarin200
        exp(integer(ceil(log(real(width),2.0)))-1 downto 0)<=exp0;
61
        exp(2*integer(ceil(log(real(width),2.0)))-1 downto integer(ceil(log(real(width),2.0))))<=exp1;
62
        add(address_width-1 downto 0)<=add0;
63
        add(2*address_width-1 downto address_width)<=add1;
64
end shifter2xstage_arch;
65
 

powered by: WebSVN 2.1.0

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