(a)
The ASM chart
(b)
//+++++++++++++Verilog code ++++++++++++++++//
`timescale 1ns / 1ps
module sequence_d(in,clk,rst,out
);
input clk,rst,in;
output reg out;
parameter reset=2'd0,first0=2'd1,second1=2'd2,third1=2'd3;
reg [1:0] p_state,n_state;
always @(posedge clk or posedge rst) begin
if(rst)
p_state<=reset;
else
p_state<=n_state;
end
always @(*) begin
case(p_state)
reset:begin
out=1'b0;
if(in)
n_state=reset;
else
n_state=first0;
end
first0:begin
out=1'b0;
if(in)
n_state=second1;
else
n_state=first0;
end
second1:begin
out=1'b0;
if(in)
n_state=third1;
else
n_state=first0;
end
third1:begin
if(in) begin
n_state=reset;
out=1'b0;
end
else begin
n_state=first0;
out=1'b1;
end
end
endcase
end
endmodule
//++++++++++++++END++++++++++++++++//
(c)
//+++++++++test bench+++++++++++++++//
`timescale 1ns / 1ps
module tb;
// Inputs
reg in;
reg clk;
reg rst;
// Outputs
wire out;
// Instantiate the Unit Under Test (UUT)
sequence_d uut (
.in(in),
.clk(clk),
.rst(rst),
.out(out)
);
initial begin
// Initialize Inputs
in = 0;clk = 0;rst = 1; #4
in = 0;rst = 0; #4
in = 0;rst = 0; #4
in = 1;rst = 0; #4
in = 1;rst = 0; #4
in = 0;rst = 0; #40 $finish;
end
always #1 clk=~clk;
endmodule
//++++++++++++++++++END+++++++++++++++++++//
Design a synchronous state machine which detects the serial bit sequence of 0 1 10 on the 1-bit i...
Design a MOORE FINITE STATE MACHINE for a Sequence Detector that detects sequentially the number 1510 in a stream of input bits. Label the input w. The output z is equal to 1 if the number 1510 was detected. After detecting the pattern (1510), the machine goes back in the initial state S0. a) Draw the state diagram for the FSM. Add an asynchronous Reset, active LOW. b) How many FFs do you need to implement this FSM? Note: Label the states S0,...
Design a 4-bit serial bit sequence detector. The input to your state detector is called DIN and the output is called FOUND. Your detector will assert FOUND anytime there is a 4-bit sequence of "0101". For all other input sequuences the output is not asserted. (a) (b) Provide the state diagram for this FSM. Encode your states using binary encoding. How many D-Flip-Flops does it take to implement the state memory for this FSM? (c) Provide the state transition table...
6. Develop the state diagram for a Moore state machine that detects a sequence of two or more consecutive 0's in a serial string of bits coming through an input line "X". (When two consecutive zeros are detected, the output is set to 1 and stays there is the zeros keep arriving. If a one occurs in between the zeros, the machine will go back the initial state) Additionally, make sure that the design is self-correcting. Complete the design using...
Using D flip-flops, design a Moore circuit that detects the sequence 1100. The circuit outputs I when the sequence 1100 is received and outputs 0 otherwise. Draw the state diagram and state table, and find the D flip-flops input equations and the output equation x- Z Clock Hint: X: 01011 00011001100011 Z: 0 0 0 0 0 0 100000000000
Sequence detector: The machine has to generate z = 1 when it detects the sequence 1011. Once the sequence is detected, the circuit looks for a new sequence. The signal E is an input enable: It validates the input x, i.e., if E = 1, x is valid, otherwise x is not valid. Draw the State Diagram (any representation), State Table, and the Excitation Table of this circuit with inputs E and x and output z. Is this a Mealy or a...
We want to design a circuit that takes as input a serial bit stream and outputs a 'l' whenever the sequence “111” occurs. Overlaps must also be considered. For instance, if... occurs, then the output should remain active for three consecutive clock cycles. 3.1) Draw the state diagram of the finite state machine. 3.2) Write the System Verilog model for the design.
Consider the circuit in Figure 1. It is a 4-bit (QQ2Q3) synchronous counter which uses four T-type flip-flops. The counter increases its value on each positive edge of the clock if the Enable signal is asserted. The counter is reset to 0 by setting the Clear signal low. You are to implement an 8-bit counter of this type Enable T Q Clock Clear Figure 1. 4-bit synchronous counter (but you need to implement 8-bit counter in this lab) Specific notes:...
Design a Verilog model that describes the following state diagram. (Test bench and simulation are not required) 1. 01 10 1- 10 10 01 01 10 or 01) 01 Design a Verilog model that describes a synchronous 3 bit counter. The counter has a counting mode control signal (M), when M-o, the counter counts up in the binary sequence, when M- 1, the counter advances through the Gray code sequence. (Test bench and simulation are required to verify the counter...
please answer question 4 (all parts of question4 please) will rate! 3. (30 pts) Design a 2-bit Gray code generator that ropetitively delivers the sequence 00301911-10-00when the input signal UP- 1,or in reverse order 009 10기け01 →00→ when UP-0. Your design should include an asynchronous low. active reset operation: the FSM goes to 00 state when a reset signal is applied In addition to the state output z[1). 2[0]. there is a carry/borrow output bit e which is I when...
Write a behavioral Verilog module for a 4-bit Johnson counter that has 8 states. The counter loads the "0000" state if reset is low. The counter should start and end with this state. Write a testbench to verify the correctness of the 4-bit Johnson counter. The testbenclh should have a clock with a period of 20ns and a reset signal. The testbench should store the 4-bit binary outputs of the counter in a file, which will be used to provide...