# Reducing number of resistors

I have question about reducing number of resistors ... Well, it will be better if I show you the schematics. This is my first scheme:

That's what I have. The thing is, I know what only one LED will be lit at the time, so I thought why don't I use just one resistor like this:

So after I made this scheme , I tried to run simulation in Multisim, and all LEDs were going on and off rapidly and radnom. So my question is: did I do anything wrong here? If I did, what did I do ? If I didn't do anything wrong, do you have any tips that I should follow (like something I might overlook in this situation) ?

Thanks :)

Most likely effect is that the reset circuit is experiencing a "race condition".

Checking with a real device would be a really good idea.

Note that as shown in your circuit the Q7 to Mr connection is strictly "illegal" and creates an 'anything can happen' race condition.

Because:

• When Mr sees the reset condition it immediately starts the reset process which removes the condition causing it. The internal registers may be slower to reset than the IC is to deassert Q7 - in which case you have an undefined set of internal conditions.

• Reset pulse width is 500 ns worst case at 5 V and reset to decode output propogation delay is 500 ns typical and 1 us worst case at 5V BUT has no minimum specified and is subject to capacitive and resisticvve loading ...

• The counter is a 5 stage Johnson counter with 5 flip flops but 10 outputs so, unlike a stage where the are 10 flipflops which need to be rests to 0 and of which there is only one "high output" at a time, here we have a mix of on and off flipflops decoded to give a single output, and resetting some may cause (without wading through Johnson decode logic) a different and possibly unapparently related new state

Adding an RC delay in the Q7 to Mr reset circuit makes it much more likely that proper resetting will occur in practice.

• Detail: An equally illegal [tm] :-) but real-world-often-better result can be achieved by connecting a resistor from Q7 to Mr and a small capacitor from Mr to ground. eg say 1k Q7-Mr and 0.1 uF Mr to ground gives a time constant of 100 us in the reset line. Mayhaps 10k and 10 nF would work as well in reality or some mix - max tolerable reset delay depends on clock speed but in your case the 1 Hz clock makes it "quite tolerant".

This ensures that a high voltage remains on Mr after it is removed from Q7.
Vih and Vil specs overlap in such a way that you cannot guarantee that if Vih is JUST reached and then falls slowly that Vih will be maintained for a small while (thus allowing reset to proceed properly) but in practice this is much much more likely with an RC delay than without one.

Depending how good your simulator is it may be responding to the fact that you are applying (5-VLED)/330 - V??? to all the off outputs - which can notionally cause strange results as there is no formal stat for applied voltage into the outputs. I say V??? as you have not stated LED colour or Vf and this affects the potential result.

This is very uncertain in effect as you are notionally biasing all off LEDs backwards. If they were Si diodes they would not conduct. If the were "real LEDs" they will not have major conduction until their reverse breakdown is reached = somewhat higher than here. In a model anything may happen.

The CD4017 max specified drive current is modest and many many users exceed it - generally with impunity, but if Murphy decides to play games you can have no complaint. In the datasheet you will see that at 5V you can draw 4.2 mA typical and 2.5 mA min at 25C with a 5V supply AND the output loaded down to 2.5V.
If Vf = 2V (red) then I LED at 5V = (5-2)/330 = 9 mA and I LED at 2.5V loaded = (2.5-2)/330 = 1.5 mA. So Voutput typical will be in the 2.5V to 5V range.

I haven't looked up your 4017BD chip, but if the top circuit works the bottom circuit should work equally well as long as only one LED is lit at a time as you said. If more than one is accidentally lit, nothing will be damaged. But, the brightnesses of the two LEDs will be low and may not be all that equal.

If you do have just one LED lit at any time, those should be equivalent. Double-check your simulation. It's possible that, in the copy-pasting and net editing you did to translate between these two schematics that some nets ended up with the same name and are implicitly connected, resulting in confusing results.

This could also be an issue with the LED models. In the second version, the cathodes are at a non-zero voltage. Assuming a 10 mA drive current for easy math, this node would be at 3.3V and the anodes of the non-driven LEDs would be at 0V. (This shouldn't be a problem in most cases, but check the datasheet of your LED for reverse voltage ratings. LEDs aren't 1n400x rectifiers; they're far more sensitive to reverse biasing.) Whether the LEDs are rated for small reverse voltages or not, this will produce a miniscule leakage current. I'm not sure how Multisim is determining whether an LED is lit or not - If it's a naive

if (0 != current) {
led_is_lit = true;
}


sort of judgement, then you might see a lit LED in the wrong case. This is unlikely; NI is usually pretty good. It's more likely that the LED models are incorrectly specified.

In any case, if you doubt the results of your simulation, and your parts are this cheap, the best test is to build the circuit and try it out!