Author Topic: HD74HC21P dual AND logic IC confusion  (Read 1552 times)

0 Members and 1 Guest are viewing this topic.

Offline dcbrown73Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: us
HD74HC21P dual AND logic IC confusion
« on: October 08, 2017, 01:08:40 am »
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 the HD74HC21 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.  :(

Why exactly do people feel I should have read their post before I responded?  As if that was necessary for me to get my point across.
 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3381
  • Country: us
Re: HD74HC21P dual AND logic IC confusion
« Reply #1 on: October 08, 2017, 01:25:33 am »
First question I have is what is the NC pin?

"No Connection"

Quote
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!)

When 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.
 
The following users thanked this post: dcbrown73

Offline dcbrown73Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: us
Re: HD74HC21P dual AND logic IC confusion
« Reply #2 on: October 08, 2017, 02:04:25 am »
First question I have is what is the NC pin?

"No Connection"

Quote
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!)

When 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.

Wow, I feel like an imbecile.   I literally read this (pull down resister) and this (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.
Why exactly do people feel I should have read their post before I responded?  As if that was necessary for me to get my point across.
 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3381
  • Country: us
Re: HD74HC21P dual AND logic IC confusion
« Reply #3 on: October 08, 2017, 02:28:32 am »
It's cool... you did a great job showing your schematic and breadboard.  That made it easy to figure out the problem.
 
The following users thanked this post: dcbrown73

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: HD74HC21P dual AND logic IC confusion
« Reply #4 on: October 20, 2017, 11:46:21 pm »
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.
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: HD74HC21P dual AND logic IC confusion
« Reply #5 on: October 21, 2017, 12:08:26 am »
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.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12806
Re: HD74HC21P dual AND logic IC confusion
« Reply #6 on: October 21, 2017, 01:10:43 am »
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:


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 IF through 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.
« Last Edit: October 21, 2017, 03:22:37 am by Ian.M »
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: HD74HC21P dual AND logic IC confusion
« Reply #7 on: October 21, 2017, 02:08:19 am »
This will be useful to discover things

https://www.circuitlab.com
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf