CS 447 - Homework #4 Solution 


 
1.) a.) The error referred to in the email has been fixed - it should be correct now.
b.)
State Assignment CS1 CS0
Normal =  0 0
Right =  0 1
Left =  1 0
Hazard =  1 1

The columns topped by blue are inputs, and the red topped columns are the nextstate.

RON LON CS1 CS0 NS1 NS0
0 0 0 0 0 0
0 1 0 0 1 0
1 0 0 0 0 1
1 1 0 0 1 1
0 0 0 1 0 0
0 1 0 1 1 0
1 0 0 1 0 0
1 1 0 1 1 1
0 0 1 0 0 0
0 1 1 0 0 0
1 0 1 0 0 1
1 1 1 0 1 1
0 0 1 1 0 0
0 1 1 1 1 0
1 0 1 1 0 1
1 1 1 1 0 0

The columns topped by blue are inputs, and the red topped columns are the outputs.

CS1 CS0  LLight   RLight 
0 0 0 0
0 1 0 1
1 0 1 0
1 1 1 1

NOTE: ~FOO will mean "Not FOO" in this document.  (Sorry - HTML is a little lacking sometimes.)

Original Equations:

NS0 = (~CS0~CS1 • RON • ~LON) + (~CS0~CS1 • RON • LON) + (CS0~CS1 • RON • LON) + (~CS0 • CS1 • RON • ~LON) +  (~CS0 • CS1 • RON • LON) + (CS0 • CS1 • RON • ~LON)

NS1 = (~CS0~CS1~RON • LON) + (~CS0~CS1 • RON • LON) + (CS0~CS1~RON • LON) + (CS0~CS1 • RON • LON) +  (~CS0 • CS1 • RON • LON) + (CS0 • CS1~RON • LON)

Reduced Equations:

NS0 = ~CS0 • RON + CS0 • CS1 • RON • ~LON + CS0~CS1 • RON • LON

NS1 = CS1 • LON + CS0 •  CS1~RON • LON + ~CS0 • CS1 • RON • LON

RightLight = CS0

LeftLight = CS1

 

c.)
d.)
2.) Here is a nice elegant solution the TAs came up with. Below it ia a solution derived directly from the truth table approach. You can see how this approach does not necessarily come up with the best solution, and that by using some creativity and intuition, we can do much better.

Let
     D0 = Lowest order bit 
     D1 = Middle bit 
     D2 = highest order bit 

D0 = (inc + D0) • ~reset
D1 = (inc • D0 + D1) • ~reset
D2 = (int • D1 + D2) • ~reset


 

2.) Here is a simpler approach to this problem. We provide the truth table and the equations, but with little trouble, you should be able to take this information and create the PLA and the logic gates...

INC

RES

D2

D1

D0

 

ND2

ND1

ND0

0

0

0

0

0

 

0

0

0

0

0

0

0

1

 

0

0

1

0

0

0

1

0

 

X

X

X

0

0

0

1

1

 

0

1

1

0

0

1

0

0

 

X

X

X

0

0

1

0

1

 

X

X

X

0

0

1

1

0

 

X

X

X

0

0

1

1

1

 

1

1

1

0

1

0

0

0

 

0

0

0

0

1

0

0

1

 

0

0

0

0

1

0

1

0

 

0

0

0

0

1

0

1

1

 

0

0

0

0

1

1

0

0

 

0

0

0

0

1

1

0

1

 

0

0

0

0

1

1

1

0

 

0

0

0

0

1

1

1

1

 

0

0

0

1

0

0

0

0

 

0

0

1

1

0

0

0

1

 

0

1

1

1

0

0

1

0

 

X

X

X

1

0

0

1

1

 

1

1

1

1

0

1

0

0

 

X

X

X

1

0

1

0

1

 

X

X

X

1

0

1

1

0

 

X

X

X

1

0

1

1

1

 

1

1

1

1

1

0

0

0

 

0

0

0

1

1

0

0

1

 

0

0

0

1

1

0

1

0

 

0

0

0

1

1

0

1

1

 

0

0

0

1

1

1

0

0

 

0

0

0

1

1

1

0

1

 

0

0

0

1

1

1

1

0

 

0

0

0

1

1

1

1

1

 

0

0

0

 

 



For each flip-flop, we show the sum of products form and a simplified form, which you can derive using the boolean algebra rules. Note that the flip-flop values themselves are the outputs, so we do not need a separate output function and output logic in this case.

ND2 = ~INC·~RES·D2·D1·D0 + INC·~RES·~D2·D1·D0 + INC·~RES·D2·D1·D0

ND2 = ~RES·D1·D0·(D2 + INC)

 

ND1 = ~INC·~RES·~D2·D1·D0 + ~INC·~RES·D2·D1·D0 + INC·~RES·~D2·~D1·D0 +

INC·~RES·~D2·D1·D0 + INC·~RES·D2·D1·D0

ND1 = ~RES·D0·(~INC·D1 + INC·~D2 + INC·D2·D1)

 

ND0 = ~INC·~RES·~D2·~D1·D0 + ~INC·~RES·~D2·D1·D0 + ~INC·~RES·D2·D1·D0 +

INC·~RES·~D2·~D1·~D0 + INC·~RES·~D2·~D1·D0 + INC·~RES·~D2·D1·D0 +

INC·~RES·D2·D1·D0

ND0 = ~RES·~INC·(~D2·D0 + D1·D0) + ~RES·INC·(~D2·~D1 + D1·D0)

3.)