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

Inout Port Mechanics

EasyVerilog / SystemVerilogBuildFree1 solved

External memory interfaces and shared system buses rely on bidirectional pins to save physical package constraints. A single physical trace acts as both a transmitter and a receiver depending on the bus phase.

The module controls an 8-bit bidirectional data line. When the module is transmitting, it drives the external data line with its internal transmit data. When the module is receiving, it must release the bus by driving a high impedance state, allowing other external devices to drive the line safely without electrical contention. The module simultaneously monitors the external data line and routes its current state to an internal receive data port.

Timing and Reset Rules: • Purely combinational logic; no clock or reset signals are used. • Output values reflect inputs immediately. • High impedance must be driven to the bidirectional bus when not actively transmitting.

| Signal | Direction | Width | Description | |--------|-----------|-------|-------------| | tx_en | input | 1 | Transmit enable; when 1, the module drives bus_io | | tx_data | input | 8 | Internal data to be transmitted | | rx_data | output | 8 | Internal data received from the bus | | bus_io | inout | 8 | External bidirectional bus |

Constraints

  • bus_io must be driven to 8'bzzzzzzzz when tx_en is 0.
  • rx_data must continuously reflect the resolved state of bus_io.
  • Purely combinational logic; no latches or registers.

Topics

BidirectionalContinuous AssignmentHigh Impedance

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.

Free to solve. A Codiode account keeps your progress.

Sign in to solve

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
  • Explicit Binary LiteralsEasy
  • Hexadecimal and Octal LiteralsEasy
  • Vector Port EndiannessEasy

Browse all problems · Learning tracks