The first thing that we must do is to select a code for the decimal digit. That will (obviously) affect the truth table and might make a significant difference in the cost of the implementation. For the sake of this example, we will assume that the digits are stored in 8421 code.