24.04.2013 Views

Counter design; Self-starting counters

Counter design; Self-starting counters

Counter design; Self-starting counters

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Overview<br />

Last lecture<br />

Introduction to finite state machines<br />

State diagrams<br />

<strong>Counter</strong>s as finite state machines<br />

<strong>Counter</strong> <strong>design</strong><br />

Today<br />

Finish counter <strong>design</strong><br />

Our last <strong>design</strong> example<br />

<strong>Self</strong>-<strong>starting</strong> <strong>counters</strong><br />

CSE370, Lecture 20<br />

Example: A 5-state counter<br />

<strong>Counter</strong> repeats 5 states in sequence<br />

Sequence is 000, 010, 011, 101, 110, 000 (not binary)<br />

Step 1: State diagram Step 2: State transition table<br />

Assume D flip-flops<br />

010<br />

000<br />

CSE370, Lecture 20<br />

011<br />

110<br />

101<br />

5-state counter (con’t)<br />

CLK<br />

A'<br />

C'<br />

B'<br />

A<br />

CSE370, Lecture 20<br />

Present State Next State<br />

C B A C+ B+ A+<br />

0 0 0 0 1 0<br />

0 0 1 – – –<br />

0 1 0 0 1 1<br />

0 1 1 1 0 1<br />

1 0 0 – – –<br />

1 0 1 1 1 0<br />

1 1 0 0 0 0<br />

1 1 1 – – –<br />

Step 4: Implement the <strong>design</strong><br />

D Q C D Q B D Q A<br />

B<br />

C'<br />

1<br />

3<br />

5<br />

Review: <strong>Counter</strong> <strong>design</strong> procedure<br />

1. Draw a state diagram<br />

2. Draw a state-transition table<br />

3. Encode the next-state functions<br />

Minimize the logic using k-maps<br />

4. Implement the <strong>design</strong><br />

CSE370, Lecture 20<br />

CSE370, Lecture 20<br />

Example: A 5-state counter<br />

5-state counter (con’t)<br />

Step 3: Encode the next state functions<br />

C+ C B+ A+<br />

C<br />

C<br />

A<br />

0 0 0 X<br />

X 1 X 1<br />

B<br />

A<br />

1 1 0 X<br />

X 0 X 1<br />

C+ = A B+ = B' + A'C'<br />

5-state counter (con’t)<br />

Is our <strong>design</strong> robust?<br />

What if the counter starts in a 111 state?<br />

CSE370, Lecture 20<br />

Does our counter get<br />

stuck in invalid states???<br />

001<br />

100<br />

111<br />

010<br />

000<br />

011<br />

B<br />

110<br />

101<br />

A<br />

0 1 0 X<br />

X 1 X 0<br />

B<br />

A+ = BC'<br />

2<br />

4<br />

6


5-state counter (con’t)<br />

Back-annotate our <strong>design</strong> to check it<br />

Fill in state transition table<br />

Present State Next State 001<br />

C B A C+ B+ A+<br />

000 110<br />

0 0 0 0 1 0<br />

0 0 1 1 1 0<br />

0<br />

0<br />

1<br />

1<br />

0<br />

1<br />

0<br />

1<br />

1<br />

0<br />

1<br />

1<br />

010<br />

101<br />

1<br />

1<br />

1<br />

0<br />

0<br />

1<br />

0<br />

1<br />

0<br />

0<br />

1<br />

0<br />

1<br />

1<br />

0<br />

0<br />

0<br />

0<br />

100<br />

011<br />

1 1 1 1 0 0<br />

111<br />

CSE370, Lecture 20<br />

Draw state diagram<br />

The proper methodology is to <strong>design</strong><br />

your counter to be self-<strong>starting</strong><br />

Next subject: Finite-state machines<br />

Generalize the counter-<strong>design</strong> methodology<br />

State machines have input signals<br />

State machines have complex transitions<br />

Finite-state machines control digital systems<br />

The core of digital <strong>design</strong><br />

CSE370, Lecture 20<br />

7<br />

9<br />

<strong>Self</strong>-<strong>starting</strong> <strong>counters</strong><br />

Invalid states should always transition to valid states<br />

Assures startup<br />

Assures bit-error tolerance<br />

Design your <strong>counters</strong> to be self-<strong>starting</strong><br />

Draw all states in the state diagram<br />

Fill in the entire state-transition table<br />

May limit your ability to exploit don't cares<br />

Choose startup transitions that minimize the logic<br />

CSE370, Lecture 20<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!