2021-07-02

这篇文章详细介绍了如何使用Verilog语言设计一个模块,用于实现一个带同步时钟和控制信号的latched七段数码管显示器。通过参数定义不同数字的代码映射,并利用计数器和blanking信号控制显示过程。
摘要由CSDN通过智能技术生成

1.实验代码

module Latched_Seven_Seg_Display (
   output reg [6:0] Display_L, Display_R,
   input Blanking,,Enable,clock,reset
);
   reg [3: 0]count;
//                                      abc_defg
   parameter BLANK=      7'b111_1111;
   parameter ZERO=        7'b000_0001;      // h01
   parameter ONE=          7'b100_1111;     // h4f

   parameter TWO=          7'b001_0010;// h12
   parameter THREE=       7'b000_0110;// h06
   parameter FOUR=        7'b100_1100;// h4c
   parameter FIVE=          7'b010_0100;// h24
   parameter SIX=            7'b010_0000;// h20
   parameter SEVEN=       7'b000_1111;// h0f
   parameter EIGHT=        7'b000_0000;// h00
   parameter NINE=         7'b000_0100;// h04
   always @(posedge clock)
     if (reset) count <= 0;
     else if (Enable) count <= count+1;

   always @(count,Blanking)
    if (Blanking) begin Display_L = BLANK; Display_R= BLANK; end else
     case (count)
      0: begin Display_L=ZERO; Display_R = ZERO; end
      2: begin Display_L=ZERO; Display_R = TWO; end
      4: begin Display_L=ZERO; Display_R = FOUR; end
      6: begin Display_L=ZERO; Display_R = SIX; end
      8: begin Display_L=ZERO; Display_R = EIGHT; end
      10: begin Display_L=ONE; Display_R = ZERO; end
      12: begin Display_L=ONE; Display_R = TWO; end
      14: begin Display_L=ONE; Display_R = FOUR; end
     `//default: begin Display_L=BLANK; Display_R = BLANK;  end
     endcase
endmodule

2.结果


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值