Docsity

Baseball Scoreboard on Introduction to Computer Engineering | ECE 2030, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
Strike State Machine
You're designing a baseball scoreboard. A sub-problem involves keeping trackof strikes and fouls. A
strike
occurs when the batter swings at the ball and misses, or when the batter does not swing at a
\good" pitch. If a batter earns three strikes during his/her turn at bat, he/she is \out". A
foul
occurs
when the batter hits the ball, but the ball does not land in \fair" territory. Fouls are counted as strikes
until the batter earns two strikes. Then fouls are ignored. The state diagram below captures these rules.
The null input indicates neither a strike nor a foul occurred during that clock cycle. The strike and foul
input cannot occur simultaneously, so the output for this case is don't care.
0
strikes
1
strike
2
strikes
strike /
strike /
foul /
strike / out
foul /
foul /
null /
null /
null /
Part A
Using the state diagram above, complete the state table for this diagram. The inputs are strike,
foul, and state bits
S
1
and
S
0
. The outputs are next state bits
NS
1
and
NS
0
,andout.
S
1
S
0
strike foul NS
1
NS
0
out
0 0 0 0
0 0 0 1
0 0 1 0
0 1 0 0
0 1 0 1
0 1 1 0
1 0 0 0
1 0 0 1
1 0 1 0
pf2

Partial preview of the text

Download Baseball Scoreboard on Introduction to Computer Engineering | ECE 2030 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Strike State Machine

You're designing a baseball scoreb oard. A sub-problem involves keeping track of strikes and fouls. A strike o ccurs when the batter swings at the ball and misses, or when the batter do es not swing at a \go o d" pitch. If a batter earns three strikes during his/her turn at bat, he/she is \out". A foul o ccurs when the batter hits the ball, but the ball do es not land in \fair" territory. Fouls are counted as strikes until the batter earns two strikes. Then fouls are ignored. The state diagram b elow captures these rules. The null input indicates neither a strike nor a foul o ccurred during that clo ck cycle. The strike and foul input cannot o ccur simultaneously, so the output for this case is don't care.

strikes

strike

strikes

strike /

strike /

foul /

strike / out

foul /

foul /

null /

null / null /

Part A Using the state diagram ab ove, complete the state table for this diagram. The inputs are strike, foul, and state bits S 1 and S 0. The outputs are next state bits N S 1 and N S 0 , and out.

S 1 S 0 str ik e f oul N S 1 N S 0 out 0 0 0 0

Part B Determine the simpli ed logical expression for N S 1 , N S 0 , and out using your state table in part A. Complete the Karnaugh maps b elow, identify the prime implicants, and express the result.

S

S

S S

strike

strike

strike

foul foul foul

0

0

1 1

NS 0

S

S

S S

strike

strike

strike

foul foul foul

0

0

1 1

NS 1

S

S

S S

strike

strike

strike

foul foul foul

0

0

1 1

out

N S 1 =

N S 0 =

out =

Part C Implement this state machine using your expression from part B, plus two register cells. Use an icon for a one bit register cell. You do not have to show the implementation of a register here. Your logic should b e simpli ed.