Skip to content

rishabhc32/flip-flops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Flip Flops and Latches

This is a guide for making Flip Flops and Latches using NAND gates.

When I was studying about Flip Flops and Latches in my class, all I wondered was how in the world we can store a bit by interconnecting 4 NAND gates. So I decided to make Flip Flops on my own and verify.

Material Required
  • IC - 7400 (Quad 2-input NAND Gates)
  • 4-5 LEDs
  • Breadboard
  • 5V power supply

These are all the things needed to make FFs.

IC-7400 is used in each circuit for NAND gates.

IC-7400

SR Latch

SR Latch

This is a Active LOW SR Latch, output is HIGH (SET) when S is LOW while output is LOW (reset) when R is LOW. Another type is Active HIGH SR Latch build using NOR Gate.

Here Active Low SR Latch is demonstated.

circuit diagram

  • Using IC-7400 connect the above shown circuit on a breadboard and supply 5V VCC to IC.
  • Initially set S and R to 1, i.e. HIGH.

real life circuit

This is how my circuit was looking. I was using Arduino for 5V power supply. Don't forget to add resistor before an LED to prevent from over voltage.

  • Now verify the truth table for the Latch.
  • Active Low Latch changes output, i.e. SET or RESET only when S or R is LOW respectively.
S R Q Image Comment
HIGH HIGH Don't Care first Initially output is default set to LOW
LOW HIGH HIGH second Now ouput (Q) becomes HIGH (SET) as S is LOW
HIGH HIGH No Change third S is set to HIGH but the previous ouput i.e. 1 is stored
HIGH LOW LOW fourth Now output (Q) becomes LOW (RESET) as R is LOW
HIGH HIGH No Change fifth R is HIGH but previous output i.e. 0 is stored
LOW LOW Invalid State sixth The output is indeterminate

So it is clear that a Latch stores a bit after it is SET or RESET even after the the input is changed. 🤘

Raw Video of Latch demo :

demo raw video

SR FlipFlop

SR Flip Flop

CLK or CK is CLOCK

This is a SR Flip Flop, output is HIGH (SET) when S and CLK is HIGH while output is LOW (reset) when R and CLK is HIGH. SR FF is clock synchronized SR Latch and has several advantage over SR Latch.

Due to unavailability of function generator and my laziness of making a square wave generator, I made a SR Gated Latch, which is nothing but a SR FF with ENABLE instead of CLK. You can make a square wave generator and use it as a clock.

SR gated latch

EN or E is ENABLE

Here Gated SR Latch is demonstated.

circuit diagram Gated sr latch

  • Using IC-7400 connect the above shown circuit on a breadboard and supply 5V VCC to IC.
  • Initially set S, R and EN to 0, i.e. LOW.

real life circuit

This is how my circuit was looking. I was using Arduino for 5V power supply. Don't forget to add resistor before an LED to prevent from over voltage.

  • Now verify the truth table for the Flip Flop.
  • Flip Flop changed ouput when EN is HIGH and S or R is HIGH.
E S R Q Image Comment
LOW LOW LOW Don't Care first Initially output is default set to LOW
HIGH HIGH LOW HIGH second Now ouput (Q) becomes HIGH (SET) as S is HIGH
HIGH LOW LOW No Change third S is set to LOW but the previous ouput i.e. 1 is stored
LOW LOW HIGH No Change 3 & 1/2 R is HIGH but Q is HIGH as EN is LOW i.e.1 is stored
HIGH LOW HIGH LOW fourth Now output (Q) becomes LOW (RESET) as R is HIGH
HIGH LOW LOW No Change fifth R is LOW but previous output i.e. 0 is stored
HIGH HIGH HIGH Invalid State sixth The output is indeterminate

So it is clear that a Flip Flop stores a bit after it is SET or RESET even after the the input is changed. And a Flip FLop changes its value only when EN or CLK is HIGH. 👍

Raw Video of Flip Flop demo :

demo raw video

Further Development

You can similarly make JK, D and T Flip Flops. Further the same concept can be applied to make counters and registers.

About

Making Flip Flops and Latch using NAND gates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published