RTL Studio Open IDE

Logic Gates

3-State Buffer with Enable and High-Z

A synchronous 3-state buffer with enable control and active-low reset, outputting High-Z when disabled.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

3-State Buffer with Enable and High-Z is a Verilog reference block in the Logic Gates catalog. AND, OR, XOR, and other combinational gate and boolean logic primitives. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

An OpenIP implementation of a synchronous 3-state buffer with active-low reset and enable control. This module is designed for bus-sharing applications where high-impedance (High-Z) states are required when the buffer is disabled.

This module implements a configurable 8-bit synchronous 3-state buffer. It supports active-low synchronous reset and an enable signal to control data passing versus High-Z output. It is suitable for simple bus interface designs where multiple drivers share a common bus line.

This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC-BY-NC-ND-4.0). See the LICENSE file for details.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 3-State Buffer with Enable and High-Z.
  2. Read the Verilog module in the editor. The catalog line for this block: A synchronous 3-state buffer with enable control and active-low reset, outputting High-Z when disabled.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Features

  • Data Width: 8-bit (fixed in this implementation).
  • Clocking: Positive edge-triggered synchronous logic.
  • Reset: Active-low synchronous reset (rst_n).
  • Control: Enable signal (en) controls data passing vs High-Z state.
  • Verification: Includes a comprehensive testbench with 5 test cases covering reset, enable, data changes, and disable states.

Ports

PortDirectionWidthDescription
clkInput1Clock signal
rst_nInput1Active-low reset signal
data_inInput8Input data bus
enInput1Enable control (1=Drive, 0=High-Z)
data_outOutput8Output data bus

Verification

The provided testbench (tb/tb_three_state_buffer.v) verifies five key scenarios:

  • TC1: High-Z output when disabled after reset.
  • TC2: Data driving when enabled (data_in = 8'h55).
  • TC3: Data changes while enabled (data_in = 8'hFF).
  • TC4: Return to High-Z when disabled.
  • TC5: High-Z output during reset assertion.

### Running Simulation

  1. Ensure you have a Verilog simulator installed (e.g., ModelSim, VCS, or Icarus Verilog).
  2. Navigate to the project root directory.
  3. Run the simulation script or command appropriate for your toolchain.
  4. Check the Log panel for the following expected results:

- TC1 PASS - Output is High-Z - TC2 PASS - Output drives 55h - TC3 PASS - Output drives FFh - TC4 PASS - Output returns to High-Z - TC5 PASS - Output is High-Z on reset - Simulation ends with INFO: PASS

More in Logic Gates

All Logic Gates blocks