21 Races and State Assignment
21 Races and State Assignment
21 Races and State Assignment
A race condition occurs in an asynchronous circuit when 2 or more state variables change in response to a change in the value of a circuit input. Unequal circuit delays may imply that the 2 or more state variables may not change simultaneously this can cause a problem. Assume two state variables change If the circuit reaches the same final, stable state regardless of the order in which the state variables change, then the race in non-critical. If the circuit reaches a different final, stable state depending on the order in which the state variables change, then the race is critical.
We need to avoid critical races for predictability and to ensure our circuit does the intended function!
Page 1
Non-Critical Race
Assume current state is 00, and input changes from 0->1. This requires y1y2 to change from 00->11.
x y1y2 00 curr state 01 11 10 0 1
00 11 00 01 00 01 00 11
Depending on circuit delays, several possible transition sequences: 00 -> 11 -> 01 (simultaneous change for y1 and y2). 00 -> 01 (y2 changes first). 00 -> 10 -> 11 -> 01 (y1 changes first)
In all cases, we end up in the same stable state, so the race is non-critical.
Page 2
Critical Race
Assume current state is 00, and input changes from 0->1. This requires y1y2 to change from 00->11.
x y1y2 00 curr state 01 11 10 0 1
00 11 00 11 00 11 00 10
Possible transition sequences: 00->11 (y1 and y2 change simultaneously) 00->01->11 (y2 changes first) 00->10 (y1 changes first)
So, depending on which state variable changes first, we can get into a different stable state the race is critical.
Page 3
Races are a consequence of state variables changing at the same time and therefore cant happen until binary state assignment is done.
Flow tables are entirely symbolic, so no problems there
Page 4
Transitions will be 00->01->11->10->01-> So, our circuit oscillates. If this was not our intention, we are in trouble.
Should have a stable state for each input condition and make sure we get to a stable state always.
ECE124 Digital Circuits and Systems Page 5
Page 6
Example
Consider an example flow table
curr state a b c d
Page 7
curr state a b c d
Page 8
10 c
11 d
a 00
b 01
This is a BAD assignment, since a transition from b->c or d->a requires two state variables to change simultaneously.
Page 9
10 d
11 c
a 00
b 01
This is a GOOD assignment, since a transition from b->c or d->a requires only one state variables to change.
Page 10
Page 11
Example
Consider the following flow table:
curr state a b c d
Page 12
If we try, we see that there is no way to re-arrange the states to the corners of the cube to get rid of the diagonals in the transition diagram No state assignment that has only one state variable changing at a time.
Page 13
d e c
b
a b
Page 14
Page 15
curr state a b c d
curr state a b c d e f g
Page 16
Best to do an example
Page 17
Example
curr state a b c d
Consider the following flow table, and another (larger table) with equivalent states:
next state x1x2=00 a a c c x1x2=01 a b b a x1x2=10 c d c d x1x2=11 b b d d
curr state a1 a2 b1 b2 c1 c2 d1 d2 next state x1x2=00 a1 a2 a1 a2 c1 c2 c1 c2 x1x2=01 a1 a2 b1 b2 c2 b1 d2 d1 x1x2=10 c1 a1 b2 d2 c1 c2 d1 d2 x1x2=11 b1 b2 b1 b2 d1 d2 d1 d2
output 0 1 0 1
output 0 0 1 1 0 0 1 1
The flow table with equivalent states permits a race free state assignment. We can see this by looking at the states on a 3-dimensional cube.
Page 18
Example
c2
curr state a1 a2 b1 b2 c1 c2 d1 d2 next state x1x2=00 a1 a2 a1 a2 c1 c2 c1 c2 x1x2=01 a1 a2 b1 b2 c2 b1 d2 d1 x1x2=10 c1 a1 b2 d2 c1 c2 d1 d2 x1x2=11 b1 b2 b1 b2 d1 d2 d1 d2 output 0 0 1 1 0 0 1 1
d2 b2
b1
c1 a1 a2
d1
With equivalent states, we always have 1 of the 2 equivalent states directly adjacent to every other state!
Page 19
Page 20
Example
Consider the following flow table, with one-hot state assignment:
Look for transitions and introduce new unstable states, as required using one-hot encoding scheme.
Page 21
Example
curr state 0001 0010 0100 1000 a b c d next state x1x2=00 a a c c x1x2=01 a b b a x1x2=10 c d c d x1x2=11 b b d d
curr state 0001 0010 0100 1000 0101 0011 1010 0110 1100 1001 a b c d e f g h i i
Page 22