Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

BCD to binary conversion

Altera_Forum
Honored Contributor II
2,627 Views

Hello, I have implemented 32-bit to BCD converter, simple algorithm was easy to find on the internet, doing conversion with single shifting pass through data register. Can you please suggest backward conversion - BCD to 32-bit (e.g. without multiplications)? Thanks!

0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,234 Views

Finally found it here http://forums.terraria.org/index.php?threads/project-bcd-to-binary-converter.30458/ 

 

"The double-dabble mechanism is a well known algorithm to convert binary-to-BCD, so reversing the algorithm allows for the reverse conversion. In the reverse algorithm, the information stored in the bits is right shifted, and then any number greater than 7 stored in any of the BCD units is reduced by 3". Simple and clear. 

 

Was worth of an hour of searching as there were some more sources which are badly explained or just seem to be wrong!
0 Kudos
Altera_Forum
Honored Contributor II
1,234 Views

Thanks for the sharing.

0 Kudos
Reply