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

Subversion Repositories wdsp

[/] [wdsp/] [trunk/] [rtl/] [vhdl/] [WISHBONE_FIR/] [Barrel_Shifter_left.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 parrado
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.numeric_std.all;
4
 
5
entity Barrel_Shifter_left is
6
 
7
generic (
8
 
9
        WordWidth_in:integer:=20;--width signal of in
10
        WordWidth_out:integer:=32;--width signal of out
11
        WordWidth_Q:integer:=4--width signal of Q
12
);
13
port(
14
signal_input :in std_logic_vector(WordWidth_in-1 downto 0);
15
signal_out :out std_logic_vector(WordWidth_out-1 downto 0);
16
Q :in std_logic_vector(WordWidth_Q-1 downto 0)
17
);
18
end entity;
19
 
20
architecture RTL of Barrel_Shifter_left is
21
signal signal_aux: std_logic_vector(WordWidth_out-1 downto 0);
22
signal signal_aux_input: std_logic_vector(WordWidth_out-1 downto 0);
23
signal sext: std_logic_vector(WordWidth_out-WordWidth_in-1 downto 0);
24
begin
25
 
26
sext<= (others=>signal_input(WordWidth_in-1));
27
signal_aux_input<= sext & signal_input;
28
 
29
--signal_aux<=std_logic_vector(signed(signal_input)*to_signed(2**(to_integer(-signed(Q))),24));
30
signal_aux<=to_stdlogicvector(to_bitvector(signal_aux_input) sll to_integer(unsigned(Q)));
31
--signal_aux<=std_logic_vector(signed(signal_input) ror (to_integer(unsigned(Q))));
32
signal_out<=signal_aux;
33
end architecture;

powered by: WebSVN 2.1.0

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