4.3.5

Flip Flops & Adder Circuits

Test yourself

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.

Illustrative background for D type flip flopsIllustrative background for D type flip flops ?? "content

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.
Illustrative background for Clock signalIllustrative background for Clock signal ?? "content

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.
Illustrative background for Signal diagramIllustrative background for Signal diagram ?? "content

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.
Illustrative background for ProcessIllustrative background for Process ?? "content

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.

Adder Circuits

Adder circuits are used by the Arithmetic Logic Unit (ALU) in a processor to perform the addition of two binary digits.

Illustrative background for Types of adder circuitIllustrative background for Types of adder circuit ?? "content

Types of adder circuit

  • Adder circuits come in two forms:
    • Half adder circuits.
    • Full adder circuits.
Illustrative background for Half adder circuitsIllustrative background for Half adder circuits ?? "content

Half adder circuits

  • Half adder circuits accept two inputs and output both the result and a carry bit.
  • They make use of an XOR gate and an AND gate, laid out as shown.
Illustrative background for Half adder tableIllustrative background for Half adder table ?? "content

Half adder table

  • The actions of the two gates can be displayed in a table as shown.
  • The output at S gives the 20 binary digit.
  • The output at C gives the 21 binary digit (the carry bit).
Illustrative background for Full adder circuitsIllustrative background for Full adder circuits ?? "content

Full adder circuits

  • Full adders have the same output as a Half Adder (the sum and a carry bit), but they accept three inputs (two bits plus a carry bit).
  • They are constructed from two Half Adders.
Illustrative background for Full adder tableIllustrative background for Full adder table ?? "content

Full adder table

  • In a full adder:
    • S = A XOR B XOR C(in)
    • C(out) = (A AND B) OR (C(in) AND (A XOR B))

Jump to other topics

1Components of a Computer

2Software & Software Development

3Exchanging Data

4Data Types, Data Structures & Algorithms

5Legal, Moral, Cultural & Ethical Issues

6Elements of Computational Thinking

6.1Thinking Abstractly

6.2Thinking Procedurally

6.3Thinking Logically

7Problem Solving & Programming

8Algorithms

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson