# Part 2: Logic IC Replacement

One of the advantages of a logic IC is that the logic function is implemented in hardware. This makes it much simpler. To use the inputs, you tie them up and apply the right input conditions to trigger the output. In the micro implementation, there is a bit more work.

By the logic function, we are referring to the logic equation. For example, as the table shows below for an AND gate. The only time the gate will go high is when both A and B are high. Therefore the code only needs to evaluate the equation for that outcome.

In the simplified code sample below, the equation A.B = Q is implemented. There is no need to check for the other conditions because they are implied.

In other words, there would be no need to implement code to test for each condition in the truth table as shown below. The only time that evaluation would be implemented is if that is a condition you are expecting.

Now that we have our code, we can implement the hardware.