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

Subversion Repositories generic_booth_multipler

[/] [generic_booth_multipler/] [trunk/] [rtl/] [modules/] [00.LeftShiftReg.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 alimpk
 
2
library IEEE;
3
use IEEE.STD_LOGIC_1164.ALL;
4
 
5
entity LeftShiftReg is
6
                port(
7
                        clock    :in    std_logic;
8
                        enable :in      std_logic;
9
                        shift    :in    std_logic;
10
                        din      :in    std_logic_vector;
11
                        dout     :out std_logic_vector);
12
end LeftShiftReg;
13
 
14
architecture Behavioral of LeftShiftReg is
15
        signal data : std_logic_vector(din'range);
16
begin
17
        process(clock,enable,shift)
18
        begin
19
                if(clock'event and clock = '1')then
20
                        if(enable = '1')then
21
                                data <= din;
22
                        elsif(shift = '1') then
23
                                data <= data(din'length-2 downto 0) & '0';
24
                        else
25
                                data <= data;
26
                        end if;
27
                end if;
28
        end process;
29
        dout <= data;
30
 
31
end Behavioral;
32
 

powered by: WebSVN 2.1.0

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