World Cup Final
Problem Description
India is defending a low total in the World Cup Final. The stadium uses a Distributed Sensor Network (Ball-tracking, Ultra-edge, and Speed-gun). As the lead architect, you must design a Central Processing Hub (CPH) that aggregates asynchronous data from these sensors and updates the scoreboard in real-time.
The Architectural Challenge
You are designing a Data Pipeline that bridges two separate clock domains: the Sensor Clock (s_clk) and the System/Display Clock (m_clk).
1. The Input Interface (Sensor Domain - s_clk)
The system receives a 16-bit packet from the sensor bus:
[15:13]: Packet Header (Must be3'b101to be valid).[12:10]: Event Type (0: Dot, 1-6: Runs, 7: Wicket).[9]: Extra Flag (1: Wide/No-ball).[8]: Review Flag (1: Event is "Under Review").[7:0]: Checksum (Reduction XOR of bits[15:8]).
2. Architecture Requirements
Asynchronous FIFO: Move data from the 50MHz
s_clkdomain to the 25MHzm_clkdomain using Gray-coded pointers to prevent metastability.Review Logic (Shadow Register): If the
Review Flagis high, the score and balls count must be stored in a Shadow Register.If
review_clearis asserted, add the shadow score to thetotal_score.If
review_overturnis asserted, discard the shadow event.
Over-Limit & Strike Logic:
Strike Rotation: Toggle
current_strikerif an odd number of runs (1, 3, 5) are scored.Over Change: At the end of 6 legal deliveries (excluding extras), toggle
current_strikerand resetballs_in_over.
3. Module Port List
Port Name | Direction | Width | Description |
| Input | 1 | Sensor Clock (50MHz) |
| Input | 1 | Active-low Reset (Sensor Domain) |
| Input | 16 | 16-bit Sensor Data Packet |
| Input | 1 | High when |
| Input | 1 | Display/System Clock (25MHz) |
| Input | 1 | Active-low Reset (Display Domain) |
| Input | 1 | Pulse high to confirm a DRS review |
| Input | 1 | Pulse high to cancel a DRS review |
| Output | 10 | Cumulative runs scored |
| Output | 1 | 0 or 1, representing the active batsman |
| Output | 1 | High when data is in the Shadow Register |
| Output | 3 | Legal balls bowled (0 to 5) |
| Output | 1 | High for 1 cycle if Checksum fails |
Verilog
Code Editor Access
Log in to write, run and submit your solution to this interview question. It's free.
