美文网首页
Verilog分频器及彩灯

Verilog分频器及彩灯

作者: 南枳北桔 | 来源:发表于2017-12-04 23:00 被阅读0次

彩灯循环可通过计数器来实现:如当计数值为1时,out(out为8位寄存器)为00000001,为计数值为2时,out为00000010,……等等,通过对out的控制可实现多种彩灯循环方案的设计。

module div12(clk_in,reset,clk_out);
input clk_in,reset;
output clk_out;
reg[3:0] clk_temp;
assign clk_out = (clk_temp=11)?1:0;
always@(posedge clk_in)

if(~reset)

begin clk_temp=0;end

else if(clk_temp=11)

clk_temp=0;

else
begin
clk_temp = clk_temp + 1;
end

endmodule

二分频

module div_fre(clk_in,clk_out);
input clk_in;
output clk_out;
reg clk_out;
always @(posedge clk_in)
begin
clk_out = ~clk_out;
end
endmodule

module div2(clk_in,clk_out);
input clk_in;
output clk_out;
reg clk_temp;
assign clk_out = clk_temp;
always@(posedge clk_in)
begin
clk_temp = clk_temp + 1;
end
endmodule

相关文章

  • Verilog分频器及彩灯

    彩灯循环可通过计数器来实现:如当计数值为1时,out(out为8位寄存器)为00000001,为计数值为2时,ou...

  • Verilog 语言简介

    什么是 Verilog 语言 Verilog一般指Verilog HDL。Verilog HDL是一种硬件描述语言...

  • 店铺摆放标准

    门口彩灯及光告摆放

  • 分频器的Simulink仿真

    分频器仿真框图,其组成仅有三台设备:脉冲发生器,分频器和示波器。 分频器送出一个到达脉冲,第一路cnt(计数),它...

  • 2020-10-03 分频比

    分频器设置为0:不分频,分频比1. 分频器设置为2:2分频. 一种计算分频器设置值的方法:计数器频率/目标频率-1

  • 干货:音频处理器设置规则(分频分析)

    长期以来,人们对分频器有一些错误的认识,不知道分频器是什么?不知道分频器在多功放扩声系统中怎么使用? 过去,只有专...

  • Verilog:基础语法(上)

    Verilog HDL简介 Verilog HDL(简称 Verilog )是一种硬件描述语言,用于数字电路的系统...

  • 2018-12-28

    Verilog基础知识0(`define、parameter、localparam三者的区别及举例) 转载自CSD...

  • PLI

    Verilog PLI(Programming Language Interface )是一种Verilog代码调...

  • 2017年12月13日学习总结

    今天上午学习了spi iic spi :波特率=是SCK时钟速率。 分频器的分频器使用=是从APB总线...

网友评论

      本文标题:Verilog分频器及彩灯

      本文链接:https://www.haomeiwen.com/subject/gkgfixtx.html