Engineering
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

answer
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, kayabwaller4589
When at a point two solid phase changes to one solid phase on cooling then it is known as a) eutectoid point b) eutectic point c) peritectic point d) peritectoid point
Answers: 3
image
Engineering, 04.07.2019 18:10, siri5645
At 12 noon, the count in a bacteria culture was 400; at 4: 00 pm the count was 1200 let p(t) denote the bacteria cou population growth law. find: (a) an expression for the bacteria count at any time t (b) the bacteria count at 10 am. (c) the time required for the bacteria count to reach 1800.
Answers: 1
image
Engineering, 04.07.2019 18:20, CelesteN64
Most leaks in reciprocating air compressors can be detected and minimized by: (clo4) a)-detecting leakage areas using ultrasonic acoustic detector. b)-tightening joints and connections c)-replacing faulty equipment d)-all of the given options
Answers: 2
image
Engineering, 06.07.2019 03:10, liliauedt
Explain the strain-hardening phenomenon on the basis of dislocation - dislocation strain field interactions. also, briefly describe what generally happens to the ductility of a metal that has been strain hardened (i. e. does strain hardening make a metal more ductile or
Answers: 3
Do you know the correct answer?
FsmCompute takes one bit at a time as input. Fill in the blanks below so that it behaves as accordin...

Questions in other subjects:

Konu
Advanced Placement (AP), 14.07.2019 09:40