- Sun Feb 22, 2015 4:11 pm
#10444
I like to use 74AHC series logic ICs rather than fets or transistors. They're cheap, fast and precise, and I always end up finding a use for the unused gates. Almost everyone who uses logic uses the 74HC4050 buffer. This and the 74HC4049 inverter are unusual devices in the HC series as these two are specially designed exceptions within the family that tolerate input voltages in excess of the supply voltage. But the entire 74AHC logic family can tolerate 5V inputs when using 3.3 V (or another low voltage) for the supply. That allows you to select a device with AND, OR, NAND, NOR, XOR, Buffer or Inverter gates that often come in handy as your project evolves.
I especially like to use NAND gates like the SN74AHC132. When implementing "sum of products" logic, i.e. functions like
(A AND B) OR (C AND D)
this can be done with only NAND gates. You don't need both AND gates and OR gates. This is because you can effectively move the output inversion "dot" on the first stage NAND gates to the inputs of the second stage NAND gates. When you invert both the inputs and the output on an AND gate, you turn it into an OR gate. Similarly, when you invert both the inputs and the output on an OR gate, you turn it into and AND gate. Think about it. It's also simple to use a NAND gate as an inverter. So basically, you can implement any logic function from NAND gates. Depending on whether the majority of your signals are positive (true when high) or negative (true when low) logic, you can apply the same principles with NOR gates.
You can't build more complex logic out of inverters or buffers like the 74HC4049 or 74HC4050. The upside of inverters or buffers though is that if you need lots of level shifting and no other logic, you get more level shifters per IC.
Finally, you need to be careful with transistor and FET based approaches when the data rate gets high, as is the case with SPI and also with UARTs when the baud rate is very high, since the rise times with these approaches can be slow and the waveforms can be kind of cruddy.
You can search for 74AHC logic at Digikey. Once you know what part number you're interested in, you can find the best price using findchips.com.