8-bit word to 4-digit, 7-segment display


Im pretty new to FPGAs in general and so far have gotten some basic things down such as get data from my ADC and be able to hardwire certin values into my 4 digit 7-segment display, but now I need to combine the two and Im not sure how. Basicly I get an 8-bit binary number from my ADC, from there how would I turn that number into usable values to display on my 4-digit 7-segment display? Im using a refence voltage value of 2.55 V just to make it easier for the time being, but how do I turn "11111111" into "2.550" on ym display?

Thank you much for your time, Mark

Reply to
Loading thread data ...

Reply to

Followup to: By author: snipped-for-privacy@gmail.com (weizbox) In newsgroup: comp.arch.fpga

Since you only have 256 possible input values, you're probably best off munching up a 4Kbit blockram (in 256x16 configuration) outputting

4-digit BCD. Then convert to 7's segment; a LUT per segment handles that using the obvious Verilog or VHDL model (remove ~ if your display isn't inverted.)

module hexled ( value, s7 );

input [3:0] value; output [6:0] s7; reg [6:0] s7;

always @( value ) begin case ( value ) 4'h0: s7 = ~7'b0111111; 4'h1: s7 = ~7'b0000110; 4'h2: s7 = ~7'b1011011; 4'h3: s7 = ~7'b1001111; 4'h4: s7 = ~7'b1100110; 4'h5: s7 = ~7'b1101101; 4'h6: s7 = ~7'b1111101; 4'h7: s7 = ~7'b0000111; 4'h8: s7 = ~7'b1111111; 4'h9: s7 = ~7'b1101111; 4'hA: s7 = ~7'b1110111; 4'hB: s7 = ~7'b1111100; 4'hC: s7 = ~7'b0111001; 4'hD: s7 = ~7'b1011110; 4'hE: s7 = ~7'b1111001; 4'hF: s7 = ~7'b1110001; endcase end endmodule // hexled

Reply to
H. Peter Anvin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.