📄 hex2led_common_anode.v
字号:
////////////////////////////////////////////////////////////////////////////////// *****************************************************************************// * RICHIC CONFIDENTIAL PROPRIETARY NOTE *// * *// * This software contains information confidential and proprietary to *// * RicHic Inc.It shall not be reproduced in whole or in part or transferred *// * to other documents, or disclosed to third parties, or used for any *// * purpose other than that for which it was obtained, without the prior *// * written consent of RicHic Inc. *// * (c) 2003, 2004, 2005 RicHic Inc. *// * All rights reserved * // *****************************************************************************//// (C) 2004 fpga_ic@yahoo.com.cn; // http://www.richic.com//////////////////////////////////////////////////////////////////////////////////module hex2led_common_anode (hex, led) ;input [3:0] hex ;output [6:0] led ;reg [6:0] led;//hex-to-seven-segment decoder//// segment encoding// 0// --- // 5 | | 1// --- <- 6// 4 | | 2// ---// 3always @(hex)begin case (hex) 4'b0001 : led = 7'b1111001; //1 4'b0010 : led = 7'b0100100; //2 4'b0011 : led = 7'b0110000; //3 4'b0100 : led = 7'b0011001; //4 4'b0101 : led = 7'b0010010; //5 4'b0110 : led = 7'b0000010; //6 4'b0111 : led = 7'b1111000; //7 4'b1000 : led = 7'b0000000; //8 4'b1001 : led = 7'b0010000; //9 4'b1010 : led = 7'b0001000; //A 4'b1011 : led = 7'b0000011; //b 4'b1100 : led = 7'b1000110; //C 4'b1101 : led = 7'b0100001; //d 4'b1110 : led = 7'b0000110; //E 4'b1111 : led = 7'b0001110; //F default : led = 7'b1000000; //0 endcaseendendmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -