HD74HC21P dual AND logic IC confusion - Page 1
Forum section: electronics / beginners

author: dcbrown73
author_rank: Regular Contributor
timestamp: October 08, 2017, 01:08:40 am
content: I'm learning electronics and testing different ICs among other things, but this is confounding me and I could use some help pointing out exactly what's happening here.I have an HD74HC21P IC which is a dual 4-pin AND gate with the following layout.First question I have is what is the NC pin? I get that being a 4-input AND gate. If 1A, 1B, 1C, and 1D are high, then 1Y (the output) will be high. I have no idea what the NC pin is and I don't see it referenced in theHD74HC21 datasheet.I just wanted to mess around with it so I setup a circuit using it, a 4 position dip switch, and an LED in basically this configuration. (ignore the IC label as Eagle doesn't have the HD74HC21P)So based on the above. All four dip switches should be on for the LED to light up.... Well, if I do that they do, but sometimes (see below) they light up anyhow. Testing the voltage and they are off when off, but yet the IC still supplies power to the LED (sometimes not, sometimes only when my hand is close to the dip switch!)So the question is, am I wrong that a four pin AND gate requires all the pins to be high for it to supply power to the 1Y gate? That is what the datasheet shows (below), but as you can see in my breadboard above, I have all dips off except dip 1 and yet the LED is lit.

author: edavid
author_rank: Super Contributor
timestamp: October 08, 2017, 01:25:33 am
content: Quote from: dcbrown73 on October 08, 2017, 01:08:40 am"No Connection"QuoteWhen the DIP switch is open, the IC pin is in an undefined state, not a low state. Add pulldown resistors to all the inputs so they will be in a low state when the switch is open.

author: dcbrown73
author_rank: Regular Contributor
timestamp: October 08, 2017, 02:04:25 am
content: Quote from: edavid on October 08, 2017, 01:25:33 amWow, I feel like an imbecile. I literally readthis(pull down resister) andthis(pull up resister) today and I still got foiled by this.As always, experience is the best teacher. Thank you for pointing out my error and wising me up.

author: edavid
author_rank: Super Contributor
timestamp: October 08, 2017, 02:28:32 am
content: It's cool... you did a great job showing your schematic and breadboard. That made it easy to figure out the problem.

author: james_s
author_rank: Super Contributor
timestamp: October 20, 2017, 11:46:21 pm
content: Something else worth mentioning, "NC" pins are occasionally connected internally to the substrate or some other part so can be better to look at them as "don't connect". Sometimes it's tempting to connect to one to make routing a PCB easier but in general it's best avoided.

author: Audioguru
author_rank: Super Contributor
timestamp: October 21, 2017, 12:08:26 am
content: 74HCxxx outputs have a maximum allowed output current of 25mA and your LED probably has a maximum allowed current of 30mA but a 74HCxxx output can provide about 64mA for your LED to burn out itself and your LED since you do not have a series resistor to limit the LED current.

author: Ian.M
author_rank: Super Contributor
timestamp: October 21, 2017, 01:10:43 am
content: Useful stuff to have when breadboarding with logic that lets you get ten switches or LEDs + associated resistors in only 11 rows of the breadboard:Lite-On LTA-1000HR 10 LED red bar array (DIL-20).Bourns 4611X-101-471LF 10x 470R bussed resistor array (SIP-11)- series resistors for above LED array for 3.3V logic..Bourns 4611X-101-102LF 10x 1K bussed resistor array (SIP-11)- series resistors for above LED array for 5V logic..Bourns 4611X-101-102LF 10x 10K bussed resistor array (SIP-11)- Pullup/Pulldown resistors for use with DIP switches..Bourns 4611X-101-102LF 10x 100R bussed resistor array (SIP-11)- Feed resistors for use with DIP switches.Equivalent parts from other manufacturers can be substituted.The resistor arrays have ten resistors, one side connected to individual pins and the other to a common pin at the end of the array, marked by a dot.For the LEDs, put only one resistor array alongside it, on the anode side for active low and cathode side for active high, with the common pin one row past the end odf the LED array. Wire the common pin to supply (active low) or Gnd (active high). The values above are chosen to give about 3mA IFthrough the LED, bright enough to see clearly but not so bright that the glare blurs the segments together. Also 3mA wont load the logic output excessively so you should still have a valid level for other gate inputs.N.B. Bipolar TTL cant output enough current when high so use active low LED wiring.Insert the resistor arrays along each side of the dipswitch, with the common pin one row past it. Connect the common pins to opposite rails as required for active high or active low switches. Use the 100R resistor array as a convenient busbar to feed all the switches, and the 10K array as pullups/pulldowns. 100R is negligable compared to the 10K pullups/pulldowns, but will reduce the risk of disaster if you accidentally connect a switch to an output.N.B. for bipolar TTL, you *MUST* connect the feed to Gnd for ON=Low, as a 10K pulldown isn't enough to pull a TTL input low.Beware: there are also separate individual resistors, with each having two adjacent pins, and double terminator resistors, where each pin apart from the common end ones has two resistors, one to one end and the other to the other end. Neither are anywhere near as useful for logic breadboarding.

author: ebclr
author_rank: Super Contributor
timestamp: October 21, 2017, 02:08:19 am
content: This will be useful to discover thingshttps://www.circuitlab.com