04-06-2012, 12:28 PM
Flip-Flops
Flip-Flops.ppt (Size: 380.5 KB / Downloads: 96)
Last time, we saw how latches can be used as memory in a circuit.
Latches introduce new problems:
We need to know when to enable a latch.
We also need to quickly disable a latch.
In other words, it’s difficult to control the timing of latches in a large circuit.
We solve these problems with two new elements: clocks and flip-flops
Clocks tell us when to write to our memory.
Flip-flops allow us to quickly write the memory at clearly defined times.
Used together, we can create circuits without worrying about the memory timing.
Two main issues
So to use latches correctly within a circuit, we have to:
Keep the latches disabled until new values are ready to be stored.
Enable the latches just long enough for the update to occur.
There are two main issues we need to address:
How do we know exactly when the new values are ready?
We’ll add another signal to our circuit. When this new
signal becomes 1, the latches will know that the ALU
computation has completed and data is ready to be stored.
How can we enable and then quickly disable the latches?
This can be done by combining latches together in a
special way, to form what are called flip-flops.
More about clocks
Clocks are used extensively in computer architecture.
All processors run with an internal clock.
Modern chips run at frequencies up to 3.2 GHz.
This works out to a cycle time as little as 0.31 ns!
Memory modules are often rated by their clock speeds
too—examples include “PC133” and “DDR400” memory.
Be careful...higher frequencies do not always mean faster machines!
You also have to consider how much work is actually being done during each clock cycle.
How much stuff can really get done in just 0.31 ns?
Take CS232.
Direct inputs
One last thing to worry about… what is the starting value of Q?
We could set the initial value synchronously, at the next positive clock edge, but this actually makes circuit design more difficult.
Instead, most flip-flops provide direct, or asynchronous, inputs that let you immediately set or clear the state.
You would “reset” the circuit once, to initialize the flip-flops.
The circuit would then begin its regular, synchronous operation.
Here is a LogicWorks D flip-flop with active-low direct inputs.
Summary
To use memory in a larger circuit, we need to:
Keep the latches disabled until new values are ready to be stored.
Enable the latches just long enough for the update to occur.
A clock signal is used to synchronize circuits. The cycle time reflects how long combinational operations take.
Flip-flops further restrict the memory writing interval, to just the positive edge of the clock signal.
This ensures that memory is updated only once per clock cycle.
There are several different kinds of flip-flops, but they all serve the same basic purpose of storing bits.
Next week we’ll talk about how to analyze and design sequential circuits that use flip-flops as memory.