摘要: module pw_led( input wire clk, input wire rst, output reg led); parameter sec2=2*5000;//0000; parameter oneport=sec2/1000; reg[31:0] clk_cnt; reg[31:0 阅读全文
posted @ 2021-07-30 13:29 涛大林 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 因为是5分频 所以pcnt=2 为1 pcnt=4 为0 如果是7分频 则 pcnt=3 为1 pcnt=6 为0 还想着用怎么pos_flag 作上升沿 neg_flag 作下降沿 没想到最后运用了或运算 。。。。。 always@(posedge clk) begin if (rst) begi 阅读全文
posted @ 2021-07-29 16:24 涛大林 阅读(63) 评论(0) 推荐(0) 编辑
摘要: file newproject location 创建文件夹ise_prj 用的芯片family spartan6 device XC6SLX PACLAGE TQG144 SPEED -2 SIMULATOR MODELSIM_SE MIXED Implementation 实际编码的过程 Sim 阅读全文
posted @ 2021-07-29 12:30 涛大林 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 用 clk 来控制 cnt ;用 cnt 来控制 FLAG ;用 FLAG 来控制 led module led( input wire clk, input wire rst, output reg led); reg [31:0]clk_cnt; parameter clk_50M=499;// 阅读全文
posted @ 2021-07-29 09:58 涛大林 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 不调用pll核 没办法倍频 在fpga开发中如果pll资源够用 还是建议使用pll进行分频 因为pll是一个专用电路 它生成的时钟到达每一级寄存器之间的延迟是固定的 ,称时钟偏斜比较小 可以用visio软件画波形图 modelsin 输入quit-sim结束仿真 为什么po_cnt赋初始值仿真才不是 阅读全文
posted @ 2021-07-27 06:54 涛大林 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 有负的值就离谱 为啥啊。。。 原来是 8的时候为1000 首位为1所以显示成负数了 好家伙。。。 那没事了 module net8( input wire clk, input wire rst, output reg [3:0]po_cnt); always @(posedge clk or po 阅读全文
posted @ 2021-07-21 22:43 涛大林 阅读(73) 评论(0) 推荐(0) 编辑
摘要: if else 语句 case endcase 语句 if else 不宜叠加太多 会造成线路的延时过多 每一级都有延时 尽量不要多于8级 在fpga里都是对应的查找表 因为逻辑都是映射成查找表 多路选择器 一下子判断 没有先后顺序 满足便执行 always@(posedge clk) begin 阅读全文
posted @ 2021-07-21 21:55 涛大林 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 题目理解错误 以为都是在同一个代码中实现 。。。 阴错阳差的实现了循环 好家伙。。。 用移位运算符需要加一个循环代码 位拼接则不用 `timescale 1ns/1ns module tb_net7(); reg clk; reg rst; wire [7:0]po_a; initial clk=0 阅读全文
posted @ 2021-07-21 00:16 涛大林 阅读(272) 评论(0) 推荐(0) 编辑
摘要: +—可以 乘除不建议用×/ 因为在硬件电路里边有我们的可调用 ip核 实际使用手动来调用ip核来实现乘除法才是最优的。 求模运算%也是不建议在代码中大量的用 因为它会占用我们的逻辑资源 想得到一个0~9的随机数 如何实现:{$random}%10 ,为什么等于0到9?其实质为求模运算取余数 rand 阅读全文
posted @ 2021-07-20 23:42 涛大林 阅读(610) 评论(0) 推荐(0) 编辑
摘要: // This is a simple example. // You can make a your own header file and set its path to settings. // (Preferences > Package Settings > Verilog Gadget 阅读全文
posted @ 2021-07-20 22:41 涛大林 阅读(125) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示