subject
Engineering, 13.03.2020 22:01 paisley13

FsmCompute takes one bit at a time as input. Fill in the blanks below so that it behaves as according to the FSM above. ***Hint: your expressions from the previous should come in handy, along with some bitwise operators. Also, note how the state is a static variable, so it is maintained across function calls.

Hint: x is a signed int, so be careful, ~0 == -1 != 1. Also, you cannot use the logical operators, only bitwise operators.

/* Called once per "clock cycle."
Assume input x is 0 or 1.
Updates state and outputs FSM output (0 or 1). */

int fsmCompute(int x) {
int output;
static unsigned int curr_state = 0x1;
static unsigned int next_state = 0x1;
curr_state = ;
output = ;
next_state = ;
return output;
}
(a) curr_state =

0

1

next_state

~next_state

curr_state

~curr_state

x

~x

((x)&curr_state)

((x)&curr_state&1)

((~x)&curr_state)

((~x)&curr_state&1)

(((x&~(curr_state >> 1)) << 1) | ((~x)))

(((~(curr_state >> 1)) << 1) | ((~x)&1))

(((x&~(curr_state >> 1)) << 1) | ((~x)&1))

(((x&~(curr_state << 1)) >> 1) | ((~x)&1))

(b) output =

0

1

next_state

~next_state

curr_state

~curr_state

x

~x

((x)&curr_state)

((x)&curr_state&1)

((~x)&curr_state)

((~x)&curr_state&1)

(((x&~(curr_state >> 1)) << 1) | ((~x)))

(((~(curr_state >> 1)) << 1) | ((~x)&1))

(((x&~(curr_state >> 1)) << 1) | ((~x)&1))

(((x&~(curr_state << 1)) >> 1) | ((~x)&1))

(c) next_state =

0

1

next_state

~next_state

curr_state

~curr_state

x

~x

((x)&curr_state)

((x)&curr_state&1)

((~x)&curr_state)

((~x)&curr_state&1)

(((x&~(curr_state >> 1)) << 1) | ((~x)))

(((~(curr_state >> 1)) << 1) | ((~x)&1))

(((x&~(curr_state >> 1)) << 1) | ((~x)&1))

(((x&~(curr_state << 1)) >> 1) | ((~x)&1))

***Hint: Expression from previous part:

Come up with the MOST simplified boolean expressions for determining bits for the next state and the output bit given the current state and the input bit.

We'll label the input bit as In, and the left bits as Cur_1 and Next_1 for start state and next state left bits, respectively, and do the same for right bits Cur_0 and Next_0.

Format your answer using C syntax for bit operations:

Answer was:

Out = Cur_0 * ~In
Next1 = ~Cur_1 * In
Next0 = ~In
Hope this hint is helpfull

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Coiled springs ought to be very strong and stiff. si3n4 is a strong, stiff material. would you select this material for a spring? explain.
Answers: 2
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
question
Engineering, 04.07.2019 18:10
Slip occurs via two partial dislocations because of (a) the shorter path of the partial dislocation lines; (b) the lower energy state through partial dislocations; (c) the charge balance.
Answers: 1
question
Engineering, 04.07.2019 18:10
Which of the following components of a pid controlled accumulates the error over time and responds to system error after the error has been accumulated? a)- proportional b)- derivative c)- integral d)- on/off.
Answers: 2
You know the right answer?
FsmCompute takes one bit at a time as input. Fill in the blanks below so that it behaves as accordin...
Questions
question
History, 24.03.2020 19:51
question
Mathematics, 24.03.2020 19:51
question
Mathematics, 24.03.2020 19:51
Questions on the website: 13722367