3 bit pspice

7
Systematic design of 3-bit counter with D flip-flops • Follow same procedure as before, building up the transition table • The difference is in the inputs needed for the flip-flops: the behaviour of a D flip-flop is much simpler: - Q n+1 = D - i.e. Q output after clock transition = D input at transition (which depends on the present states of the flip-flops) - value of Q n (before clock transition) has no direct effect - it is just a simple memory cell (latch) • There are no “don’t care” inputs for a simple counter, which leads to more complicated logic.

Upload: aseem-ghimire

Post on 28-Apr-2015

15 views

Category:

Documents


0 download

DESCRIPTION

3 bit pspice

TRANSCRIPT

Page 1: 3 bit pspice

Systematic design of 3-bit counterwith D flip-flops

• Follow same procedure as before, building up the transition table

• The difference is in the inputs needed for the flip-flops: the behaviour of a D flip-flop is much simpler:

- Qn+1 = D

- i.e. Q output after clock transition = D input at transition(which depends on the present states of the flip-flops)

- value of Qn (before clock transition) has no direct effect

- it is just a simple memory cell (latch)

• There are no “don’t care” inputs for a simple counter, which leads to more complicated logic.

Page 2: 3 bit pspice

0 0 0 0

1 0 0 1

2 0 1 0

3 0 1 1

4 1 0 0

5 1 0 1

6 1 1 0

7 1 1 1

label C B A label C B A DC DB DA

present state next state inputs needed

0 0 0 0

1 0 0 1

2 0 1 0

3 0 1 1

4 1 0 0

5 1 0 1

6 1 1 0

7 1 1 1

State transition table for 3-bit counter with D flip-flops

The ‘present state’ and ‘next state’ columns are the same as for the JKs

Because the D flip-flops are simple memories, the inputs needed are identical to the next state.

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

Simply copy the columns across — that’s all there is to it!

Page 3: 3 bit pspice

00 01 11 10

0 0 1 0

1 1 0 1

0

1

BA

C

DC

00 01 11 10

0 1 0 1

0 1 0 1

0

1

BA

C

DB

00 01 11 10

1 0 0 1

1 0 0 1

0

1

BA

C

DA

K-maps for 3-bit counter with D flip-flops

There are no “don’t care” entries here.

DC = A ⋅C + B ⋅C + A ⋅ B ⋅C

= (A + B ) ⋅ C + A ⋅ B ⋅ C

= ( A ⋅ B) ⋅C + ( A ⋅ B) ⋅C

= ( A ⋅ B) ⊕ C

DB = A ⋅ B + A ⋅ B

= A ⊕ B

DA = A

Page 4: 3 bit pspice

Compare expressions for JK and D flip-flops

A

B

C

D

J = K D

1

A

A·B

A·B·C

A

A ⊕ B

(A·B) ⊕ C

(A·B·C) ⊕ D

= 1 A

• Note similarities in pattern between JK and D flip-flops

• D inputs have extra ‘xor’ term with output of same flip-flop

Page 5: 3 bit pspice

Circuit for 3-bit counter using D flip-flops

D Q D Q D Q D Q

A B C D

A A ⊕ B (A·B) ⊕ CA A·B A·B·C

(A·B·C) ⊕ D

1

clock carry in carry outsingle stage

J Q

K

clock

J Q

K

J Q

K

J Q

K

1

1

Compare the circuit with JKs

You should know from the tutorial why the flip-flops are connected like this!

Page 6: 3 bit pspice

Conclusions

• Counters using D flip-flops can be designed in the same way as those using JK flip-flops

• It is easier to construct the transition table because the inputs required are simply the outputs wanted in the next state

• The logic is more complicated because there are no “don’t care” states to simplify the K-maps

• Formally, the system with D flip-flops separates the two main functions of the system:

- storage of the present state (the D flip-flops)

- determination of the next state (the combinational logic connected to the inputs of the flip-flops

• This is the architecture of a Moore state machine

Page 7: 3 bit pspice

Moore state machine without inputs

combin-ationallogic

clockedregister(D-type

flip-flops)

next state present statepresent state

clock

storage of thepresent state

determination ofthe next state

This can be generalized to include inputs to the combinational logic.

In practice the design is done using software and special ‘hardware description languages’ that specify the function of the circuit (Verilog, VHDL).

This will be taken further in Digital Electronics 2.