Question
Imagine a state machine that has a two-bit input in[1:0] and an output out. Consider the initial state to be one where out = 0.
Imagine a state machine that has a two-bit input in[1:0] and an output out. Consider the initial state to be one where out = 0. In this state machine, all output changes should occur in synch with the clock.
The output should only change in response to the following input sequences. Each two-bit value represents an input condition that along with a clock trigger causes a state change. As indicated above, the output should only change on the clock trigger following the second two-bit value in the sequence.
The clocked input sequence ins[1:0] = 10, 00 causes the output to become 0.
The clocked input sequence ins[1:0] = 01, 00 causes the output to become 1.
The clocked input sequence ins[1:0] = 11, 00 causes the output to toggle (complement) its value.
Implement the state machine using a one-hot encoding for the state assignment and D flip-flops The module you write should instantiate the proper number of flip-flops to implement a one-hot state assignment. Use continuous assignments for the D flip-flop input logic and the Z output logic. Use the following model for your module declaration module state onehot (clock, init, in, out, state) input clock, init; inRutml1:0] in; output out; output ?:0] state; //2 is something that should be changed. How many states are there? When using a one-hot state code, every state including the initial state - is a one-hot code. Therefore, you must use the same init to set the initial state's hot bit that you use to reset the bits of the initial state that are not hot. Implement the state machine using a one-hot encoding for the state assignment and D flip-flops The module you write should instantiate the proper number of flip-flops to implement a one-hot state assignment. Use continuous assignments for the D flip-flop input logic and the Z output logic. Use the following model for your module declaration module state onehot (clock, init, in, out, state) input clock, init; inRutml1:0] in; output out; output ?:0] state; //2 is something that should be changed. How many states are there? When using a one-hot state code, every state including the initial state - is a one-hot code. Therefore, you must use the same init to set the initial state's hot bit that you use to reset the bits of the initial state that are not hotStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started