使用FPGA实现并行乘法器

介绍

并行乘法器,那么它的输入输出就都是并行的数据了,相对来说,内部的结构就更复杂了,占用的资源就更多了。以后有需要完成这部分操作的话都可以调用IP核。


乘法器模块

这是一个纯组合逻辑电路,我们也知道,在乘法其中,不涉及时序的问题。

输入是两个4位的二进制数据,输出是一个8位的二进制数据。


设计文件

这里涉及到的文件实在是有点多了,并且这个了解一下就可以了,详细的文件就放在压缩包了,这里就只列出了顶层文件。

library ieee;

use ieee.std_logic_1164.all;

use work.my_component.all;

entity multiplier is

port( a,b : in std_logic_vector(3 downto 0);

output : out std_logic_vector(7 downto 0) );

end entity;

architecture behavior of multiplier is

type matrix is array (0 to 3) of

std_logic_vector (2 downto 0);

signal s,c : matrix;

begin

u1: component top_row port map(a(0),b,s(0),c(0),output(0));

u2: component mid_row port map(a(1),b,s(0),c(0),s(1),c(1),output(1));

u3: component mid_row port map(a(2),b,s(1),c(1),s(2),c(2),output(2));

u4: component mid_row port map(a(3),b,s(2),c(2),s(3),c(3),output(3));

u5: component lower_row port map(s(3),c(3),output(7 downto 4));

end behavior;


测试文件

library ieee;

use ieee.std_logic_1164.all;

use work.my_component.all;

entity tb_multiplier is

end entity;

architecture behavior of tb_multiplier is

component multiplier is

port( a,b : in std_logic_vector(3 downto 0);

output : out std_logic_vector(7 downto 0));

end component;

signal a,b : std_logic_vector(3 downto 0);

signal output : std_logic_vector(7 downto 0);

begin

dut : multiplier

port map (

a,b,output);

process

begin

a <= "0000";

b <= "1101";

wait for 20ns;

a <= "1000";

b <= "0110";

wait for 20ns;

end process;

end architecture;


仿真结果


结语

从仿真结果中,我们可以看到完成了乘法器的操作,这只是4位乘法器的组成,如果输入位数更多,实现更复杂。有什么问题,小伙伴们留言奥。

相关推荐
Florence235 小时前
GPU和FPGA的区别
fpga开发
电棍23318 小时前
verilog笔记
笔记·fpga开发
ZxsLoves1 天前
【【Systemverilog学习参考 简单的加法器验证-含覆盖率】】
学习·fpga开发
Ronin-Lotus1 天前
嵌入式硬件篇---数字电子技术中的触发器
嵌入式硬件·fpga开发·触发器·数字电子技术·上位机知识
ehiway2 天前
FPGA+GPU+CPU国产化人工智能平台
人工智能·fpga开发·硬件工程·国产化
蓑衣客VS索尼克2 天前
什么是逻辑分析仪?
arm开发·人工智能·fpga开发
Terasic友晶科技3 天前
第29篇 基于ARM A9处理器用C语言实现中断<五>
c语言·fpga开发·定时器中断
9527华安3 天前
FPGA实现GTY光口视频转USB3.0传输,基于FT601+Aurora 8b/10b编解码架构,提供2套工程源码和技术支持
fpga开发·音视频·aurora·gty·usb3.0·ft601
博览鸿蒙3 天前
FPGA开发要学些什么?如何快速入门?
fpga开发
@晓凡3 天前
FPGA中利用fifo时钟域转换---慢时钟域转快时钟域
fpga开发