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
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
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
question
Engineering, 04.07.2019 18:20
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
question
Engineering, 06.07.2019 03:10
Consider two concentric spheres forming an enclosure with diameters of 12 cm and 18 cm the spheres are maintained at uniform temperatures ti-50°c and t2 = 250°c and have emissivities .45 and .8, respectively. determine the net rate of radiation heat transfer between the two spheres per unit surface area.
Answers: 1
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
Questions on the website: 13722359