Electrical – How many unused inputs are there in a BCD adder

addercircuit-design

My book provides this BCD adder with the truth table:
enter image description here
enter image description here

Since this is meant to add number in BCD there are combinations that aren't going to be used. My book asks to calculate how many of such combinations are there. I did:

$$[(6*9)*2+(6*6)*2]*2 = 360$$

6*9 is the valid ones times the invalid ones. 6*6 is the invalid ones. I multiply each of these by two because you can have them one way around or the other. Lastly I multiplied by 2 because the input carry can be either 1 or 0. But my book says the solution is 312. What went wrong?

Best Answer

Like you commented, you have to multiply with 10 instead of 9. There is however another point incorrect.

You need to add the invalid ones times the invalid ones once, so

$$[(6*\color{red}{10})*2+(6*6)*\color{red}{1}]*2 = 312$$

To link your approach with Jonk's approach:
Defining variable a the number of valid BCD codes (a=10), b the number of invalid BCD codes (b=6) and a+b (therefore) the total number of codes,

Jonk's approach is $$ 2*((a+b)^2-a^2) $$ Rewriting $$ 2*((a+b)^2-a^2) = $$ $$ 2*(a^2+2ab+b^2-a^2) = $$ $$2*( 2ab + b^2 ) $$ which is your approach.