Archive for February, 2012
Quiz: Clock and output gating
Posted by enfilade3 in Uncategorized on February 18, 2012
Consider the following scenario:
Inputs: clk, input, control
Outputs: output
Requirement: output is a flopped value of input when control is high. When control is low, output should be pulled to low irrespective of input. The flop should be clock-gated.
How to implement this logic?
1. Gate the input with control before it’s fed to the flop. The same control signal is used to gate the clock.
As shown in above diagram, when control signal goes low, the input to the flop is made 1’b0. Since control is also used to gate the clock, the new input never reaches the output. We need one more clk pulse to drive the output low.
2. Gate the output of the flop with control signal and clock is also gated by the control signal.
This scheme ensures the output becomes 1’b0 when control is made low and also clk to the flop is gated. But this is not a clean solution as we are adding a combinational logic to the output of the flop. This might have effect on timing.
3. Gate the input with control before it’s fed to the flop. Clock is gated by logic-or of control signal and output.
This scheme is similar to ‘1’ except that the control signal to clock-gater includes the output also. As long as control is high, clock is always fed to the flop. When control becomes low, clock will be present to the flop as long as output is high. This ensures that we get the extra pulse (3rd pulse) we were missing in scheme ‘1’. The additional pulse makes output low which in turn ensures the clock to flop gets gated.
Efficient Usage of Clock-Gating
Posted by enfilade3 in Uncategorized on February 9, 2012
Here is a good EE Times article on clock-gating usage.