1
\$\begingroup\$

I'm designing a very basic circuit for testing a switch sequence. I'm using a CMOS decoder CD4028B (link to datasheet) and XOR gate (CD74HC86E - link to datasheet). Reading the switch sequence is crucial and therefore I've been thinking whether I should add pull-down resistors to all inputs of the decoder and XOR gate to prevent pin-floating and false readings? I went through the datasheet and there was no recommendation whether pull-downs should be added to prevent pin-floating. Do these logic gates usually provide internal pull-down resistors or is it necessary to add them yourself? What values are recommended? I want to draw as little current as possible. I'm sorry if this is a really basic question. We made quite a few circuits with logic gates in college but never talked about the pin-floating and current draw aspect of these circuits.

Inputs of decoder are wired to the switch that is being tested, outputs of decoder are then wired to XOR gate inputs and XOR gate outputs are then wired to BJTs to drive LEDs.

Any help would be greatly appreciated. :)

Thank you.

\$\endgroup\$
1

1 Answer 1

4
\$\begingroup\$

CD40xx and HC74xx circuits do not include pullups or pulldowns on their inputs.

CD40xx and HC74xx inputs must not be allowed to float. They must always be driven with a defined logic level, from a logic output, from a pullup or pulldown, or a switch to ground or rail.

If CMOS inputs are allowed to float, they could end up in the middle linear region, which at best causes nonsense outputs, and at worst causes oscillation which draws excessive power and causes the chip to fail through overheating.

As CMOS needs very little (nominally zero) (leakage only) current, very large resistors can be used as pullups or pulldowns if speed is not an issue. 1Mohm 100k would draw only a few 10s of uA, and would be more than enough to keep all types of CD40xx inputs biassed properly (WRB says he's found one brand that specifies 5uA leakage max, though I've only seen 1uA in my (admittedly quick) survey of them).

\$\endgroup\$
3
  • \$\begingroup\$ Thank you for a quick answer. From what I can understand, in my configuration, I need pull-down resistors on the decoder inputs since the switch only provides a definitive high logic state, when the lines aren't high they float since there's no connection to ground. As for decoder outputs, they apparently can either sink and source current and therefore, I suppose, I don't need pull-down resistors since when the output is low, it does draw the input of XOR gate that is connected to decoder output low (to ground - sink current). Is my thinking correct? \$\endgroup\$
    – 0xd4v3
    Oct 21, 2018 at 11:25
  • \$\begingroup\$ @0xd4v3 - You only need resistors on unused inputs. Unused outputs can be allowed to "float", since by their nature they are always connected to Vcc or ground (depending on whether they are high or low). That is, after all, how their output levels are defined. \$\endgroup\$ Oct 21, 2018 at 11:43
  • 1
    \$\begingroup\$ Plus, I'm going to have to disagree with Neil and suggest 100k rather than 1M for pullup/pulldown. The CD4028 data sheet shows a max of 5 uA input leakage at 25 C. 5 uA times 1M is 5 volts, so 1M is not a whole lot better than no input resistor at all. \$\endgroup\$ Oct 21, 2018 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.