You are on page 1of 6

Testing and Verification of VLSI Circuits

Assignment 2
Perumalla Koteswara Rao (19307R020)
April 2, 2021

Question 1
Given a finite state machine with input variables x1,x2, state variables q1,q2,q3, and
output variables y1,y2.

The next state equations are


q10 = (x1 ∧ x2)
q20 = ((x1.x2).q1) + (x1 ∧ x2)
q30 = (q1 ∧ q2)
The output equations are
y1 = (x1 ∧ q1 ∧ q2)
y2 = (q2.q3)
Assume that the initial state of the machine is q1=q2=q3=0.

1.Find the set of reachable states in this FSM starting from the initial state. Show
the set of states reachable in 1 step, 2 steps, and so on until you have found the full
reachable set.

Solution
Given Initial state(k=0) is q1=0,q2=0,q3=0,
A(q) = q1.q2.q3
The characteristic function is given by

χ(x, q, q 0 ) = q10 ∧ (x1 ∧ x2).q20 ∧ (((x1.x2).q1) + x1 ∧ x2).q30 ∧ (q1 ∧ q2)


The next state function is obtained from the initial state using the image computation.

B(q 0 ) = ∃x, qA(q).χ(x, q, q 0 )

1
The resultant function has q1’,q2’ and q3’ variables which should be replaced with q1,q2 and q3 to
calculate next state from the obtained state using the procedure as stated above.

First step (k=1):

∃x1,x2,x3,q1,q2,q3 q1.q2.q3.q10 ∧ (x1 ∧ x2).q20 ∧ (((x1.x2).q1) + x1 ∧ x2).q30 ∧ (q1 ∧ q2)

The next state function in terms of q1’,q2’,q3’ is

B(q 0 ) = (q10 .q20 .q30 ) + (q10 .q20 .q30 )

The variables in next state function are replaced with present state variables and the set of states
in first step(k = 1) is given by

A(q) = (q1.q2.q3) + (q1.q2.q3)

The set of all reachable states in first step(k ≤ 1) is given by

R1(q) = (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3)

Figure 1: Set of states (k ≤ 1)

2
Second step(k=2):
Here,

A(q) = (q1.q2.q3) + (q1.q2.q3)

∃x1, x2, x3, q1, q2, q3(q1.q2.q3 + q1.q2.q3).q10 ∧ (x1 ∧ x2).q20 ∧ (((x1.x2).q1) + x1 ∧ x2).q30 ∧ (q1 ∧ q2)

The next state function in terms of q1’,q2’,q3’ is

B(q 0 ) = (q10 .q20 .q30 ) + (q10 .q20 .q30 )

The variables in next state function are replaced with present state variables and the set of states
in second step(k=2) is given by

A(q) = (q1.q2.q3) + (q1.q2.q3)

The set of reachable states in second step(k ≤ 2) is given by

R2(q) = (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3)

Figure 2: Set of states (k ≤ 2

3
Third step(k=3):
Here,

A(q) = (q1.q2.q3) + (q1.q2.q3)

∃x1,x2,x3,q1,q2,q3 (q1.q2.q3 + q1.q2.q3).q10 ∧ (x1 ∧ x2).q20 ∧ (((x1.x2).q1) + x1 ∧ x2).q30 ∧ (q1 ∧ q2)

The next state function in terms of q1’,q2’,q3’ is

B(q 0 ) = (q10 .q20 .q30 ) + (q10 .q20 .q30 )

The variables in next state function are replaced with present state variables and the set of states
in third step(k=3) is given by

A(q) = (q1.q2.q3) + (q1.q2.q3)

The set of reachable states in third step(k ≤ 3) is given by

R3(q) = (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3)

Figure 3: Set of states (k ≤ 3

4
Here, we can observe that set of reachable states in second and third steps i.e, R2(q) and R3(q) are
equal.So, the convergence has occurred.The set of reachable states for the FSM is shown below.

R∗ (q) = (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3)

Figure 4: Set of reachabale states

2. Determine if it is possible to reach the machine to y1=y2=1.

The set of reachable states is given by:

R∗ (q) = (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3)

From this reachable states, we need to check for any combination of the input does the output
becomes 1 (y1=y2=1). So the characteristic function of the output function can be written as

χ(x, q, y) = y1 ∧ (x1 ∧ q1 ∧ q2).y2 ∧ (q2.q3)

∃x, qR3(q).χ(x, q, y)

∃x1,2,q1,q2,q3 (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3) + (q1.q2.q3).y1 ∧ (x1 ∧ q1 ∧ q2).y2 ∧ (q2.q3)

After doing the existential quantification with x1,x2,x3,q1,q2 we get an output of 1.


This shows that the output function has all possible combinations of y1 and y2. Therefore, for
some input combinations outputs i.e, y1 and y2 becomes 1.

5
Figure 5: Output function

You might also like