FPGARelated.com
Forums

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

Started by weizbox October 5, 2004
Hello,

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
Mark,
How about this? If you're using a Xilinx part with 18 kbit BlockRAMs, use
one as a 512x36 bit ROM. Stick your ADC value into the address pins, use the
data pins to drive the LEDS. All(!) you need to do is initialise the ROM
with the right data and away you go. Don't forget to clock the ROM, it's
synchronous.
Cheers, Syms.
"weizbox" <mwiesbock@gmail.com> wrote in message
news:335c6753.0410051324.57cf0ea8@posting.google.com...
> Hello, > > 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
Followup to:  <335c6753.0410051324.57cf0ea8@posting.google.com>
By author:    mwiesbock@gmail.com (weizbox)
In newsgroup: comp.arch.fpga
> > Hello, > > 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? >
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