博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【iCore4 双核心板_FPGA】例程八:乘法器实验——乘法器使用
阅读量:4308 次
发布时间:2019-06-06

本文共 970 字,大约阅读时间需要 3 分钟。

实验现象:

程序运行时,绿色led闪烁(目前,具体的乘法器调用请参考iCore3乘法器例程)

核心代码:

module multiplier_ctrl(    input clk_25m,    input rst_n,    output fpga_ledg);//--------------------clk_10hz------------------------------//reg[22:0]cnt;reg clk_10hz;always @(posedge clk_25m or negedge rst_n)    if(!rst_n)        begin            clk_10hz <= 1'd0;            cnt <= 23'd0;        end    else if(cnt == 23'd2499_999)        begin            clk_10hz <= ~clk_10hz;            cnt <= 23'd0;        end    else cnt <= cnt + 1'd1;//--------------------data_in&data_out-----------------------//reg[7:0]a;always @(posedge clk_10hz or negedge rst_n)    if(!rst_n)        a <= 8'd0;    else if(a == 8'd250)        a <= 8'd0;    else a <= a + 1'd1;        my_mult  u1(    .dataa(a),    .datab(a),    .result(out));wire [15:0]out;assign fpga_ledg = out[6];//--------------------endmodule----------------------------//endmodule

源代码下载链接:

链接: 密码:h80p

iCore4链接:

转载于:https://www.cnblogs.com/xiaomagee/p/7416651.html

你可能感兴趣的文章
jquery关于多个显示隐藏
查看>>
asp.net core中使用log4net
查看>>
c++ STL deque容器成员函数
查看>>
LeetCode Contains Duplicate (判断重复元素)
查看>>
SVN安装部署
查看>>
MPU6050开发 -- 卡尔曼滤波(转)
查看>>
Redis主从实战
查看>>
plsql if
查看>>
LuoGu P2002 消息扩散
查看>>
linux 下安装JDK
查看>>
简单的ASP.NET无刷新分页
查看>>
宏定义学习
查看>>
omitting directory `folder/'
查看>>
JavaScript面试题
查看>>
TCollector
查看>>
我的博客网站开发6——博文关键字搜索
查看>>
vim7.1在windows下的编码设置[转]
查看>>
同步器之Exchanger
查看>>
IO流
查看>>
专家观点:即使在云中 硬件同样至关重要
查看>>