2016年7月6日

数字时钟实现与动态可调与闹钟功能的实现

摘要: 设计的RTL结构 处理模块实现模式切换与计数,4位数码管解码后 595control模块控制数码管的点闪动以及调时位的半秒闪动,595function模块16位串行输出给595驱动数码管显示 module jishu(input clk,input rst_n,output [3:0] row_da 阅读全文

posted @ 2016-07-06 20:04 xinshuwei 阅读(713) 评论(0) 推荐(0) 编辑

pwm 占空比 频率可调的脉冲发生器

摘要: module xuanpin #(parameter N=25)(clk,clr,key_in_f,key_in_z,f_out);input clk,clr,key_in_f,key_in_z;output reg f_out;reg clk0,clk1,clk2,clk3,clk4,clk5,c 阅读全文

posted @ 2016-07-06 19:56 xinshuwei 阅读(1338) 评论(0) 推荐(0) 编辑

红绿灯的状态机实现

摘要: module traffic(clk,rst,out,time1,time2);input clk,rst;output reg [5:0] out; reg [3:0]timecont;output reg [3:0]time1;output reg[3:0]time2; wire clk1h; 阅读全文

posted @ 2016-07-06 19:56 xinshuwei 阅读(1745) 评论(0) 推荐(0) 编辑

序列检测101 状态机实现

摘要: module jiance # (parameter CNT_NUM = 12500000) ( clk,rst_n,data, clk_1hz,out);input clk,rst_n,data;output reg out,clk_1hz;reg [1:0] cstate,nstate;para 阅读全文

posted @ 2016-07-06 19:54 xinshuwei 阅读(1019) 评论(0) 推荐(0) 编辑

SPI 2分频MOSI实现

摘要: module spi_25M(input clk,input rst_n,output reg sdin,output reg sclk,output reg cs);reg [7:0]cnt;reg[4:0]state;reg[15:0]data; /*always@(clk) if(!rst_n 阅读全文

posted @ 2016-07-06 19:52 xinshuwei 阅读(492) 评论(0) 推荐(0) 编辑

常用频率分频

摘要: module fenpin #(parameter N=25000_000)(clk,clr,clk0,clk1,clk2,clk3,clk4);input clk,clr;output clk0,clk1,clk2,clk3,clk4;reg clk0,clk1,clk2,clk3,clk4;re 阅读全文

posted @ 2016-07-06 19:51 xinshuwei 阅读(383) 评论(0) 推荐(0) 编辑

25M电子琴实现

摘要: module qin(input clk,output reg beep,input [3:0] col,output [3:0] row_data,output [7:0]out ,input rst_n);wire [3:0] key;wire en;parameter STOP=0, DOD= 阅读全文

posted @ 2016-07-06 19:49 xinshuwei 阅读(316) 评论(1) 推荐(0) 编辑

25M时钟的梁祝演奏

摘要: module liangzhu(clk_50M,rst,speaker); input clk_50M,rst; output speaker; reg speaker; //分频计数器parameter wide=15;reg[7:0] cnt; //音名数reg[3:0] cnt1; //5MH 阅读全文

posted @ 2016-07-06 19:47 xinshuwei 阅读(249) 评论(0) 推荐(0) 编辑

基于小脚丫DDS 调频 调幅 调相 切换波形 AD5601输出模拟波形

摘要: 先讲讲里面的矩阵键盘,矩阵键盘列有下拉电阻,默认全为0000,默认行输入为1111,当有按键按下的时候,列输入会被拉高,这时控制行的输出做行扫描,电子琴用key_flag_r0电平作为使能,这里用key_flag消抖后与键值进行按位与,作为相应按键的判断条件。 module juzhen(input 阅读全文

posted @ 2016-07-06 19:39 xinshuwei 阅读(876) 评论(0) 推荐(0) 编辑

spi 10方式编写

摘要: //第一个CS变低的时候要sclk为高电平,第一个跳变沿进行赋值 module spi(input clk,input rst_n,output reg sclk,output reg cs,output reg sdin);reg [2:0]cnt;reg [5:0]state;reg[1:0]s 阅读全文

posted @ 2016-07-06 19:11 xinshuwei 阅读(157) 评论(0) 推荐(0) 编辑

VGA colorbar显示

摘要: module VGAcolorbar(clk,rst,hsync,vsync,vga_r,vga_g,vga_b ); input clk; input rst; output hsync; output vsync; output [2:0] vga_r; output [2:0] vga_g; 阅读全文

posted @ 2016-07-06 19:07 xinshuwei 阅读(484) 评论(0) 推荐(0) 编辑

基于小脚丫的ADC081S101 电压采集595数码管显示

摘要: RTL结构图 采集模块运用SPI 通讯 MISO方式收集数据 module ad_collect(input sddata,input rst_n,output reg cs,output reg sclk,input clk,output [7:0]seg_data,output done); r 阅读全文

posted @ 2016-07-06 19:05 xinshuwei 阅读(664) 评论(0) 推荐(0) 编辑

qam 64的设计

摘要: module qam64(x,out,clk,clk1,rst);input x,clk,clk1,rst;output [18:0] out;reg [2:0] count;reg [5:0] reg1,reg2;reg [18:0] ssig,csig;reg [15:0] sine;reg [ 阅读全文

posted @ 2016-07-06 18:56 xinshuwei 阅读(343) 评论(0) 推荐(0) 编辑

流水灯的按键方向控制

摘要: module liushuideng( clk,rst_n,led_0,sw1_n,sw2_n,sw3_n);input clk; //时钟信号,50MHZinput rst_n; //复位信号,低电平有效input sw1_n,sw2_n,sw3_n; //三个独立按键,低表示按下output[3 阅读全文

posted @ 2016-07-06 18:55 xinshuwei 阅读(3419) 评论(0) 推荐(0) 编辑

按键仿真的时候的模型

摘要: 按键仿真模型 `timescale 1ns/1ns //仿真模型的建立module key_model(press,key); output reg key; input press; initial begin key = 1'b1; end always@(posedge press) key_ 阅读全文

posted @ 2016-07-06 18:53 xinshuwei 阅读(379) 评论(0) 推荐(0) 编辑

导航