I am trying to make a simple logic gate simulation for which I require the former IC but I could only procure the latter. Will it still work?
What’s the difference between IC 74HC04 and IC 74AC04PC
breadboarddiodesintegrated-circuitled
Related Solutions
You connected the DIP switches between Vcc and the AND gate's input, and that's wrong. A floating TTL input (DIP switches off) is seen as logical 1
, and when you close the switch you just enforce that 1
. So inputs are always seen a 1
, and output will be 1
, and the LED will light.
Two things:
- connect the DIP switches between the inputs and ground
- connect the LED between output and Vcc. The logic will be inverted, but the output can sink more current than it can source, and your LED will light more visibly. Check the LED's polarity: the anode goes to Vcc. You also have to add a 150 \$\Omega\$ resistor in series with the LED to limit it's current.
Things to check:
- You have the IC the right way round (pin 1 will have a small dot next to it, or an indent/marking at that side of the case of some sort) If the indent is at the top in the picture in your question then it appears you have the wiring correct (pins 1 and 2 are the inputs to the first AND gate, and pin 3 is the output)
- Your wiring is all correct and supply voltage is present.
- The LED is the right way round - the flat side of the case is the cathode -this is the side that should go to ground. The also cathode usually has a shorter lead.
Also, it's possible you destroyed your LED - you need a current limiting resistor in series with it. I'm assuming it's a red LED, and the supply voltage is 9V from the pictures, so try 360Ω (or anywhere between 360Ω and 2.2kΩ if you don't have this value)
EDIT - the datasheet provided by Mike says the absolute maximum supply is 7V, nominal 5V. This means it's quite likely your IC is dead. Unless you have a higher voltage variant of the chip, you need a lower supply voltage (e.g. 5V) With 5V the calculations for the LED resistor range below will be out, but the LED will still be visible (just a bit dimmer)
If my above assumptions are incorrect, do a search for "LED resistor" on here and you should find plenty of advice on why the resistor is needed and how to calculate it's value.
To test whether your LED is dead, try measuring it with a multimeter on the diode/continuity range - it's should read around 2V for a red LED with red probe to anode and black probe to cathode (note - some cheap multimeters cannot measure LED forward voltages, especially if it's an LED with a higher Vf, e.g. a white or blue LED)
Or just simply try another one (hopefully you have a few ;-) )
LED resistor
A diode has a very steep I-V curve, which basically means it passes almost no current up to a certain voltage (forward voltage - Vf) and then the current rises very sharply. This means you can't control the current just by setting the voltage at the right level, since with the tiniest change (e.g supply, temperature) the current will vary hugely.
So we use a resistor to limit the maximum current that the LED can pass. Most 5mm LEDs are rated for 20mA maximum, but will be clearly visible at 10mA. In the datasheet they will have a Vf spec mentioned above. I'll assume your LED is red, has a Vf of 2V, and we want it to pass 10mA - here's how to calculate:
(V_supply - LED_Vf) / desired_current = resistor value
So, with a 5V supply, and your LED_Vf of 2V:
(5V - 2V) / 0.010A = 300Ω
Simply place the resistor in series with the LED (cathode or anode side, it doesn't matter) If your LED is a different colour, check it's datasheet, find the Vf and run the calculations again.
Here is an example of how the LED and resistor should be arranged (assume the voltage source is your AND gate output pin):
Here's an example on a breadboard (taken from one of my recent blogs, so it's a microcontroller, not an AND gate, but the principle is exactly the same. I annotated it a bit to help clarify things)
Best Answer
The 74AC04 is faster than the 74HC04. Wikipedia lists a typical delay of 3ns for the AC family and 9ns for the HC family. Comparing the two datasheets one lists 4ns, the other lists 9ns. The "PC" in the AC's part number is just a package code.