急求!!VHDL语言编写8位乘法器程序

来源:百度知道 编辑:UC知道 时间:2024/05/21 12:14:25
要求能设置输入的两个乘数(十进制),按操作键后以十进制的方式显示积。

参考1 :LED显示程序

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity tled is
port(din: in std_logic_vector(7 downto 0);
sn: out std_logic_vector(2 downto 0);
clk: in std_logic;
LED7: out std_logic_vector(6 downto 0));
end tled;
architecture behv of tled is
signal he: std_logic_vector(3 downto 0);
signal ds: std_logic_vector(2 downto 0);
begin
process (din)
begin
if clk='1' then
he <= din ( 3 downto 0) ; ds <= "010" ;
else
he <= din ( 7 downto 4); ds <="011";
end if;
case he is
when "0000" => LED7 <="0111111"; --"0" / 39h
when "0001" => LED7 <="0000110"; --"1" / 06h
when "0010" => LED7 <="1011011"; --"2" / 5Bh
when "0011" => LED7 <="10011