⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mul2.vhd

📁 用VHDL编写的计算器
💻 VHD
字号:
------------------------------------------------------------------------------------ Company: -- Engineer: -- -- Create Date:    20:29:19 11/16/2006 -- Design Name: -- Module Name:    shiftl - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: ---- Dependencies: ---- Revision: -- Revision 0.01 - File Created-- Additional Comments: ------------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;---- Uncomment the following library declaration if instantiating---- any Xilinx primitives in this code.--library UNISIM;--use UNISIM.VComponents.all;entity mul2 is    Port ( num1 : in  STD_LOGIC_VECTOR (3 downto 0);           num2 : in  STD_LOGIC_VECTOR (8 downto 0);         --  start : in  STD_LOGIC;           clk : in  STD_LOGIC;           num : out  STD_LOGIC_VECTOR (11 downto 0));end mul2;architecture Behavioral of mul2 isbeginprocess(clk,num1,num2)variable acc:std_logic_vector(11 downto 0);variable q:std_logic_vector(11 downto 0);variable ma:std_logic_vector(11 downto 0);begin  if rising_edge(clk)then
  ma:="00000000"&num1;  acc:="000000000000";  for i in 0 to 8 loop
     for j in  0 to 11 loop
	  q(j):=num2(i)and ma(j);
	  end loop;
	  acc:=acc+q;
	  ma:=ma(10 downto 0)&ma(11);
	end loop;
	num<=acc;
	end if;
end process;  end Behavioral;

⌨️ 快捷键说明

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