标题:
基于FPGA的数字跑表代码
[打印本页]
作者:
迪西
时间:
2019-1-2 14:08
标题:
基于FPGA的数字跑表代码
基于Verilog HDL 语言FPGA的数字跑表代码分享给大家
0.png
(14.8 KB, 下载次数: 65)
下载附件
2019-1-3 01:29 上传
源程序:
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 20:33:30 09/26/2018
// Design Name:
// Module Name: count
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module count(
input clk_100Hz,
input rst,
input E,
output wire [3:0] s1,
output wire [3:0] s2,
output wire [3:0] s3,
output wire [3:0] s4,
output wire [3:0] s5,
output wire [3:0] s6
);
reg [3:0]i;
reg [3:0] count[1:6];
initial
begin
for(i=1;i<5;i=i+1)
begin
count[i]=4'b0000;
end
i=0;
end
always @ (posedge clk_100Hz)
begin
if(rst)
begin
for(i=1;i<7;i=i+1)
count[i]=4'b0000;
end
else if(!E)
begin
for(i=1;i<7;i=i+1)
count[i]=count[i];
end
else
begin
if(count[1]<10)
count[1]=count[1]+1;
if(count[1]==10)
begin
count[1]=0;
count[2]=count[2]+1;
end
if(count[2]==10)
begin
count[2]=0;
count[3]=count[3]+1;
end
if(count[3]==10)
begin
count[3]=0;
count[4]=count[4]+1;
end
if(count[4]==6)
begin
count[4]=0;
count[5]=count[5]+1;
end
if(count[5]==10)
begin
count[5]=0;
count[6]=count[6]+1;
end
if(count[6]==6)
begin
for(i=1;i<7;i=i+1)
count[i]=4'b0000;
end
end
end
assign s1 = count[1];
assign s2 = count[2];
assign s3 = count[3];
assign s4 = count[4];
assign s5 = count[5];
assign s6 = count[6];
endmodule
复制代码
全部资料51hei下载地址:
u7utu7.zip
(1.39 MB, 下载次数: 46)
2019-1-2 14:07 上传
点击文件名下载附件
数字跑表
下载积分: 黑币 -5
作者:
sawyou
时间:
2019-6-14 16:14
tks,just need it!
作者:
2333bb
时间:
2020-6-15 09:31
sawyou 发表于 2019-6-14 16:14
tks,just need it!
??我要看下这个
作者:
pswang225
时间:
2020-6-17 21:35
刚好需要,谢谢!
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1