Welcome!
...
Previous Notifications
2023 4thQ
Part 2: Logic IC Replacement
4min
lead in 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 implementing the logic function 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 code sample 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 c // compare the value of the two inputs and if both are high, the equation is true if (portb b0 && portb b1){ portb b3 = 1; } // always remember to clear the output or set low else{ portb b3 = 0; } 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 if (portb b1 && !portb b2){ portb b3 = 0; } lead out now that we have our code, we can implement the hardware