7seg

Embed Size (px)

DESCRIPTION

Seven segment

Citation preview

module seg7 (bcd, leds);input [3:0] bcd;output [1:7] leds;reg [1:7] leds;always @(bcd)case (bcd) //abcdefg0: leds = 7'b1111110; 1: leds = 7'b0110000;2: leds = 7'b1101101;3: leds = 7'b1111001;4: leds = 7'b0110011;5: leds = 7'b1011011;6: leds = 7'b1011111;7: leds = 7'b1110000;8: leds = 7'b1111111;9: leds = 7'b1111011;default: leds = 7'bx;endcaseendmodulehttp://ece353.ecs.umass.edu/lab0/lab0.html>>>>>>>>>>>>...BCD to seven segment decoder Verilog HDL project.Posted: October 24, 2012 in VLSI project ( verilog HDL)Tags: BCD, BCD to seven segment decoder, seven segment decoder verilog code, seven segment verilog, Verilog HDL 0BCD stands for binary coded decimal. It is speatial types of 4(quard bit) bit representation of a number. Such as if a number in decimal 12 it is represented by BCD as 00010010.7 segment display have so many application. Though now a day digital display LCD, LED used widely but for low price application 7 segment display widely used. For students project ( MCU related project) it is widely used. BCD to seven segment decoder are designed in verilog HDL. Core are given bellow.module Seven_Seg_Display_V2001 (output reg [6: 0] Display,input [3: 0] BCD);// abc_defgparameter BLANK = 7b000_0000;parameter ZERO = 7b111_1110; // h7eparameter ONE = 7b011_0000; // h30parameter TWO = 7b110_1101; // h6dparameter THREE = 7b111_1001; // h79parameter FOUR = 7b011_0011; // h33parameter FIVE = 7b101_1011; // h5bparameter SIX = 7b101_1111; // h5fparameter SEVEN = 7b111_0000; // h70parameter EIGHT = 7b111_1111; // h7fparameter NINE = 7b111_1011; // h7balways @ (BCD)case (BCD)0: Display = ZERO;1: Display = ONE;2: Display = TWO;3: Display = THREE;4: Display = FOUR;5: Display = FIVE;6: Display = SIX;7: Display = SEVEN;8: Display = EIGHT;9: Display = NINE;default: Display = BLANK;endcaseendmodulemodule t_Seven_Seg_Display_V2001 ();wire [6: 0] Display;reg [3: 0] BCD;parameter BLANK = 7b000_0000;parameter ZERO = 7b111_1110; // h7eparameter ONE = 7b011_0000; // h30parameter TWO = 7b110_1101; // h6dparameter THREE = 7b111_1001; // h79parameter FOUR = 7b011_0011; // h33parameter FIVE = 7b101_1011; // h5bparameter SIX = 7b001_1111; // h1fparameter SEVEN = 7b111_0000; // h70parameter EIGHT = 7b111_1111; // h7fparameter NINE = 7b111_1011; // h7binitial #120 $finish;initial fork#10 BCD = 0;#20 BCD = 1;#30 BCD = 2;#40 BCD = 3;#50 BCD = 4;#60 BCD = 5;#70 BCD = 6;#80 BCD = 7;#90 BCD = 8;#100 BCD = 9;joinSeven_Seg_Display_V2001 M0 (Display, BCD);endmodule>>>>>>>>>>.