Question

Write a test bench to thoroughly test the Verilog module dff_fe_asyn_h. below is the module ddff_fe_asyn_h.code...

  1. Write a test bench to thoroughly test the Verilog module dff_fe_asyn_h. below is the module ddff_fe_asyn_h.code
  2. Simulate the circuit using ISim and analyze the resulting waveform.

Verilog Code for dff_fe_asyn_h is mentioned below:-

//DFF module with asynchronous active high reset with negative edge trigger with clock
module dff_fe_asyn_h (
input clock, // Clock Input
input reset, // Reset Input
input data_in, // Input Data
output reg data_out // Output Data
);

always @ (negedge clock or posedge reset) // triggers at the negative edge of the clock
begin
if (reset) // Asynchronous Active High reset
data_out <= 1'b0;
else
data_out <= data_in; // When reset is not present then it forward the input data to output
end

endmodule

0 0
Add a comment Improve this question Transcribed image text
Answer #1

TEST BENCH:


module tb;
reg rclock,rreset,rdata_in;
wire wdata_out;

dff_fe_asyn_h m1(rclock,rreset,rdata_in,wdata_out);

always
#5 rclock=!rclock;

initial
begin
rclock=0;
@(negedge rclock)
rreset=1;
@(negedge rclock)
rreset=0;
$display(wdata_out);
rdata_in=1;
@(negedge rclock)
$display(wdata_out);
#100 $finish;
end

endmodule

Add a comment
Know the answer?
Add Answer to:
Write a test bench to thoroughly test the Verilog module dff_fe_asyn_h. below is the module ddff_fe_asyn_h.code...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a test bench to thoroughly test the Verilog module dff_fe_asyn_h. below is the module ddff_fe_asyn_h.code...

    Write a test bench to thoroughly test the Verilog module dff_fe_asyn_h. below is the module ddff_fe_asyn_h.code Simulate the circuit using ISim and analyze the resulting waveform. Take full screenshots of all Verilog source codes and the resulting simulation waveform to be included in the lab report. Include explanation of the waveform and how you can conclude that the D flip flop implemented in step 9 is correct in the lab report. Verilog Code for dff_fe_asyn_h is mentioned below:- //DFF module...

  • Write the verilog code that implements a negitive edge D-Flip Flop with asynchronous active low preset...

    Write the verilog code that implements a negitive edge D-Flip Flop with asynchronous active low preset and clear I have : module dff( preset, clear, clk, D, Q) input preset; input clear; input clk; input D; output Q; reg Q; always @ (negedge clk or negedge preset or negedge clear); if (preset); Q = 0; else (clear == 0); Q = D; endmodule I honestly just want to know if i'm doing this right or not, if im not correct,...

  • 10.21 Write a behavioral Verilog module vrDnegEc for a negative-edge-triggered D flip-flop with enable and asynchronous...

    10.21 Write a behavioral Verilog module vrDnegEc for a negative-edge-triggered D flip-flop with enable and asynchronous active-low clear. Also write a test bench that instantiates your flip-flop and exercises its operation for a comprehensive input sequence.

  • Can anyone solve this? i dont understand? verilog 1. (30 pts) Design a mod-6 counter. A...

    Can anyone solve this? i dont understand? verilog 1. (30 pts) Design a mod-6 counter. A mod-6 counter updates its output per clock rising edge according to the following sequence: 000, 001, 010, 011, 100, 101 (then repeat the pattern....). en is enable control (synchronous high active), resetn is reset control (asynchronous low active signal to reset counting sequence to 000) Complete the following Verilog code: en module mod6(clock, resetn, en, z); zI2:0] clock resetn Endmodule

  • Each FF has an asynchronous active-low clear signal. The asynchronous active-low clear signal clears the FF and uses this signal to set the initial output of the FF to zero. (Active-low clear: clear...

    Each FF has an asynchronous active-low clear signal. The asynchronous active-low clear signal clears the FF and uses this signal to set the initial output of the FF to zero. (Active-low clear: clear when clear signal is low (0)). Implement negative edge-triggered T FF using Verilog code. At this time, The interface is as follows. Module t_ff (input t, input clk, input clearb, output q); How the waveform of q changes when the value of input t changes sequentially to...

  • 1. Write a Verilog module called myNot to implement the logic NOT gate. 2. Write a...

    1. Write a Verilog module called myNot to implement the logic NOT gate. 2. Write a test bench to test the myNot module created in step 10. Simulate the circuit using Sim and analyze the resulting waveform. 3. Take full screenshots of the source code of myNot module, the test bench Verilog file, and resulting simulation waveforms to be included in the lab report. Also include your waveform analysis in the lab report.

  • VERILOG CODE Design a new Verilog module to define a 4-bit counter algorithmically using behavioral modeling....

    VERILOG CODE Design a new Verilog module to define a 4-bit counter algorithmically using behavioral modeling. This time we no longer need T FlipFlop submodule. The 4-bit counter can be directly implemented using a 4-bit register variable and adding 1 to its value as follows: input Clock, Clear, Enable; output reg [3:0] Q; always @ (posedge Clock or negedge Clear) if (~Clear) Q <= 0; else if (Enable) Q <= Q + 1'b1;

  • I need a test bench code for this module in verilog. Verilog Code module part6 (А.В.us,G,E,L);...

    I need a test bench code for this module in verilog. Verilog Code module part6 (А.В.us,G,E,L); AlL ((Al --AI --op AIL (us) I-AIL input [2:0]A,B; input us; output G,E.I; reg G,E,L wire [2:0] A,B; always@(A or B) if (us 1)//unsigned mode begin しくーAB: //А is less G-A>B; //B is less 区-A-B; //logical (A equality end --oper AlL1 A[0] & -AIL E<-Ssigned(A) Ssigned(B); //logical equality opera AIL1I -AILI -operat else //signed mode begin しく=$signed(A)<$signed(B); //Ais less G-Ssigned(A)>Ssigned(B);: //B is less end...

  • Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write...

    Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write a proper test-bench and stimulus, thoroughly test your J-K-FlipFlop. Also, show your waveform and describe why your JK-FF does what is is designed to do. Problem 2. a) Write a Verilog module that will assert its output if a 4-bit input binary word is even. b) Show the waveform for two input patterns “1100” and “0101”

  • Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write...

    Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write a proper test-bench and stimulus, thoroughly test your J-K-FlipFlop. Also, show your waveform and describe why your JK-FF does what is is designed to do. Problem 2. a) Write a Verilog module that will assert its output if a 4-bit input binary word is even. b) Show the waveform for two input patterns “1100” and “0101”

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT