I have designed an SR latch using Cd4001 NOR gate IC. When both S and R are low the circuit refuses to stay in previous state even though I am using appropriate dropping resistors. Is there any way to avoid this with same CD4001 circuit configuration.
-
2\$\begingroup\$ This isn't a race condition. Either the inputs are being corrupted, or the output lines are being overloaded, or the supply is noisy. None of that is a race condition. \$\endgroup\$– Trevor_GFeb 15, 2018 at 14:15
-
\$\begingroup\$ one NOR is connected to VCC while the other is connected to ground? \$\endgroup\$– ratchet freakFeb 15, 2018 at 14:41
-
\$\begingroup\$ The CD4000 series can barely output 1 mA. Try using 3 mm 2 mA LED's with a 2.2 K resistor, or just change the 470 ohm to 2.2 K ohm. If you load down the outputs too much the 'latch' effect will not work. \$\endgroup\$– user105652Feb 21, 2018 at 0:29
2 Answers
Attaching LEDs like that to a little CD4001 is drawing too much current from the output when powered from only 6V. You are pulling ~8mA and the device is only rated for closer to ~2mA.
What will happen with that type of SR latch is the high output will be pulled down to close to the threshold level of the other gate and it will switch and settle to whatever side is less strained, or it might oscillate.
You should reduce the load, or change the way the LEDs are driven. One possibility is to use the other two NORS in that package as a buffer.
simulate this circuit – Schematic created using CircuitLab
But you will still be straining the outputs.
Also make sure you have decoupling capacitors on that chip.
-
\$\begingroup\$ I tried the same circuit configuration but used 74ls02 instead of cd4001.....And I am no longer having race around condition problem. \$\endgroup\$ Feb 17, 2018 at 14:34
-
\$\begingroup\$ @RiddhiAkbari with an LS02 the thresholds are very different as are the drive currents. \$\endgroup\$– Trevor_GFeb 17, 2018 at 15:58
Here's the basic and generic NOR latch: -
As you can see if S = 1 and R = 0 then Q = 1. If you then take S to 0 (without messing with R), the previous state is latched i.e. Q still remains at 1.
If you are activating S and R via mechanical switches then you may have problems. If you are trying to operate S and R simultaneously then you will also have problems. If you don't have a power supply attached you will have problems. If you are using a different circuit then you need to explain what that circuit is.
-
\$\begingroup\$ I am using this circuit....but as you said 'Q still remains at 1', this is not happening after some time it becomes 0 even i am not messing with R and also I have power supply attached. \$\endgroup\$ Feb 15, 2018 at 14:10
-
\$\begingroup\$ No, you aren't using this circuit because you talk about resistors in your question. You also have not shared what power source or CMOS technology you are using. What does "after some time" actually mean in numbers? \$\endgroup\$– Andy akaFeb 15, 2018 at 14:12
-
1\$\begingroup\$ Or what is attached to the inputs/outputs.... \$\endgroup\$– Trevor_GFeb 15, 2018 at 14:13
-
1\$\begingroup\$ Or, what is connected to the other devices in the chip that are unused.... \$\endgroup\$– Andy akaFeb 15, 2018 at 14:14
-
1\$\begingroup\$ @RiddhiAkbari You are overloading the outputs. \$\endgroup\$– Trevor_GFeb 15, 2018 at 14:39