0

First of, this is a genuine question and not poking fun at anyone. I am trying to learn C++ after many years of not touching it and I found a very old article (last updated July, 96) while trying to remember how implement BCD addition. Even though the article is old, looking at the person who wrote it is a professor, I am in a wtf state after reading the first few lines. I am learning and don't want to disregard something so easily, so please excuse my naivety.

The BCD system was chosen for the internal number system in these machines because it is easy to convert it to alphanumeric representations for printouts and displays. The compelling advantages of BCD have waned over time, and these digits are supported by more modern hardware simply to provide backward compatibility with earlier generations of machines.

Is the above statement true ??? !!! If yes, can someone explain how the modern CPUs perform addition if not using Binary ??? Or is the author trying to say something else and I misunderstood. I am concerned that maybe author might be hinting at something at the hardware level that might be different than the software abstraction. Or it might be some sort of translation issue.

I don't see any purpose solved by processors giving an outer appearance of being binary ("for backward compatibility") when internally they are decimal and don't need BCD system.

  • 1
    The statement is true and quite simple to understand: in the beginning of the computer era having a convenient encoding spared a lot of instructions. Today we can afford that. Each machine works with its own internal electronic representation of numbers: usually this is binary but nothing (but a great deal of effort for little to no benefits) prevent us from having decimal machines. – Margaret Bloom Nov 20 '17 at 09:40
  • I was naively surprised that leaving concepts like big/little endianess, or type of instruction set (risc, cisc, etc) or bus size, aside, there would still be machines from different manufacturers that implement numbers and operations differently internally (at level of logic gates). I had failed to consider reasons like parallelism, power saving, space, etc. Thanks for the answer ! It was good learning and well worth the ask =) –  Nov 20 '17 at 16:32

0 Answers0