2016年7月6日

红绿灯的状态机实现

摘要: 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) 编辑

导航