Flip Flops

Computer Science: OCR A Level, topic 4.3.9

D Type Flip Flops

Flip flops are electronic circuits used within a computer’s memory to store single bits in one of two states, either a 1 or a 0. Flip flops can alter the state from one to the other.

D type flip flops

D type flip flops

  • There are several types of flip flop, but by far the most common are D type flip flops.
  • D type flip flops have two inputs:
  • Data, D.
  • A clock signal.
  • D type flip flops have one output, Q.
Clock signal

Clock signal

  • The clock signal is a regular and steady pulse used by a CPU to time operations.
  • The output Q of a D type flip flop can only be altered at the beginning of a clock signal.
  • A change to Q will only occur if D is in a different state to what it was at the start of the previous clock signal.
  • This happens regardless of whether or not there has been a change in between clock signals.
Signal diagram

Signal diagram

  • The top line shows the data, D, alternating between 0 and 1 at random.
  • The middle line is the steady and regular pulse of the clock signal.
  • The start of each pulse identified with an arrow.
  • The bottom line is the output, Q.
Process

Process

  • At the first pulse, the output changes to ‘1’ to match D.
  • At the second pulse, D is still ‘1’ so Q doesn’t change.
  • At the third pulse, D is now ‘0’ so Q changes to ‘0’ at this point.
  • At the fourth pulse, D is back to ‘1’ so Q changes to match it.
  • The change in D in between clock pulses is ignored.

Test yourself on Flip Flops

  • When is the output Q of a D type flip flop altered during a clock signal?

Practise this topic for free