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 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:10
The temperature of air decreases as it is compressed by an adiabatic compressor. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
A-mn has a cubic structure with a0 0.8931 nm and a density of 7.47 g/cm3. b-mn has a different cubic structure, with a0 0.6326 nm and a density of 7.26 g/cm3. the atomic weight of manganese is 54.938 g/mol and the atomic radius is 0.112 nm. determine the percent volume change that would occur if a-mn transforms to b-mn.
Answers: 2
question
Engineering, 04.07.2019 18:10
Items are similar to the free issue items, but their access is limited. (clo5) a)-bin stock items free issue b)-bin stock controlled issue c)-critical or insurance spares d)-rebuildable spares e)-consumables
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
question
Chemistry, 06.11.2020 23:40
question
Mathematics, 06.11.2020 23:40
question
Mathematics, 06.11.2020 23:40
question
Social Studies, 06.11.2020 23:40
question
Mathematics, 06.11.2020 23:40
question
History, 06.11.2020 23:40
Questions on the website: 13722360