qregister.vhd.bak

来自「the booth algorithm to implement the 32b」· BAK 代码 · 共 37 行

BAK
37
字号
library IEEE;use IEEE.std_logic_1164.all;entity QRegister is port( op: in std_logic_vector(1 downto 0);      clk: in std_logic;      sr: in std_logic;      din: in std_logic_vector(31 downto 0);      q0: out std_logic;       dout: out std_logic_vector(31 downto 0)      );end QRegister;architecture behav of QRegister issignal data: std_logic_vector(32 downto 0);signal olddata: std_logic_vector(32 downto 0);signal qinit: std_logic := '0';beginreg: process(clk)begin    if (clk'event and clk = '1') then        if (op = "01") then            olddata(32) <= sr;            olddata(31 downto 0) <= data(31 downto 0);            data <= (32 downto 32 => '0') & olddata(31 downto 1);        elsif (op = "10" or op = "11") then            data(32 downto 1) <= din;            data(0) <= qinit;        end if;                dout <= data(32 downto 1);        q0 <= data(0);    end if;end process;end behav;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?