What is the logic behind the function of flip flops and what are their main applications.

In other words what makes them so usefull.

I've been reading up on one particular Flip flop by National Semiconductor. There are 4 inputs and two outputs. (actually two sets)

What are some applications for this type.

Go easy...I'm new to digital.

Any help appreciated.
Posted on 2003-04-21 19:57:06 by IwasTitan
Another name for a flip-flop is a "latch". It can be used to 'latch' onto the status of a digital signal line and save or store the status of that line. In other words, you may have noticed the flop has one input called a clock and another called d for data. If d is high and the clock is 'clocked' the output on the Q side will be the same as d while Q/ (Q NOT) will be the opposite of Q.

Since the Q outputs only change on the transition of the clock input, the flop can also be used as a divide by two frequency divider. What happens is you can have, say, a 2mhz clock on the clock input. The Q/ output is fed back to the d input. If d is HI, and the clock clocks, then Q will go high and Q/ will go low. Since Q/ is connected to d, d will also go low. Then, on the next transisition of the clock, Q will go low while Q/ and d go high. The consequence is a divide by two of the clock input.

Now I described the easier of the flip flops, the dflop like a 7474. There are also JK flip flops which work, essentially, the same but they have two inputs and I'm out of time. More later.
Posted on 2003-04-21 20:19:52 by drhowarddrfine
Flip-flops are also the simplest form of memory. AFAIK most registers in the computer are implemented via some sort of flip-flop. This is because the flip-flop can maintain a state.
Posted on 2003-04-21 22:16:39 by AmkG
The easiest FF to understand with basic AND/OR logic is the RS (reset-set) type. It can be built with two NAND gates (or two NOR gates). It has two inputs, R and S, and can have two outputs. It is an asynchronous FF, meaning it's not clocked.

In the NAND gate version, one input is set LOW to force the corresponding gate's output HIGH, and the other output LOW. When the input is set back to HIGH (both inputs HIGH), the outputs don't change.

The RS flipflop is the basis for building other types of flipflops. A progression of topics might be: gated FFs, two-stage FFs, edge-triggered FFs.
Posted on 2003-04-21 23:25:04 by tenkey
There are 4 inputs and two outputs. (actually two sets)

(It would help lots if you post the part number too)

For 4 inouts, I'd guess its a J-K type, the inputs being J, K, CLEAR and SET. Outputs are Q and not Q (always complement each other). Actually, there should be a 5th inout too, a clock.

CLEAR and SET should make sense, they do the same as the basic type tenkey describes. J and K get more interesting:

J K Qn+1
0 0 (same)
0 1 0
1 0 1
1 1 (toggles)

What the thing sodes depends on what value J and K have at the clock edge. For both low, nothing happens, it staye the same. For both high, it toggles (1 becomes 0, o becomes 1). For only one high, it either sets or resets.

How is it usefull? For something called a state machine. Imagine you have a box, N inputs, M outputs, and at a clock edge you look at the inputs to determine the new output. Such a machine's next value may very well depend not only on the inputs, but on the current output (and thats why it is a state machine).

One way to impliment such a thing is with a JK flip flop for each independent output, where 'independent' meaning can't be made from some simple AND OR INVERT function of the other outputs.

Basically, you write down every possible input combination along with the subsequent outputs and create a state table. From this table, you can write an exuation for all the J and K inputs so the outputs do what you need them to do.

Its not a frequent problem, I only used them once in a motor stepper. That needed 4 outputs, only one high at a time. The input was a direction control, high they went round one way, low the other.
Posted on 2003-04-21 23:56:01 by Ernie
Here is some basic information about digital logic, including flipflops. Even includes experiments...

http://www.play-hookey.com/digital/
Posted on 2003-04-22 20:25:25 by tenkey
Thats a good link... I suggest to anyone learning to read the brief tutorials as well.

:NaN:
Posted on 2003-04-22 21:23:34 by NaN
Thanks for the great replies guys.

Have a much better understands of FFs and what their uses are now.

:alright:
Posted on 2003-04-23 11:18:46 by IwasTitan