leftshift.vhd

来自「DLX CPU VHDL CODE UNIVERSITY」· VHDL 代码 · 共 36 行

VHD
36
字号
use work.dp32_types.all;entity leftshift is    generic(width : positive);    port(d : in bit_vector(width-1 downto 0);         y : out bit_vector(width-1 downto 0));  end leftshift;architecture behaviour of leftshift isbeginy(width-1 downto 1)<=d(width-2 downto 0);y(0)<='0';end behaviour;-- keeps bit 0 (sticky) the sameentity sticky_leftshift is    generic(width : positive);    port(d : in bit_vector(width-1 downto 0);         y : out bit_vector(width-1 downto 0));  end sticky_leftshift;architecture behaviour of sticky_leftshift isbeginy(width-1 downto 2)<=d(width-2 downto 1);y(0)<=d(1);y(1)<='0';end behaviour;

⌨️ 快捷键说明

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