1 //电子表的设计包括正常计时模块,LED显示模块,定时报警模块,校时模块,秒表模块。 2 //(1)正常计时模块clock 3 module clock(clk,rst,clock_en,second,minute,hour); 4 input clk,rst,clock_en; 5 output[5:0]second,minute,hour; 6 reg[5:0]second,minute,hour; 7 always@(posedge clk or negedge rst or posedge clock_en) 8 if(!rst) 9 begin 10 second<=0; minute<=0; hour<=0; 11 end 12 else if(clock_en) 13 begin 14 if(second==59) 15 begin 16 minute<=minute+1; 17 second<=0; 18 end 19 else if(minute==59) 20 begin 21 hour<=hour+1; 22 minute<=0; 23 end 24 else if(hour==23) 25 hour<=0; 26 else 27 second<=second+1; 28 end 29 endmodule
30 //(2)LED显示模块LED_display 31 module LED_display(data,high,low); 32 input[5:0]data; 33 output[7:0]high,low; 34 reg[7:0]high,low; 35 reg[3:0]out_h,out_l; 36 always@(data) 37 begin 38 out_h<=data/10; 39 out_l<=data; 40 end 41 always@(out_l) 42 case(out_l) 43 4'b0000:low<=8'b00000000; 44 4'b0001:low<=8'b01100000; 45 4'b0010:low<=8'b11011010; 46 4'b0011:low<=8'b11110010; 47 4'b0100:low<=8'b01100110; 48 4'b0101:low<=8'b10110110; 49 4'b0110:low<=8'b10111110; 50 4'b0111:low<=8'b11100000; 51 4'b1000:low<=8'b11111110; 52 4'b1001:low<=8'b11110110; 53 default:low<=8'b00000000; 54 endcase 55 56 always@(out_h) 57 case(out_h) 58 4'b0000:high<=8'b00000000; 59 4'b0001:high<=8'b01100000; 60 4'b0010:high<=8'b11011010; 61 4'
相关推荐
基于Verilog的多功能电子表
基于Verilog的多功能电子表,文本打开.v文件,配置引脚后测试
基于Verilog的电子表
基于Verilog的电子表。具有闹钟和显示当前时间的功能,时分秒。可通过按键调节时间。代码附较为详细的注释
Verilog电子表编程实例
电子表Verilog编程 多功能电子表共有5种功能:功能1为数字钟;功能2为数字跑表;功能3为调时;功能4为闹钟设置;功能5为日期设置。除调时功能以外,电子表处于其他功能状态下时并不影响数字钟的运行。使用数字钟功能时,还可以通过按键快速查看当前的闹钟设置时间和当前日期。该电子表利用EDA实验平台的扬声器整点报时和定时报时,设置3个按键分别作为功能键和调整键。
用于FPGA的Verilog语言的电子表
用于FPGA的Verilog语言的电子表 内涵引脚图
verilog语言描述的电子表
用verilog语言描述的计数器,可用以电子表的设计,有六进制和十进制的计数器,有24进制的计数器
FPGA实现电子表verilog
利用FPGA开发板实现的电子表功能;初始默认状态显示时间,具有闹钟提示功能;可以倒计时,并且可修改倒计时时间;具有多通道计时器功能,计时完成后可以查看计时记录。针通过vivado开发软件设计,并于bsay3 等多款开发板上测试应用。
Robocup 仿真2D 学习笔记(二) 球队代码编译和上场
环境的一些问题 最近在使用rcssserver 和 rcssmonitor时可能会遇到./configure失败的问题,可以检查一下文件夹是否有makefile文件,如果是编译后的包直接sudo make install,如果还不行,还可以源码下载编译 rcssserver: https://sourceforge.net/projects/sserver/files/rcssserver/...
win10 运行lisflood_8踩过的坑
1、安装cuda及VS2019 https://www.bilibili.com/read/cv7335974/ 2、netcdf.h头文件找不到问题 https://www.cnblogs.com/lyggqm/p/12926974.html https://blog.youkuaiyun.com/u011954296/article/details/54617048 3、编码问题 https://blog.youkuaiyun.com/qq_33485434/article/details/81196843 4、
企业和个人 AI 编程工具怎么选?2025 年 12 款主流工具(Claude/Cursor 等)核心能力 + 收费对比
2025 年最火的 12 款 AI 编程工具,像 Claude、Cursor 这些热门款,我把它们的核心能力、收费标准全扒得明明白白,看完这篇你不用再瞎琢磨,直接就能挑到对的!再说说 Cursor,美国 Cursor Labs 做的,还拿过红杉资本投资,2022 年推出后,2024 年收入直接涨了 6400%,势头很猛。总之,不管你是企业技术管理者、程序员,还是刚入门的 AI 小白,按自己的需求(语言、合规、预算)挑,保准能找到最适合的 AI 编程工具!最后给大家划重点,不同需求直接对号入座:?
【机械视觉】Halcon—【二、Halcon算子全面介绍(超详细版)】
Halcon 的算子(operators)按照功能被系统性地划分为多个类别,官方文档中目前(Halcon 22.11 版本)共有 19 个主分类,每个主分类下还有若干子分类。 本人在此对这19个分类的常用核心算子进行了一系列的总结,且本人在文章最后还总结了一些案例经验。 注意: 跨分类调用:某些算子可能在多个分类中,但官方文档中会明确其主分类。 例如: read_image(文件操作)常被其他分类(如图像处理)的示例调用,但其核心功能是文件读取。
Ubuntu升级遇到grub-efi-amd64-signed报错?3步搞定这个烦人的EFI目录问题
本文详细解析了Ubuntu系统升级时遇到的“grub-efi-amd64-signed”报错及“cannot find EFI directory”问题。通过剖析UEFI启动机制与EFI系统分区原理,提供了从诊断到修复的三步解决方案,帮助用户快速解决因EFI目录未挂载导致的升级中断,确保系统引导正常。
迪文DGUSII串口屏中文显示实战:手把手教你制作16x16点阵字库
本文提供了一份迪文DGUSII串口屏16x16点阵中文字库制作的完整实战指南。从显示原理、字体选择与参数设置,到使用FontLib Make工具生成字库文件,再到部署、调用及存储空间优化,手把手教你解决中文显示难题,确保界面文字既美观又稳定。
嵌入式软考必备知识点:嵌入式系统开发中的重要概念和示例代码
在嵌入式软考中,有一些重要的知识点需要掌握,包括嵌入式系统的基本概念、编程语言、实时操作系统和硬件接口等。实时操作系统是一种专门设计用于嵌入式系统的操作系统,可以提供对任务调度、中断处理和资源管理等方面的支持。GPIO(通用输入输出):GPIO是嵌入式系统中常用的硬件接口,用于连接外部设备和嵌入式系统。以上是嵌入式软考中的一些必备知识点,包括嵌入式系统的基本概念、编程语言、实时操作系统和硬件接口。通过配置串口的波特率、数据位数和校验位等参数,可以实现与其他设备的可靠通信。一、嵌入式系统的基本概念。
《民机适航入门指南:从法规学习到项目实践的全面解析》
适航(Airworthiness)是指航空器、其发动机、螺旋桨和其他部件在规定条件下,能够安全飞行并满足有关航空法规规定的条件。简而言之,适航代表了航空器在任何时候都能安全运营的状态。适航在民用航空领域尤为关键,因为飞机必须经过严格的适航认证才能投入商用。这些认证的目标是确保飞机能够在广泛的运行条件下保持飞行安全,从而保护乘客、机组和地面人员的生命财产安全。适航法规覆盖了飞机的整个生命周期,包括设计、制造、测试、运营、维护和报废。
计算机控制技术及应用
《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。
怀旧版电脑GBC模拟器
再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片
基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正
6015



被折叠的 条评论
为什么被折叠?



