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

powered by: WebSVN 2.1.0

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