Abyss-1 Explorer

Problem Description

You are the Lead Design Engineer for the Abyss-1 Explorer, a research submarine stationed 10,000 meters below the Pacific. The sub relies on three critical sensors to stay operational:

  1. Pressure Sensor (Bit 2: Monitors hull integrity)

  2. Oxygen Monitor (Bit 1: Tracks life support)

  3. Engine Temp (Bit 0: Prevents propulsion overheating)

All three sensors must transmit data to the surface via a single narrow-band sonar link. If you use a "Fixed Priority" system (where Pressure always goes first), the Engine Temp sensor might be "starved" of bandwidth, leading to an undetected overheat.

The Crisis:

The submarine just experienced a massive underwater seismic shift, causing a temporary power flicker. The system is now initiating a Cold Boot. In the crushing darkness, the system must remain silent until the Master Reset (rst_n) is released.


The Mission:

Design a Round-Robin Arbiter that ensures "Fairness." It must grant access in a circular rotation so no sensor is ignored.

  • The Reset Rule: While the reset is active, the sonar link must be muted. Once released, the system must be "primed" to give the Engine Temp (Sensor 0) the highest priority if all sensors request at once. This ensures we check the engine status immediately after a power failure.

  • The Fairness Rule: If Sensor 0 was just served, the next priority becomes Sensor 1, then Sensor 2, and so on.


Port Descriptions

To successfully interface with the submarine's communication backbone, your module must use the following ports:

Port Name

Direction

Type

Description

clk

Input

Clock

The system clock used to synchronize arbitration logic.

rst_n

Input

Reset

Active-Low Master Reset. When 0, the system initializes and all grants are revoked.

req[2:0]

Input

3-bit Bus

Request lines from the sensors. req[2] = Pressure, req[1] = Oxygen, req[0] = Engine.

gnt[2:0]

Output

3-bit Bus

gnt[0] = Grant given to Engine temp
gnt[1] = Grant given to oxygen monitor
gnt[2] = Grant given to pressure sensor

Verilog

Code Editor Access

Log in to write, run and submit your solution to this interview question. It's free.

Output

Output goes here...