随笔分类 - 2020校招
摘要:一、2-4译码器 1 module Decode_2_4 2 ( 3 input [1:0] indata, 4 input enable_n, 5 output reg [3:0] outdata 6 ); 7 8 always @(*)begin 9 if(enable_n == 1'b1) 1
阅读全文
摘要:一、整数倍拼接 1 module width_change_8to16 2 ( 3 input clk , 4 input rst_n , 5 input a_vld , 6 input [ 7:0] a , 7 output reg b_vld , 8 output reg [15:0] b 9
阅读全文
摘要:module homework3 ( input clk,rst,load, input [3:0] data_in0,data_in1,data_in2,data_in3,data_in4,data_in5,data_in6,data_in7, output [3:0] data_out0,dat
阅读全文
摘要:要求: 用 Verilog 实现 glitch free 时钟切换电路。输入 sel,clka,clkb,sel 为 1 输出 clka,sel 为 0 输出 clkb。 module Change_Clk_Source ( input rst_n, input clk_a, input clk_b
阅读全文
摘要:一、串并转换 module left_shifter_reg ( input clk , input rst_n , input din , output reg [7:0] dout ); always @(posedge clk or negedge rst_n) begin if(!rst_n
阅读全文
摘要:一、序列检测发生器 以产生 11010 的序列为例,设计代码如下: 1 module seq_gen( 2 input clk , 3 input reset , 4 output out 5 ); 6 7 reg [4:0] shift ; 8 9 always@(posedge clk or p
阅读全文
摘要:一、概念 1、浮点数:小数点位置是漂浮不定的。 例如:浮点数运算 1.1 * 1.1 = 1.21,小数点位置发生了变化。 IEEE 754 规定,浮点数的表示方法为: 最高的 1 位是符号位 s,接着的 8 位是指数E,剩下的 23 位为有效数字 M。 2、定点数:小数点的位置是确定的。 例如:定
阅读全文
摘要:一、同步FIFO 1、代码 1 //************************************************************************** 2 // *** 名称 : sFIFO.v 3 // *** 作者 : xianyu_FPGA 4 // ***
阅读全文
摘要:要求: 参考时钟 50Mhz,检测时钟为 1-200Mhz,写出Verilog来。 一、设计 1 module clock_test 2 // < 参数 > 3 #( 4 parameter CLK_S_FRE = 31'd50 , // 基准时钟频率值 5 parameter GATE_TIME
阅读全文
摘要:一、题目 在一个时钟周期内算出输入的13路脉冲信号中,高电平的个数。 二、代码 1 //************************************************************************** 2 // *** 描述 : 在一个时钟周期内算出13路脉冲信号
阅读全文
摘要:一、同步复位(by Crazybingo) 1.代码 module system_ctrl // <端口> ( //globel clock input wire clk , //时钟,50Mhz input wire rst_n , //复位,低电平有效 //user interface inpu
阅读全文
摘要:“你写的不是程序,是电路!”这句话听了很多,大多数人还是搞不太懂。程序怎么能是电路呢?这里将一些典型的Verilog转电路图贴出来,也许可以稍稍理解电路思想了。 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 19. 20. 21
阅读全文
摘要:一、按键抖动原理 按键抖动原理:按键存在一个反作用弹簧,因此当按下或者松开时均会产生额外的物理抖动,物理抖动会产生电平的抖动。 消抖方法:一般情况下,抖动的总时间会持续20ms以内,按下按键后,等20ms过去了再取键值就行了。 市面上有多种按键消抖的方法,我对比了各家的代码,发现有两种方法非常好用,
阅读全文
摘要:一、代码 1 //************************************************************************** 2 // *** 名称 : div_clk.v 3 // *** 作者 : xianyu_FPGA 4 // *** 博客 : ht
阅读全文
摘要:PWM呼吸灯,从51单片机开始玩的东西,在FPGA上再实现一次,见代码: 一、设计文件 1 // 2 // 名称 : breathing_led 3 // 作者 : xianyu_FPGA 4 // 日期 : 2018-12-15 5 // 描述 : PWM频率调制实现真呼吸灯的效果,4秒1次循环,
阅读全文

浙公网安备 33010602011771号