Question

Write down the VERILOG code for a tri-state buffer and the testbench code to test it

Write down the VERILOG code for a tri-state buffer and the testbench code to test it

Homework Answers

Answer #1

// Verilog Test Bench for tri-state buffer

module tb();

reg r_in_x;

reg w_enable;

wire w_output_x;

initial begin

$display("----------------------\nTri-State Buffer\n----------------------\n");


$monitor("input_x = %b, enable = %b, output_x = %b", r_in_x, w_enable, w_output_x);

// Generation of stimulus

r_in_x = 0;w_enable= 0;

# 10 r_in_x = 0;# 10 r_in_x = 1;# 10 w_enable = 1; # 10 r_in_x = 1;# 10 r_in_x = 0; # 10 w_enable = 1;

End

// Tri-state buffer instantiation

tristate_buffer u_tristate_buffer

( .input_x (r_in_x),

.enable (w_enable),  

.output_x (w_output_x));


endmodule

Know the answer?
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
Similar Questions
Write down the VERILOG code for an AND gate and the testbench code to test it
Write down the VERILOG code for an AND gate and the testbench code to test it
Write down the VERILOG code for a 2-to-4 decoder and the testbench code to test it
Write down the VERILOG code for a 2-to-4 decoder and the testbench code to test it
Write verilog code for Huffman Decoder with testbench.
Write verilog code for Huffman Decoder with testbench.
Write the code for a static Huffman decoder in verilog with testbench.
Write the code for a static Huffman decoder in verilog with testbench.
Verilog code for Alarm clock. Develop a block diagram, Verilog codes with testbench, and the waveforms...
Verilog code for Alarm clock. Develop a block diagram, Verilog codes with testbench, and the waveforms screen-prints.
Develop Verilog code for a 8-to-1 Mux with an active low OE input and a tri-state...
Develop Verilog code for a 8-to-1 Mux with an active low OE input and a tri-state output using assign statements.
Write the Verilog code for a 16 to 1 multiplexer as well as a test bench...
Write the Verilog code for a 16 to 1 multiplexer as well as a test bench using gate-level modeling.
Analyze the following Verilog code and write down its output as pictured in the code. module...
Analyze the following Verilog code and write down its output as pictured in the code. module blocking; reg [0:7] A, B; initial begin: init1 A = 3; #1 A = A + 1; // blocking procedural assignment B = A + 1; $display("Output 1: A= %b B= %b", A, B ); A = 1; #1 A <= A + 1; B <= A + 1; #1 $display ("Output 2: A= %b B= %b", A, B ); end endmodul
Write VHDL Code to implement Fibonacci series with testbench and tcl file?
Write VHDL Code to implement Fibonacci series with testbench and tcl file?
Plz use Verilog for below question. I will rate. Write a Verilog code for the following...
Plz use Verilog for below question. I will rate. Write a Verilog code for the following expressions: M = X’Y’ + XY + Z’ N = (A ⊕ B) + C (A + D)
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT