Codiode

Tristate Bus Driver

EasyVerilog / SystemVerilogBuildFree4 solved

On a shared wire, only one device may drive at a time. Every other device must put its output in high impedance (z).

The module acts as a tristate buffer for a single-bit bidirectional bus. When the output enable signal is asserted, the buffer actively drives the input data onto the bus. When the output enable is deasserted, the buffer releases the bus by driving a high-impedance state, allowing other devices to control the wire.

This is a purely combinational circuit with no clock or reset. The output must update immediately upon changes to either the input data or the output enable signal.

Signal Direction Width Description
data_in input 1 Data to be driven onto the bus
out_en input 1 Active-high output enable
bus_out output 1 Tristate output bus

Truth Table:

  • data_in=0, out_en=1 → bus_out=0
  • data_in=1, out_en=1 → bus_out=1
  • data_in=0, out_en=0 → bus_out=z
  • data_in=1, out_en=0 → bus_out=z

Constraints

  • Purely combinational logic; no latches or registers.
  • Must output exactly a high-impedance state when disabled.
  • Continuous assignment must be used to infer the tristate buffer.

Topics

CombinationalTristateBuffers

Solve this problem

Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against the problem's testbench. You get the waveform back, not a stored answer.

Free to solve. A Codiode account keeps your progress.

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Part of Combinational RTL

Problem 4 of 15 in the Combinational RTL track.

Related problems

Browse all problems · Verilog practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.