📄 mult3.vhd
字号:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY mult3 is
PORT
( clk : IN STD_LOGIC;
Din : IN SIGNED (9 DOWNTO 0);
Dout : OUT SIGNED (10 DOWNTO 0));
END mult3;
ARCHITECTURE a OF mult3 IS
SIGNAL s1 : SIGNED (10 DOWNTO 0);
SIGNAL s2 : SIGNED (10 DOWNTO 0);
BEGIN
P1:process(Din)
BEGIN
s1(10 DOWNTO 1)<=Din;
s1(0)<='0';
if Din(9)='0' then
s2<=('0'&s1(10 downto 1))+("00"&Din(9 DOWNTO 1));
else
s2<=('1'&s1(10 downto 1))+("11"&Din(9 DOWNTO 1));
end if;
end process;
P2: PROCESS(clk)
BEGIN
if clk'event and clk='1' then
Dout<=s2;
end if;
END PROCESS;
END a;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -