Hip-Hop it’s Flip-Flop

“A secret to happiness is letting every situation be what it is instead of what you think it should be, and then making the best out of it!”

Pranav
8 min readMar 1, 2024

As they say, “Some cause happiness wherever they go and some cause whenever they go”. Happiness is a state of mind and it’s always a choice. The way you feel about yourself is based on the THOUGHTS you choose to beleive about yourself. If I could postulate this in my way of saying, the sequence begins with,

“Thought ignites behaviour - where
Behaviour builds Character - if
Character is rooted in Integrity- then
Versatility unfolds it into the artistry of happiness”

As we delve into the intricate workings of flip-flops, let’s reflect on the profound idea that ‘Thoughts ignite behavior.’ Just like the sequence of thoughts shaping our behaviour, the digital world too operates on a sequence — a sequence of binary states, ones and zeros.

In the realm of electronics, a simple switch can trigger a chain reaction, much like the choice that we choose to embrace happiness in our lives! Welcome all my tech aficionados✨! Our journey today takes us into the fascinating world of SR Flip-flops, where the power of setting and resetting plays a pivotal role. Imagine the ‘S’ for ‘Set’ as the joyous moments we embrace, and ‘R’ for ‘Reset’ as the times we choose to start anew.

Today we are embarking our new start as we step into our new month. And as I asked all my techies to provide me a suggestion on what concept shall we start our new journey with and as I expected I got suggestions from many to learn about the fundamentals of Latches and Flip-flops before we start building our next module.
It’s always the base that provides strength to the building and so in our journey too. Without any further delay it’s time to rock it into the floor for a Hip-Hop as it is Flip-flop😅😉!

So we will be discussing and building our own SR Flip-Flop. Let’s start with To begin it, we will be requiring,

1x 74LS32 (Quad two-input OR gate)
1x 74LS02 (Quad two-input NOR gate)
3x 330Ω resistor
3x Momentary “Microtivity 6mm tact switch”
3x LEDs Solderless breadboard(s)
22 gauge wire USB charger and cable or some other 5v power source

Now in our last module we have used 4 ICs’, namely our 74LS08(AND Gate), 74LS04(NOT Gate), 74LS32(OR Gate) and most importantly our 555 Timer. We know how our OR gate logic works. This is the truth table of it.

Truth table of OR Gate

We will be receiving the output as we give the input. Now, What if we give a feedback to our input!? How is it gonna result? Let’s check it out. To check it, building a circuit will be more efficient way of explaining. The truth table remains the same but the diagrammatic view of our feedback is,

Feedback Image of 74LS32
Feedback Circuit of 74LS32

It’s a very simple circuit where I have used only our 74LS32 IC which have 4 OR gates, where we will be using only 1 to understand the concept. For detailed description on how does the IC works, I have provided the datasheet down below of our blog. Please do refer for it 😊.

Apart from it, we have used our first 2 pins as our input and the 3rd pin as our output. If you can clearly see, we have given our LED(i.e the output) directly to ground. You might be wondering is it safe to ground it directly. Yes, it is! Because our 74LS32 IC have an inbuilt resistor in the 3rd pin so there is no need to provide a resistor to ground it. That was really cool. Isn’t it? Now we can see the input been connected to our switch which is grounded via a resistor and gets it’s power(5V) directly from the source.

Now as we power the circuit we can see there is no LED glowing. Here comes the logic of our circuit. The logic of our circuit is to send the output to the input as a feedback. So as per our condition, if there is no power supply, i.e if both the input state is 0, then it should result a 0(which is similar to that of our OR gate). Now once the switch is pressed there will be a impulse( which is 1) leading the LED to glow. Now if I unpress the LED according to the design of an OR gate it should turn off.

Working of Feedback Circuit

But it hasn’t. WHY??? Because we have given a feedback. The output is being given as the input. So once we press the impulse is given and it keeps on continuing until we remove or turn off the power source. We can see clearly in our video that how the circuit is in OFF state and once we turn on the switch how it is getting ON.

Hurray🎉! Our condition is satisfied. But are we done with our SR Flip-flop? Not yet folks. We need to find some other way apart from removing the power source to turn it off. So we will be requiring another circuit which will work in that way.
As the name says, ‘S’ stands for ‘Set’ and ‘R’ stands for ‘Reset’. Till now we have ‘Set’ but what about our ‘Reset’. Come let’s reset😉

Let’s try to solve the issue with some simple logic. Why don’t we try using a NOR gate. Why to leave a chance. Come let’s try with it. Again as I did previously, the good way to build some intuition is to build a circuit. Below we can see our diagramatic representation and the circuital image.

Diagrammatic view of NOR Logic
Circuital image of NOR Logic

To build this circuit we have used our 74LS02 IC, which has 4 quad NOR gate where we will be using only 2. And if we see the connections from down we can see the bottom pin or the 8th pin of the IC is given as the input from the switch and the 9th pin is the output from the 1st NOR gate(13th pin) , which actually comes as the input to the 2nd NOR gate.
The 10th pin is the output of the bottom NOR gate(which is connected to LEDs) and it also acts as one of the input to the 1st NOR gate. Similarly the other input to the 1st NOR gate is connected to the switch (12th pin to the switch). And as usual 7th pin is grounded and 14th pin is powered.

To make it even more simple, the black small wire is acting as the output from the first NOR gate and yellow wire is acting as the input to the 1st NOR gate. Now let’s turn ON and check how is it working according to our logic.

Working of our NOR Logic

We can see as soon as we powered up, one LED was glowing even before we switched. So hopefully it is obeying our logic. As we can take a look on the truth table of NOR gate(Refer above diagramatic image), if we don’t press or if there is no impulse then it should turn ON(i.e both the inputs should be 0). Which is absolutely visible here.

Now, why don’t we name the 1st NOR gate input as ‘S’ and 2nd NOR gate input as ‘R’ like shown below. And similarly the output we can mark it as ‘q’ and ‘ q̅ ’.

SR Flip-Flop

Now if we push the 1st switch on the top, we can see the 2nd NOR gate shows the output(this result we get from the LED). Similarly, if we push the 2nd switch at the bottom, the 1st NOR gate turns ON. Within fraction of few nanoseconds we can see the flip of the output. Thus we can flip the output according to our requirement.

We have seen this fellow in our previous blog too. Our silent hero who became a superstar at the completion of our Clock module. In that we might have seen him like this,

SR Flip flop in 555 Timer

Hey techies! Did you guys just notice something! As soon as we powered our NOR circuit, we saw our first LED glowing(i.e the 1st NOR gate). Whereas the 2nd one was OFF, which is our condition.

But WHY? Why did the first gate was ON and the second was OFF. The circuit is symmetrical and it could have been the other way too.

It’s completely arbitrary that which one should turn ON. The answer is that, when all the inputs turns to 0 then definitely both the gate starts to work ON, which fails our condition. But what actually happens internally is that one gate will turn ON quite faster than the other within fraction of nanoseconds. So one will be glowing and our other gate will be in OFF state. Thus resulting in a SR Flip-flop.

Finally! 🥳🥳We have built our own SR Flip-flop. But you might be wondering why did we even built one such thing🤓. As we can flip our outputs according to our requirement, we will be requiring this property in the areas of Memory in our Computer. In our near future we will be requiring such flip-flops and we will be discovering it’s application in our Computer.

Your support fuels our adventure into the heart of technology, where every flip and flop brings us closer to the harmony of understanding. That’s it for now. Time to sign off! See you all soon with an another new chapter. Until then it’s a bye👋🏻. And as I always say,

Your Support! Our Adventure❤️!!

Datasheet link: 74LS32 , 74LS02

Connect me through:

GitHub:-> https://github.com/PranavRajeswari

LinkedIn:-> https://www.linkedin.com/in/pranav-rajesh-9b694a241/

Gmail: pranav.mukundh@gmail.com

Circuit Diagram and Connection Credit: Abinaya Meenatchisundharam

--

--