+92 332 4229 857 99ProjectIdeas@Gmail.com

Verilog Code For Tristate Buffer | Verilog Example Codes

Tristate buffers are switches having three logic states 1, 0 and z(or commonly known as high impedance state). Buffers are commonly used in digital circuits for enabling/disabling circuit configurations and for other switching purposes. Buffers usually have no logic involved and can be considered as a simple piece of wire. However buffers may associate delays with them. The verilog code presented below shows a model of a single bit tristate buffer switch.

module tristate_buffer (data_out, data_in, enable);
output data_out;
input  data_in;
input  enable;

assign data_out = enable ? data_in : 1'bz;