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] - Diff between revs 2 and 6

Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 6
library IEEE;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_1164.ALL;
 
 
entity RightShiftReg is
entity RightShiftReg is
 
        generic(
 
                size : integer := 4
 
        );
        port(
        port(
                clock    :in    std_logic;
                clock    :in    std_logic;
                enable :in      std_logic;
                enable :in      std_logic;
                shift    :in    std_logic;
                shift    :in    std_logic;
                din      :in    std_logic_vector;
                din      :in    std_logic_vector(size-1 downto 0);
                dout     :out std_logic_vector(1 downto 0));
                dout     :out std_logic_vector(1 downto 0));
end RightShiftReg;
end RightShiftReg;
 
 
architecture Behavioral of RightShiftReg is
architecture Behavioral of RightShiftReg is
        signal data : std_logic_vector(din'length-1 downto 0);
        signal data : std_logic_vector(din'length-1 downto 0);
begin
begin
        process(clock,enable,shift)
        process(clock, enable, shift)
        begin
        begin
                if(clock'event and clock = '1')then
                if(clock'event and clock = '1')then
                        if(enable = '1')then
                        if(enable = '1')then
                                data <= din;
                                data <= din;
                        elsif(shift = '1') then
                        elsif(shift = '1') then
                                data <= '0' & data(din'length-1 downto 1);
                                data <= '0' & data(din'length-1 downto 1);
                        else
                        else
                                data <= data;
                                data <= data;
                        end if;
                        end if;
                end if;
                end if;
        end process;
        end process;
        dout <= data(1 downto 0);
        dout <= data(1 downto 0);
end Behavioral;
end Behavioral;
 
 
 
 

powered by: WebSVN 2.1.0

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