Microbit PLD SR Flip Flop

by Gammawave in Circuits > Microcontrollers

576 Views, 0 Favorites, 0 Comments

Microbit PLD SR Flip Flop

SRFF_ubit.png

Following from a previous Instructable Microbit PLD in which I described how a Microbit can be used to emulate the basic logic functions.

I show how you can connect multiple functions together to create a SR flip flop.

The SR flip flop is a building block that is the basis of memory functions.

Only two gates will be required to create this block keeping it relatively simple to construct.

Supplies

Microbit V1 or V2 - Qty 2

Double ended crocodile clip leads - Qty 4

Optional

Prototyping System

Breakout Edge Connector

Bread:bit

SR Flip Flop

SRFF.png
nand1.png
nand2.png

The SR flip flop is made of of two cross coupled gates (NAND or NOR) and has two stable output states.

Using NAND gates.

The circuit has two active low inputs marked /S and /R and two outputs marked Q and /Q

Applying logic 0 to the /S input the Q output is set to logic 1.

If the /S input is returned to logic 1 the output does not change.

Applying a logic 0 to the /R input the Q output is reset to 0

If the /R input is returned to logic 1 the output does not change.

Two undesirable inputs states are /S=/R=0 resulting in Q=/Q=1 and /S=/R=1 resulting in an indeterminate state meaning Q=1, /Q=0 or Q=0, /Q=1

The indeterminate state is avoided by not changing /S & /R from 0 to 1 together.

Tinkerit

dual_ubit_srff.png
TEK00002_2.png

A simulation carried out in TinkerCAD revealed how simulation does not always portray things as expected.

The default circuit condition is /S=/R=1 and the indeterminate state.

At start up the circuit is visibly unstable eventually settling in a stable state, inputs and outputs visibly flickering.

For the physical elements at no time was it possible to obtain a visibly unstable state with the same NAND gate functions.

On powerup no gates functions are operating.

Selecting a NAND on one Microbit and than scrolling through the gate functions on the other Microbit revealed no issues until XNOR or AND was selected,

Only (XNOR/AND and NAND), revealed an instability.

The instability being an oscillation (~21Hz), that can be gated on by /S=/R.=1 and off by /S=0 or /R=0.

Finally

Rather than requiring a variety of different logic chips, a Microbit can be configured as a logic function.

Using Microbit PLD's it is possible to construct static and dynamic logic functions both simple and complex.

Until the next time, there are plenty of functions for you to evaluate in the meantime.