16.01.2013 Views

Journal of Computers - Academy Publisher

Journal of Computers - Academy Publisher

Journal of Computers - Academy Publisher

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1972 JOURNAL OF COMPUTERS, VOL. 6, NO. 9, SEPTEMBER 2011<br />

&<br />

&<br />

CLK<br />

J<br />

K<br />

Q<br />

Q<br />

Q0<br />

&<br />

K<br />

J<br />

Q<br />

Q<br />

Q1<br />

Fig 1. The logic diagram<br />

&<br />

K<br />

J<br />

Q<br />

Q<br />

Q2<br />

In order to obtain the modulus value <strong>of</strong> the counter and<br />

to know whether the counter can self-starting, a general<br />

procedure is applied in three steps when analyzing this<br />

counter.<br />

Step 1: Obtaining the state transition equations<br />

From the logic diagram <strong>of</strong> Fig .1, we can obtain the<br />

following expressions for the J and K inputs <strong>of</strong> each FFs:<br />

J = Q + Q, K = Q + Q<br />

0 2 1 0 2 1<br />

J = QQ , K = Q<br />

1 2 0 1 2<br />

J = QQ , K = Q<br />

2 1 0 2 1<br />

According to the characteristic equation <strong>of</strong> J-K FFs<br />

[16,17], which is shown as equation (2).<br />

(1)<br />

Q′ = J Q + k Q 0 ≤ i ≤ n−<br />

1 (2)<br />

i i i i i<br />

where i Q′ denotes next state, Q denotes present state,<br />

i<br />

n is the number <strong>of</strong> FFs. The expressions <strong>of</strong> J and i<br />

K ( 0≤i≤ 2)<br />

are separately substituted into equation(2),<br />

i<br />

we can obtain the state transition equations as shown in<br />

equations(3):<br />

⎧Q′<br />

= QQQ + Q Q<br />

2 2 1 0 2 1<br />

⎪<br />

⎨Q′<br />

= QQQ + QQ<br />

1 2 1 0 2 1<br />

⎪<br />

⎩ Q′ = QQQ + QQ + QQ<br />

0 2 1 0 2 0 1 0<br />

Step 2: The state truth table<br />

We develop a truth table for the equations(3) as shown<br />

in Tab.1, the present state includes three variables<br />

Q2、 Q and 1 Q in the domain, so there are eight<br />

0<br />

possible combinations <strong>of</strong> binary values <strong>of</strong> the variables as<br />

listed in medium columns, which are 000, 001, 010, 011,<br />

100, 101, 110 and 111, the decimal digit corresponding to<br />

each binary value is listed in left column, which are from<br />

0 to 7, the next state is listed in right columns.<br />

After a CLK pulse input, the FFs enter a new<br />

state(from present state to next state), assuming initial<br />

present state is 000, that is,<br />

Q = 0, Q = 0, Q = 0 ( 2 1 0 000<br />

QQQ = ), substituting it<br />

2 1 0<br />

into equation 2 Q′ <strong>of</strong> equations(3), we can get<br />

corresponding value <strong>of</strong> next state, the process is as follow:<br />

© 2011 ACADEMY PUBLISHER<br />

(3)<br />

Tab. 1 The truth table<br />

Q2 Q1 Q0<br />

' ' '<br />

Q 2 Q 1 Q 0<br />

Q′ = 0⋅0⋅ 0+ 0⋅ 0= 0<br />

(4)<br />

2<br />

Here, we define such process <strong>of</strong> obtaining value <strong>of</strong> i Q′<br />

as one time next state equation calculation, obviously, it<br />

perhaps includes NOT, AND and OR operations. Next,<br />

we can calculate the values <strong>of</strong> 1 Q′ and 0 Q′.<br />

Q′<br />

= 0⋅0⋅ 0+ 0⋅ 0= 0<br />

1<br />

Q′<br />

= 0⋅0⋅ 0+ 0⋅ 0+ 0⋅ 0= 1<br />

(5)<br />

0<br />

So, after three times calculations, we obtain the next<br />

state QQQ ′ ′ ′ = 001,<br />

and fill the values in correspondence<br />

2 1 0<br />

positions in right-hand column <strong>of</strong> the truth table, which is<br />

shown in Tab.1.<br />

Regarding a new present state is 001 and substituting it<br />

into equations(3), the new next state can be obtained,<br />

which is 011. Regarding the third present state is 010 and<br />

substituting it into equations(3) again, the new next state<br />

can be obtained, which is 110. This process is continued,<br />

when the next state corresponding to the present state 111<br />

is calculated, the process is ended.<br />

It is clearly to know, in order to complete the truth<br />

table(Tab.1), we need accomplish 24(8*3) times next<br />

state equation calculations.<br />

Step 3: The state transition table and the state<br />

transition diagram<br />

After obtaining the truth table, the next step is to<br />

construct the state transition table and the state transition<br />

diagram.<br />

Firstly, we construct the state transition table. The table<br />

is constructed with three columns, which are comments,<br />

present state and nest state, which is shown in Tab.2.<br />

Regarding initial present state is 000, observing Tab.1,<br />

the next state is 001, filling 000 and 001 to corresponging<br />

column <strong>of</strong> Tab.2. Regarding the next state 001 is as a new<br />

present state, the new next state is 011. Regarding the<br />

third present state is 011 and the third next state is 010.<br />

This process is continued, in the end, we can observe 101<br />

is as a present state, which next state is 000, the counting<br />

cycle is finished, there are six counting states, which are<br />

000, 001, 011, 010, 110 and 101, we call these states as<br />

counting states. For next two states, which are 100 and

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

Saved successfully!

Ooh no, something went wrong!