Look at the state diagram on the next slide. Note that the outputs are in red while the inputs are in black. There is one new input (goto_third) and two new 3-bit outputs (Out1 and Out2).
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
module state_machine(
input clk, restart, pause,
input goto_third,
output reg terminal,
output reg [2:0] out1, out2,
output reg even, odd
);
parameter FIRST=3'b000,
SECOND=3'b001,
THIRD=3'b010,
FOURTH=3'b011,
FIFTH=3'b100;
reg [2:0] current_state, next_state;
always @(posedge clk)
begin
if (restart)
current_state <= FIRST;
else
current_state <=
next_state;
end
always @(current_state, pause, goto_third)
begin
case(current_state)
FIRST
: if (pause) next_state <= FIRST; else
next_state <= SECOND;
SECOND : if (pause)
next_state <= SECOND; else next_state <= THIRD;
THIRD
: if (pause) next_state <= THIRD; else
next_state <= FOURTH;
FOURTH : if (pause)
next_state <= FOURTH; else next_state <= FIFTH;
FIFTH
: if (pause && !goto_third) next_state
<= FIFTH; else if (goto_third) next_state <= THIRD; else if
(!goto_third) next_state <= FIRST;
default : next_state
<= FIRST;
endcase
end
always @(current_state)
begin
case(current_state)
FIRST
: begin terminal <= 1'b0; out1 <= 3'd3;
out2 <= 3'd2; even <= 1'b0; odd <= 1'b1; end
SECOND : begin terminal
<= 1'b0; out1 <= 3'd5; out2 <= 3'd4; even <= 1'b1; odd
<= 1'b0; end
THIRD
: begin terminal <= 1'b0; out1 <= 3'd2;
out2 <= 3'd7; even <= 1'b0; odd <= 1'b1; end
FOURTH : begin terminal
<= 1'b0; out1 <= 3'd6; out2 <= 3'd3; even <= 1'b1; odd
<= 1'b0; end
FIFTH
: begin terminal <= 1'b1; out1 <= 3'd5;
out2 <= 3'd2; even <= 1'b0; odd <= 1'b1; end
default : begin
terminal <= 1'b0; out1 <= 3'd0; out2 <= 3'd0; even <=
1'b0; odd <= 1'b0; end
endcase
end
endmodule
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Look at the state diagram on the next slide. Note that the outputs are in red...
Can I get a circuit diagram of this and have the questions in it
answered/explained? Thank you.
TR. I. SINT400 quau AUC I. Parity. The parity of a string of bits is the least significant bit of their binary This sum is either 0 or 1, depending on whether the number of 1's is even or odd. This seems stupid, but adding a parity bit that makes the parity of every binary number being transmitted even allows one to determine...
The task is to design a two-bit controlled counter which has two
counting bits (Q2, Q1), has one control input C1, and also two
extra outputs, one indicating overflow, the other underflow.
When C1=0 the counter counts up by 2s; i.e. 0 becomes 2, 1
becomes 3. In this mode the values 2 and 3 go to the overflow
state. When the control input C1=1, the counter counts down by 2s,
i.e. 3 becomes 1, and 2 becomes 0, and...
QUESTION 1
1. Determine the output X, 2-bit register Creg and State at the
dotted lines of the following HLSM (High Level State Machine). The
initial state is Off (When you write the state for answers, write
“on” and “off”). (Hint: Be careful as to the value of Creg; see
Lecture 26 slide #9 or p. 254 in the textbook)
At line 1: Output X = , Creg = (decimal), State =
At line 2: Output X = , Creg...
(20 points) Using any state encodings you want, generate a state table for the following state diagram. Note that there is one input, X, and there are two outputs, Y and Z. You can come up with whatever names you want for your state variables. And then generate the logic equations for the next state signals (assume D flip-flops for maintaining state) and the output signals, Y and Z 7. A0 A/Y 070 x=1 x=1 x =1 x =0 x...
Finite state machine (FSM) counter design: Gray
codes have a useful property in that consecutive numbers differ in
only a single bit position. Table 1 lists a 3-bit modulo 8 Gray
code representing the numbers 0 to 7. Design a 3-bit modulo 8 Gray
code counter FSM.
a) First design and sketch a 3-bit modulo 8 Gray code counter
FSM with no inputs and three outputs, the 3-bit signal
Q2:0. (A modulo N counter counts from 0 to N −...
Anyone want to be a class hero? Our entire class is stuck and
the professor isn't responsding (and its due soon). We can't figure
out how to connect our four outputs of the multiplexers to a single
four input decoder in a way that causes the two seven segment
displays to alternate (see instructions). I understand the idea is
that we set the clock to a very high frequency so it looks like
they are both on when they are...
(15 points) Your colleague is trying to code a VHDL model for a 7419 register. Review the code on the next page and make any and all correction correct working model. Note the function model. Note the function table and additional information regarding need to solve this problem. DL model for a 74194 4-bit bidirectional universal shift tions that are necessary to produce a al information regarding the problem that you Control Signals Mode CirN SI SO Outputs 1 1...
In this lab, you will design a finite state machine to control the tail lights of an unsual car. There are three lights on each side that operate in sequence to indicate thedirection of a turn. Figure ! shows the tail lights and Figure 2 shows the flashing sequence for (a) left turns and (b) right rums. ZOTTAS Figure 28:8: BCECECece BCECECECes BCECECECB BCECECBCB 8888 Figure 2 Part 1 - FSM Design Start with designing the state transition diagram for...
Design (and then verify your design by simulating it) a two-bit
counter that counts up or down. Use an enable input E to determine
whether the counter is on or off: if E = 0 the counter is disabled
and remains at its present count even if clock pulses are applied.
If E = 1, the counter is enabled and a second input, x, determines
the direction of the count: if x = 1 the circuit counts upward 00,
01,...
please make a pretty JAVA GUI for this code
this is RED BLACK TREE and i Finished code
already
jus need a JAVA GUI for this code ... if poosible make
it pretty to look thanks and
please make own GUI code base on my code
thanks
ex:
(GUI only have to show RBTree)
----------------------------------------
RBTree.java
import java.util.Stack;
public class RBTree{
private Node current;
private Node parent;
private Node grandparent;
private Node header;
private Node...