BCD/BigNum problems are not something that come out only in special occasions like cryptography. If you look at printing floating point algorithms for example, the two most used approaches - Dragon4 and Grisu3 - use bcd/bignum. It is intrinsic to binary-decimal conversion and it is surprisingly complex.

In this series of videos I try to explore just the math representation, the basic data structures and then the speedup strategies behind it. As tackling the floating point printing at the same time would be unimportant for what I want to convey, I came up with this simpler problem: printing 2^N in decimal where N is a big number.

I place special emphasis on learning how to use the standard library as-is without resorting to third party libraries to get the job done. The reason for this is that many times the problem can be solved in a much simpler, faster and more reliable way.

In this first video I want to show where this all started and the motivation behind it. I then show the solutions (on GitHub) I gave to make this calculation faster.

https://github.com/HFTrader/MyPasteBin

I am very sorry for my boring/nerdy/alien accent voice on this first video. If you wish, you might skip this one and go to the meat on the second video where things get more mathematical.

In this second video I try to explain the huge-BCD (for the lack of a better name) approach of representing big numbers in a mix fo binary and base 10.

In this next video I run the implementations described and get a sense for performance.

This next video discusses the serial and pipelined versions of the code on GitHub.

Then the domain-partitioned multithreaded mechanisms are discussed. I left the x86_64 version out of this video - will probably do later at a next opportunity.



