9. • Control timing of the A/D converter
(MCP3551)
• Binary to BCD conversion
• BCD to 7-Segment conversion
• Driving 7-Segment LCD
10. More Details
http://www.dragonwins.com/domains/getteched/de248/bin2bcd.htm#Adjust and Shift
Conversion Algorithm
PROCEDURE:
1. Initialize the BCD digits to zero.
2. Perform the following steps N times
where N is the number of bits in the
binary value:
• FOR each BCD digit, adjust as
necessary in preparation for the
multiply:
• IF the BCD value exceeds 4
• ADD 3 to the present
value of the digit
• Multiply the BCD value and add
in the next binary bit by
concatenating and shifting both to
the left one bit.
A > B
B
10
‘0000’ ‘0011’
4 4 4
+
A
4
‘0100’
4
4
IN
OUT
4
ADJ