Question

In: Electrical Engineering

Rising Edge Detector: The rising-edge detector is a circuit that generates a short one-clock-cycle tick when...

Rising Edge Detector: The rising-edge detector is a circuit that generates a short one-clock-cycle tick when the input signal changes from 0 to 1. It is usually used to indicate the onset of a slow time-varying input signal. Moore machine state diagram for the rising-edge detector is shown in Figure 6. a. Draw the state diagram for the rising edge detector b. Adapt the Code Example 1 to implement the detector in Verilog

Solutions

Expert Solution

//verilog code for risimg edge detector of moore fsm

module moore_fsm

(

input clock, reset, x,

output reg z

);

//assign binary encoded codes to the states A through D

parameter

s0 = 2'b00,

s1= 2'b01,

s2= 2'b10;

  

reg [1 : 0] current_state, next_state;

//Section 1: Next state generator (NSG)

always@(*)

begin

case (current_state)

s0: if ( x == 1)

next_state = s1;

else

next_state = s0;

s1: if (x ==1)

next_state = s2;

else

next_state = s0;

s2: if (x == 1)

next_state = s2;

else

next_state = s0;

default : next_state = s0;

endcase

end

//MOORR FSM Output generator

always@(*)

begin

if (current_state == s1)

z = 1;

else

z = 0;

end

//PRESENT STATE SEQUENTIAL LOGIC

always@(posedge clock, posedge reset)

begin

if (reset == 1)

current_state <= s0;

// UPON RESET STATE IS S0

else

current_state <= next_state;

end

endmodule

// rising edge detection test bench

module moore_FSM_tb();

reg clock, reset, x;

wire z;

moore_fsm u1(clock, reset, x, z);

initial begin

$monitor("%4d: z = %b", $time, z);

clock = 0;

reset = 1;

x = 0;

#10 reset = 0;

end

always begin

#5clock = ~clock;

end

initial begin

$dumpfile("test.vcd");

$dumpvars;

#10 x = 1; $display("%4d: x = %b", $time, x);

#10 x = 0; $display("%4d: x = %b", $time, x);

#10 x = 1; $display("%4d: x = %b", $time, x);

#10 x = 1; $display("%4d: x = %b", $time, x);

#10 x = 1; $display("%4d: x = %b", $time, x);

#10 x = 0; $display("%4d: x = %b", $time, x);

#10 x = 1; $display("%4d: x = %b", $time, x);

#10 x= 1; $display("%4d: x = %b", $time, x);

#10 x = 0; $display("%4d: x = %b", $time, x);

#10 x= 1; $display("%4d: x = %b", $time, x);

#10 $finish;

end

endmodule

// Simulation waveforms


Related Solutions

A chorded cycle in a graph is a cycle in the graph with one additional edge...
A chorded cycle in a graph is a cycle in the graph with one additional edge connecting two of the cycle vertices. Prove that every graph with minimum degree 3 contains a chorded cycle as a subgraph. (Hint: Consider a longest path in the graph. What does it tell you when a vertex is the end of a longest path? )
Short circuit evaluation is when the language evaluates the first portion of a BOOLEAN expression and...
Short circuit evaluation is when the language evaluates the first portion of a BOOLEAN expression and if, knowing the result of the value, then skips the evaluation of the second expression. For example, A & B is false if A is false... no need to evaluate B. A similar scenario is true for OR. Most languages implement short circuit evaluation create a program for the following languages: FORTRAN Write the summary of your result An example could look like: function...
1. Using Moore machine approach design a sequence detector with one input and one output. When...
1. Using Moore machine approach design a sequence detector with one input and one output. When input sequence 010 occurs the output becomes 1 and remains 1 until the sequence 010 occurs again in which case the output returns to 0. The output remains 0 until, 010 occurs the third time, and so on. Your design should be able to handle overlapping sequences, i.e., input sequence 11001010100 should produce the output 00000110011. Implement your detector using D flip-flops and the...
A manufacturing company produces electrical insulators. If the insulators break when in use, a short circuit...
A manufacturing company produces electrical insulators. If the insulators break when in use, a short circuit is likely to occur. To test the strength of the insulators, destructive testing is carried out to determine how much force is required to break the insulators. Force is measured by observing the number of pounds of force applied to the insulator before it breaks. The following data (stored in Force) are from 30 insulators subjected to this testing: At the 0.05 level of...
A manufacturing company produces electrical insulators. If the insulators break when in use, a short circuit...
A manufacturing company produces electrical insulators. If the insulators break when in use, a short circuit is likely to occur. To test the strength of the insulators, destructive testing is carried out to determine how much force is required to break the insulators. Force is measured by observing the number of pounds of force applied to the insulator before it breaks. The data shown below are from 30 insulators subjected to this testing: Force 1870 1728 1656 1610 1634 1784...
Otacnu Manufacturing Inc. builds electric insulators. If the insulators break when in use, a short circuit...
Otacnu Manufacturing Inc. builds electric insulators. If the insulators break when in use, a short circuit is likely to occur. To test the strength of the insulators, destructive testing in high-powered labs is carried out to determine how much force is required to break the insulators. The force is measured by observing how many pounds must be applied to the insulator before it breaks. The force measurements, collected from a sample of 30 insulators and stored in the Force are:...
Is it always better to have a long chain than a short one when dealing with...
Is it always better to have a long chain than a short one when dealing with demand uncertainty?
n a short one half page essay, briefly describe TCP/IP. What is it? When was it...
n a short one half page essay, briefly describe TCP/IP. What is it? When was it introduced? Why is it called a suite? What is a Request for Comment (RFC)? Create a table showing the five standards organizations involved with TCP/IP. Include in the table:                     Name                     Brief History                        Responsibilities              Website URL
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT