# Decimal in 7-segment display

Discussion in 'The Projects Forum' started by chihiro, Jun 7, 2010.

1. ### chihiro Thread Starter Member

May 18, 2008
22
0
hello everyone, im designing a 8-bit SAR ADC for my term project. When the conversion ends, i have a 8-bit binary output from my SAR circuit. The question is when i have 11111111 output it corresponds to 5000mV, 0000000 is 0000mV in four 7-segment display. but i dont know how to convert the 8-bit binary output to a decimal value and display it in four 7-segment display. lets say i converted binary output to decimal but i have no idea how to display that decimal value in four 7-segment display, ill be so happy for any help, thanks

2. ### Bill B Active Member

Nov 29, 2009
61
1
Wow. That sounds difficult since 11111111 binary doesn't directly convert into 5000 decimal and so a binary to decimal decoder will not provide the proper display. I'm stumped.

3. ### beenthere Retired Moderator

Apr 20, 2004
15,808
294
You need something in between. The ADC outputs binary (that 1111 1111 is FF in hexidecimal, BTW), and the displays need their numbers in BCD (binary coded decimal). You only need three displays to show the value, which is 255 in decimal.

Notice that the value does not correspond very well to the voltage measured. There are ways to convert between binary and decimal, but a microprocessor can do the conversion and change to engineering units, so the display is in volts and fractions of a volt.

One dodge is to use an ICL7107 - http://www.intersil.com/products/deviceinfo.asp?pn=ICL7107 It will give better resolution as well.

4. ### Bill B Active Member

Nov 29, 2009
61
1
So is the goal to display the binary output as a decimal number or to display a voltage value?

5. ### chihiro Thread Starter Member

May 18, 2008
22
0
the goal is to display the very first analog input value. As u can see in the block diagram below, when i give an input from Vin as 2500mV , the 8-bit output of the SAR is 10000000 and i have to use this output seen in 4 7-segment as 2500. The point is i have to convert the 8-bit binary output in Xilinx and scale the value with 19 (since 5000mV has 256 different binary values, and each binary value is equal to 19mV = 5000/256). When the clock gives 8 pulses and the 8-bit approximation is done, i will have the binary output between the SAR and DAC, but still have no idea how to use that 8-bit output displayed in 7-segment.

Another question arises here: i haven't found any SAR schematic online, i thought a J-K flipflop with a serial shift register on the output might solve my problem after 8 clock pulses, but i dont know how to obtain the End of Conversion bit and give it to the reset input of the FlipFlop, i thought a counter counts to 8 might solve the issue but things are getting just complicated :S

6. ### Bill B Active Member

Nov 29, 2009
61
1
Sorry, I'm afraid this is a bit above my knowledge level. The factor of 19 is what really complicates things. It sounds like you may need to program a microprocessor to convert the binary output into a BCD value that represents the analog input, then use a BCD to seven segment decoder to display the value.