CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Combinational Logic

High Impedance Z Literals

MediumVerilog / SystemVerilogBuild

Shared data buses in multiple master architectures rely on tri-state buffers to prevent electrical shorts when multiple drivers connect to the same physical wire. Only one master drives the bus at a time; all other devices must float their outputs by driving a high impedance state.

The module acts as an 8-bit multiplexer with an output disable control. When the disable signal is asserted, the output must be completely disconnected from the bus by driving all bits to high impedance (Z). When the disable signal is de-asserted, the module passes one of the two 8-bit data inputs to the output based on the select signal.

| Signal | Direction | Width | Description | |--------|-----------|-------|-------------| | disable_out | input | 1 | Disable control; drives output to high impedance when 1 | | sel | input | 1 | Selects data_a when 0, or data_b when 1 | | data_a | input | 8 | First data input | | data_b | input | 8 | Second data input | | out | output | 8 | Multiplexed data output or high impedance bus |

Constraints

  • The circuit must be strictly combinational.
  • When disable_out is 1, all 8 bits of out must be exactly 8'bzzzzzzzz.
  • The disable_out signal has strict priority over the sel signal.
  • The output must not be registered.

Topics

CombinationalMultiplexerTri-stateLanguage Basics

Solve this problem

Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against a real testbench — you get the waveform back, not a stored answer.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

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.

Related problems

  • Single Continuous AssignmentEasy
  • Basic Vector ConcatenationEasy
  • Ternary Operator MuxEasy
  • Underscores for ReadabilityEasy
  • Left Hand Side ConcatenationEasy
  • Inout Port MechanicsEasy
  • Explicit Binary LiteralsEasy
  • Basic Module PortsEasy

Browse all problems · Learning tracks