随笔分类 -  2020校招:Verilog

摘要:其实 offer 早就定下来了,最近忙着入党考试,现在才腾出时间来写个总结。我校招开始于 7 月底,算是比较晚了,后面加了各大校招交流群,发现很多同学都是过完年后就开始打磨项目、复习基础、寻找实习。对比之下我这准备确实仓促,不过结果还算满意。 一、学习历程 本科普通211,非电子计算机强校,大三决定 阅读全文
posted @ 2020-10-16 22:42 咸鱼IC 阅读(13458) 评论(36) 推荐(12) 编辑
摘要:如何处理跨时钟域信号? 单bit: (1)双D触发器打拍同步;(只能慢到快) (2)脉冲展宽处理(握手法); 多bit: (1)格雷码+双D触发器打拍;(不推荐) (2)DMUX数据使能选通设计;(FIFO设计) (3)异步握手协议;(效率较低) 这里写一下单bit进行跨时钟域的代码设计,如果设计时 阅读全文
posted @ 2020-09-09 20:42 咸鱼IC 阅读(4403) 评论(0) 推荐(1) 编辑
摘要:一、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 阅读全文
posted @ 2020-09-09 20:40 咸鱼IC 阅读(946) 评论(0) 推荐(0) 编辑
摘要:一、整数倍拼接 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 阅读全文
posted @ 2020-09-09 20:38 咸鱼IC 阅读(2857) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-09-09 20:34 咸鱼IC 阅读(2574) 评论(0) 推荐(0) 编辑
摘要:要求: 用 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 阅读全文
posted @ 2020-09-09 20:33 咸鱼IC 阅读(1445) 评论(0) 推荐(0) 编辑
摘要:一、串并转换 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 阅读全文
posted @ 2020-08-17 21:17 咸鱼IC 阅读(4397) 评论(0) 推荐(1) 编辑
摘要:一、序列检测发生器 以产生 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 阅读全文
posted @ 2020-08-17 20:52 咸鱼IC 阅读(1996) 评论(0) 推荐(0) 编辑
摘要:一、同步FIFO 1、代码 1 //************************************************************************** 2 // *** 名称 : sFIFO.v 3 // *** 作者 : xianyu_FPGA 4 // *** 阅读全文
posted @ 2020-08-16 16:37 咸鱼IC 阅读(2943) 评论(3) 推荐(0) 编辑
摘要:要求: 参考时钟 50Mhz,检测时钟为 1-200Mhz,写出Verilog来。 一、设计 1 module clock_test 2 // < 参数 > 3 #( 4 parameter CLK_S_FRE = 31'd50 , // 基准时钟频率值 5 parameter GATE_TIME 阅读全文
posted @ 2020-08-13 13:07 咸鱼IC 阅读(2402) 评论(7) 推荐(0) 编辑
摘要:一、题目 在一个时钟周期内算出输入的13路脉冲信号中,高电平的个数。 二、代码 1 //************************************************************************** 2 // *** 描述 : 在一个时钟周期内算出13路脉冲信号 阅读全文
posted @ 2020-08-09 14:00 咸鱼IC 阅读(2560) 评论(3) 推荐(0) 编辑
摘要:一、同步复位(by Crazybingo) 1.代码 module system_ctrl // <端口> ( //globel clock input wire clk , //时钟,50Mhz input wire rst_n , //复位,低电平有效 //user interface inpu 阅读全文
posted @ 2019-03-13 16:28 咸鱼IC 阅读(9534) 评论(3) 推荐(2) 编辑
摘要:“你写的不是程序,是电路!”这句话听了很多,大多数人还是搞不太懂。程序怎么能是电路呢?这里将一些典型的Verilog转电路图贴出来,也许可以稍稍理解电路思想了。 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 19. 20. 21 阅读全文
posted @ 2018-12-14 20:21 咸鱼IC 阅读(7544) 评论(0) 推荐(1) 编辑
摘要:一、按键抖动原理 按键抖动原理:按键存在一个反作用弹簧,因此当按下或者松开时均会产生额外的物理抖动,物理抖动会产生电平的抖动。 消抖方法:一般情况下,抖动的总时间会持续20ms以内,按下按键后,等20ms过去了再取键值就行了。 市面上有多种按键消抖的方法,我对比了各家的代码,发现有两种方法非常好用, 阅读全文
posted @ 2018-12-05 22:44 咸鱼IC 阅读(2061) 评论(0) 推荐(1) 编辑
摘要:一、代码 1 //************************************************************************** 2 // *** 名称 : div_clk.v 3 // *** 作者 : xianyu_FPGA 4 // *** 博客 : ht 阅读全文
posted @ 2018-11-30 21:45 咸鱼IC 阅读(1916) 评论(0) 推荐(0) 编辑
摘要:PWM呼吸灯,从51单片机开始玩的东西,在FPGA上再实现一次,见代码: 一、设计文件 1 // 2 // 名称 : breathing_led 3 // 作者 : xianyu_FPGA 4 // 日期 : 2018-12-15 5 // 描述 : PWM频率调制实现真呼吸灯的效果,4秒1次循环, 阅读全文
posted @ 2018-11-26 11:06 咸鱼IC 阅读(2057) 评论(0) 推荐(0) 编辑