Docsity

Flip Flops-Digital Logic-Lecture 26 Slides-Electrical and Computer Engineering, Slides of Digital Logic Design and Programming

Toggle sidebar
bg1
1
Dr. D. J. Jackson Lecture 26-1Electrical & Computer Engineering
ECE380 Digital Logic
Flip-Flops, Registers and
Counters:
Registers and Counters
Dr. D. J. Jackson Lecture 26-2Electrical & Computer Engineering
Registers
• A flip-flop stores one bit of information
• When a set of nflip-flops is used to store n
bits of data, we refer to these flip-flops as a
register
– Common register usages include
• Holding a data value output from an arithmetic circuit
• Holding a count value in a counter circuit
• A common clock signal is typically used for
each flip-flop in a register
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Flip Flops-Digital Logic-Lecture 26 Slides-Electrical and Computer Engineering and more Slides Digital Logic Design and Programming in PDF only on Docsity!

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 26-

ECE380 Digital Logic

Flip-Flops, Registers and

Counters:

Registers and Counters

Registers

• A flip-flop stores one bit of information

• When a set of n flip-flops is used to store n

bits of data, we refer to these flip-flops as a

register

  • Common register usages include
    • Holding a data value output from an arithmetic circuit
    • Holding a count value in a counter circuit

• A common clock signal is typically used for

each flip-flop in a register

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 26-

Shift register

• A register that provides the ability to shift its

contents by a single bit

  • May be to the right or left (or possibly both)

D Q

Clock Q

D Q

Q

D Q

Q

D Q

Q

In Out

Q

Q

Q

Q

Shift right register

Shift right register

  • Data is shifted to the

right in a serial fashion

using the In input

  • Positive edge triggered
    • Contents of each flip-flop

are transferred to the

next flip-flop at each

positive edge of the clock

  • Level sensitive devices

would not be

appropriate for this

circuit

t 0 0 1 1 1

6

t 1 0 1 0 0

2

t 1 1 0 1 0

3

t 1 1 1 0 1

4

t 0 1 1 1 0

5

t 0 0 0 1 1

7

t 0 1 0 0 0

1

t 1 0 0 0 0

0

Q

2

Q

3

Q

4

Q

1

In

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 26-

Counters

• Special purpose arithmetic circuits used for

the purpose of counting

  • Design circuits that can increment or decrement a

count by 1

• Counter circuits server many purposes

  • Count occurrences of certain events
  • Generate timing intervals for controlling various

tasks in a digital system

  • Track elapsed time between events

• Often (but not always) built with T flip-flops

because the toggle feature is naturally suited

for implementing the counting operation

Up-counter with T flip-flops

T Q

Clock Q

T Q

Q

T Q

Q

Q

Q

Q

Clock

Q

Q

Q

Count 0 1 2 3 4 5 6 7 0

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 26-

Down counter with T flip-flops

T Q

Clock Q

T Q

Q

T Q

Q

Q

Q

Q

Clock

Q 0 Q 1 Q 2

Count 0 7 6 5 4 3 2 1 0

Asynchronous counters

• The previous counters are examples of

asynchronous counters. Also called ripple

counters.

  • Input clock is only connected to one flip-flop
  • Clocks for other flip-flops are (or are derived

from) the outputs of the previous flip-flops

• This form of counter is slow because the

cascaded clocking scheme

  • The clock source ripples from stage-to-stage
  • The ripple effect is similar to that of a ripple carry

adder circuit

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 26-

Enable and clear capability

• It may be desirable to disable counting or

clear the counter

  • Include an enable control signal
  • Use a flip-flop with asynchronous clear capability

T Q

Q

Clock

T Q

Q

Enable

Clear

T Q

Q

T Q

Q

D flip-flop synchronous counter

• A 4-bit up counter counts in the sequence

• The count is given by the flip-flop outputs

Q

3

Q

2

Q

1

Q

0

• The D inputs are given by:

D

0

=Q

0

āŠ•Enable

D

1

=Q

1

āŠ•Q

0

ā‹…Enable

D

2

= Q

2

āŠ•Q

1

ā‹…Q

0

ā‹…Enable

D

3

= Q

3

āŠ•Q

2

ā‹…Q

1

ā‹…Q

0

ā‹…Enable

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 26-

Four-bit counter (D flip-flops)

Enable Clock

D

Q Q

D

Q Q

D

Q Q

D

Q Q

Q

0

Q

1

Q

2

Q

3 Carry

output

Counters with parallel load

  • It is common for counters to begin a count with a

zero value

  • An asynchronous clear input can be used for his purpose
  • It may be desirable for a counter to begin with a

non-zero value

  • Adding circuitry to provide parallel load capability is

necessary

  • A control input, load , is used to select a mode of

operation

  • Load=0, circuit counts
  • Load=1, parallel load a new value into the counter