Write a Verilog program to describe a sequential circuit that has input X and output Z. Z goes to 1 whenever the last four X inputs (in four clock cycles) are 1001 or 0110. Use a switch (SW1) on the DE1 board for X and a red LED for Z. Use a push button as the clock input. Use both the Moore and Mealy models to describe the circuit.
module sequential_mealy (clock, X, Z);
input clock, X;
output reg Z;
parameter [2:0] S0=3'b000, S1=3'b001, S2=3'b010, S3=3'b011, S4=3'b100, S5=3'b101, S6=3'b110;
reg [2:0] current_state, next_state;
always @ (posedge clock)
begin
current_state <= next_state;
end
always @ (current_state, X)
begin
case (current_state)
S0 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S1;
else
next_state <= S2; end
S1 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S1;
else
next_state <= S3; end
S2 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S4;
else
next_state <= S2; end
S3 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S4;
else
next_state <= S5; end
S4 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S6;
else
next_state <= S3; end
S5 : if (X == 1'b1)
begin
next_state <= S4;
Z <= 1'b1;
end
else begin
next_state <= S2;
Z <= 1'b0;
end
S6 : if (X == 1'b0)
begin
next_state <= S3;
Z <= 1'b1;
end
else begin
next_state <= S1;
Z <= 1'b0;
end
default : next_state <= S0;
endcase
end
endmodule
module sequential_moore (clock, X, Z);
input clock, X;
output reg Z;
parameter [3:0] S0=4'b0000, S1=4'b0001, S2=4'b0010, S3=4'b0011, S4=4'b0100, S5=4'b0101, S6=4'b0110, S7=4'b0111, S8=4'b1000 ;
reg [3:0] current_state, next_state;
always @ (posedge clock)
begin
current_state <= next_state;
end
always @ (current_state, X)
begin
case (current_state)
S0 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S1;
else
next_state <= S2; end
S1 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S1;
else
next_state <= S3; end
S2 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S4;
else
next_state <= S2; end
S3 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S4;
else
next_state <= S5; end
S4 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S6;
else
next_state <= S3; end
S5 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S7;
else
next_state <= S2; end
S6 : begin
Z <= 1'b0;
if (X ==
1'b1)
next_state <= S1;
else
next_state <= S8; end
S7 : begin
Z <= 1'b1;
if (X ==
1'b1)
next_state <= S1;
else
next_state <= S3; end
S8 : begin
Z <= 1'b1;
if (X ==
1'b1)
next_state <= S4;
else
next_state <= S2; end
default : next_state <= S0;
endcase
end
endmodule
Write a Verilog program to describe a sequential circuit that has input X and output Z....
Suppose a sequential logic circuit has an input X and a clock input CLK. The outputs are Qi,Qo, and Y, and the next state table is as shown below Q00 X-0 X=1 01 10 01 10 0 0 0 a) Is this a Moore circuit or Mealy circuit? b) What does this cireuit do when the input X - c) What does this circuit do when the input X 1? d) Suppose the initial values of the state are QiQ...
A sequential circuit has one input (X) and one output (Z). Draw a Mealy state graph for the following case: The output is Z= 1 iff the total number of 1's received is divisible by 4. (Note: 0,4,8, 12, ... are divisible by 4.)
digital logic
Design a sequential circuit for a single-input and single output Moore-type FSM that produces an output of 1 if in the input sequence it detects either 110 patterns. Overlapping sequences should be detected.(Note : use D flip-flops in your design. Repeat problem 2 for a Mealy-type FSM 2. 3.
Design a sequential circuit for a single-input and single output Moore-type FSM that produces an output of 1 if in the input sequence it detects either 110 patterns. Overlapping...
Design a sequential circuit whose output Z becomes 1 when the pattern "01101" is found at 1-bit input X under the following conditions. (1) Use a D flip-flop for the flip-flop used as a Mealy machine (2) Use a RS flip-flop for the flip-flop used as a Moore machine
Design a Mealy sequential circuit with one input X and one output Y that recognizes the sequence 1101 anywhere on the input sequence X. When the circuit recognizes the sequence it asserts its output Z high. Design the circuit with T flip flops.
(6 points) Design a sequential circuit with one synchronous input x and one output z. The output z is high whenever the input sequence has at least two 1's followed by at least three 0's. The output should go high on the third 0 and remain high until the next 1. Below is a sample sequence of inputs and the corresponding outputs at the positive clock edges. x 1 0 0 0 1 1 0 0 0 0 1 1...
QUESTION 1 Question: A sequential circuit has two inputs, P1 and P2, and an output, Z. Its function is to compare the input sequences on the two inputs. If P1 = P2 during any three consecutive clock cycles, the circuit produces Z = 1; otherwise, Z = 0. For example: P1:0 1 1 0 1 1 1 000110 P2:11 10101000111 Z:0000110001111 a) Draw the state diagram b) Show the corresponding state table c) Derive the next state and output functions...
A sequential circuit with two D Flip-Flops and one input X and one output Y is specifed by the following input equations: Y = A'+B DA = X + B DB = XA' (a) Draw the logic diagram of the circuit (b) Derive the state table. (c) Derive the state diagram. (b) Is this a Mealy or a Moore machine?
x is a successive circuit with 1 input and one z output flip flop input and output equations are as follows. a) Draw the block diagram of the circuit. b) Explain whether the circuit is a Mealy or Moore circuit. c) Analyze the behavior of the circuit A(t+1)=A’B’X B(t+1)= A+C’X’+BCX C(t+1)= AX+CX’+A’B’X’ Y= A’X
please provide the answers of the 4 points thanks?
C Tarek Ould-Bachir, PEng,PhD. Design of Sequential Circuits ise 10. nesign the sequential circuit illustrated by Figure 11 Sequence Detector. The cireuit has an input X and wo outputs Y and Z. The output Y goes high (1) whenever the sequence 1-0-1 has been detected on x. The output Z goes high (1) whenever the sequence 1-1 has been detected on X. Figure 11 Sequence Detector #2 1 Draw the state...