Question: In C++, write a program that inputs 2 decimal strings and implement binary coded decimal adder (8-bits) to output the result of binary (up to

In C++, write a program that inputs 2 decimal strings and implement binary coded decimal adder (8-bits) to output the result of binary (up to 12 bits) addition of input decimal strings. Please comment the code to make it easier for me to understand.

Examples:

08d + 01d = 09d => output the result as is

09d + 01d = 10d => Using 8 bits Binary adder, this will add 00000110b during binary addition

09d + 08d = 17d => Using 8 bits Binary adder, this will add 00000110b during binary addition due to carry of bit 3 to bit 4 which triggers half carry flag on.

90d + 80d = 170d=> Using 8 bits Binary adder, this will add 01100000b (60h) during binary addition

90d + 10d = 100d=> Using 8 bits Binary adder, this will add 01100000b (60h) during binary addition

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!