基于FPGA的乘累加模块设计VHDL代码ISE仿真

名称:基于FPGA的乘累加模块设计VHDL代码ISE仿真(文末获取)

软件:ISE

语言:Verilog

代码功能:

乘累加模块

A.B分别输入两种正弦波形

在1000个时钟周期对AB同时采样样并计算

QQ图片20240530183958.png

控制要求:存在时钟使能信号和复位信号且当控制信号nd,fd同时为“1”时模块运行,运行完成后,rdy返回“1”

要求.jpg

1. 工程文件

2. 程序文件

3. 程序编译

4. Testbench

5. 仿真图

部分代码展示:

module mult_add(
input clk,//10M
input rst_p,
input enable,
input nd,fd,
input [13:0]A,
input [13:0]B,
output rdy,
output [37:0]X
);
reg ce;
reg [9:0] count=10'd0;
always@(posedge clk or posedge rst_p)
if(rst_p)
count<=10'd0;
else if(enable)begin
if(nd & fd)
if(count>10'd1000)
count<=count;
else
count<=count+10'd1;
else
count<=10'd0;
end
else
count<=count;
always@(posedge clk)
if(count>0 && count<=1000)
ce<=1;
else
ce<=0;
reg [13:0]A_buf0;
reg [13:0]B_buf0;
reg [13:0]A_buf1;
reg [13:0]B_buf1;

源代码

 扫描文章末尾的公众号二维码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值