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 6

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

powered by: WebSVN 2.1.0

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