News

When decimal numbers are within the range of 0 to 9, their binary and BCD representations are identical, requiring only four bits (0000 to 1001).
It is pretty easy to do math on BCD numbers and you don’t get rounding problems. Some CPUs even have specific instructions for BCD manipulation. However, three digits will require 12 bits.
Many applications require a µC to output BCD values, such as for driving a BCD seven-segment LED decoder. Converting an 8-bit number to BCD is relatively simple; the routine LOW8, which is part of the ...
HERE’S A C/C++ PROGRAM that converts decimal numbers ranging from 0 to 99,999 to binary and binary coded decimal (BCD) formats. Using a simple algorithm in conjunction with pointer arithmetic ...