代码如下

test.v文件

led.v文件

module test();

wire led_r,led_g,led_b;

reg clk = ;

always # clk <= ~clk;

led c1
(
.clk(clk),
.led_r(led_r),
.led_g(led_g),
.led_b(led_b)
);
endmodule
module led
(
input clk,
output reg led_r = ,
output reg led_g = ,
output reg led_b =
);
reg[:] cnt = ; //计数器 always @(posedge clk) //
begin
if(cnt <'d300*3)
cnt <= cnt + ;
else
cnt <= ;
case(cnt)
'd300:
begin
led_r <= ;
led_b <= ;
end
'd300*2:
begin
led_g <= ;
led_r <= ;
end
'd300*3:
begin
led_b <= ;
led_g <= ;
end
endcase
end endmodule

下载链接

https://pan.baidu.com/s/1hIuLFWrNn9MFfHEn4PfEzg

测试仿真波形:

verilog实现红黄蓝三秒灯的更多相关文章

  1. 非常有利于seo的主题(红黄蓝绿)通用教程

    这篇教程是帮助刚使用Wordpres的朋友们的,免得自己弄得一头雾水.大江网络来教大家了解下如何设置自定义导航菜单. 一.首先进入后台,点击“外观”,选择“菜单”按钮,如下图: 然后看到右边界面中菜单 ...

  2. Hierarchical clustering:利用层次聚类算法来把100张图片自动分成红绿蓝三种色调—Jaosn niu

    #!/usr/bin/python # coding:utf-8 from PIL import Image, ImageDraw from HierarchicalClustering import ...

  3. FPGA驱动LCD显示红绿蓝彩条

    实验目的:先简单熟悉LCD灯的驱动和时序图的代码实现.设计功能是让LCD显示红绿蓝三种颜色,即三个彩带.本次实验比较容易实现,主要是对LCD驱动时序图的理解和时序参数的配置. 实验条件:1.LCD原理 ...

  4. js-弹框倒计时三秒后,自动关闭???

    效果: js: //弹出窗,三秒倒计时 countdown(){ //点击发布按钮后,三秒倒计时开始 $(".btn-pub").click(function(){ var cou ...

  5. 阶段小项目1:循环间隔1秒lcd显示红绿蓝

    #include<stdlib.h>#include<stdio.h>#include<string.h>#include<error.h>#inclu ...

  6. Linux定时任务crontab每三秒执行一次shell

    第一种方法:当然首先想到的是写一个触发的脚本,在触发脚本中使用死循环来解决此问题,如下: cat kick.sh #!/bin/bash while : ;do /home/somedir/scrip ...

  7. [LeetCode] Similar RGB Color 相似的红绿蓝颜色

    In the following, every capital letter represents some hexadecimal digit from 0 to f. The red-green- ...

  8. [LeetCode] 800. Similar RGB Color 相似的红绿蓝颜色

    In the following, every capital letter represents some hexadecimal digit from 0 to f. The red-green- ...

  9. IOS引导页拨动4张图片最后一张停三秒进入主页,页面推送

    // //  ViewController.m // // //  Created by 张艳锋 on 15/8/26. //  Copyright (c) 2015年 张艳锋. All rights ...

随机推荐

  1. 在linux上安装svn

    1. 安装svn 输入命令:yum -y install subversion 检查是否安装成功: 输入命令:svn –version 2. 创建代码仓库 输入命令:mkdir -p /usr/loc ...

  2. Windows平台编译MySQL5.7源码

    https://blog.csdn.net/linjingke32/article/details/85111711

  3. 编码(2)从字节理解Unicode(UTF8/UTF16)

    https://www.cnblogs.com/zizifn/p/4716712.html 从字节理解Unicode(UTF8/UTF16) 如果你不知道或者不了解什么是Unicode/UTF8/UT ...

  4. SpringMVC学习(一)———— springmvc框架原理分析和简单入门程序

    一.什么是springmvc? 我们知道三层架构的思想,并且如果你知道ssh的话,就会更加透彻的理解这个思想,struts2在web层,spring在中间控制,hibernate在dao层与数据库打交 ...

  5. paramiko之ssh登录,执行cmd,下载文件

    一.paramiko远程登录及执行命令 1.1:exec_command(cmd)远程执行命令 client = paramiko.SSHClient() client.set_missing_hos ...

  6. μC/OS-II 的系统时钟

    简介 μC/OS-II 与大多数计算机系统一样,用硬件定时器产生一个周期为 ms 级的周期性中断来实现系统时钟,最小的时钟单位就是两次中断之间相间隔的时间,这个最小时钟单位叫做时钟节拍(Time Ti ...

  7. 南大算法设计与分析课程OJ答案代码(2)最大子序列和问题、所有的逆序对

    问题 A: 最大子序列和问题 时间限制: 1 Sec  内存限制: 4 MB提交: 184  解决: 66提交 状态 算法问答 题目描述 给定一整数序列 a1, a2, …, an,求 a1~an 的 ...

  8. sql server查询语句条件判断字段值是否为NULL

    判断字段是否为null select * from table where c is null    select * from table where c is not null 判断字段是否为空 ...

  9. EF 延时加载与死锁

    第一种 #region 第一种延迟加载 用到的时候就会去查询数据. //用到的时候就会去查询数据. //IQueryable<UserInfo> temp = from u in dbCo ...

  10. Field 'id' doesn't have a default value错误解决方法

    Field 'id' doesn't have a default value 错误提示. 主键类型获取方式为"native"由数据库生成指定. 检查发现数据库中已存在Employ ...