Design a 4-way round-robin arbiter — a classic resource-scheduling building block used to fairly share a single resource (a bus, a memory port, a shared ALU, etc.) among multiple requesters so that no requester is starved. Ports: - `clk` — input, 1 bit, clock - `rst` — input, 1 bit, synchronous active-high reset - `req` — input, 4 bits (`req[3:0]`) — one request line per requester; any number may be asserted at once - `grant` — output, 4 bits (`grant[3:0]`), registered, one-hot — at most one bit is high at a time, indicating which requester is granted the resource this cycle Behavior, on every rising edge of `clk`: 1. If `rst` is high, `grant` synchronously clears to `4'b0000`, and the round-robin priority order resets so that, immediately after reset, requester 0 has the highest priority (as if requester 3 had just been granted). Reset overrides everything else. 2. Otherwise, the arbiter maintains an internal notion of "who was granted most recently" and uses it to rotate priority: each cycle, the requester immediately after the most-recently-granted one has the highest priority, followed by the next one around, wrapping back to (and including) the most-recently-granted requester itself, who has the lowest priority that cycle. Concretely, if requester `k` was the most recently granted, the priority order for the next decision is `k+1, k+2, k+3, k` (indices mod 4). 3. Among the requesters in that priority order, `grant` is set (one-hot) to the first one whose `req` bit is 1. The internal "most recently granted" pointer updates to that requester. 4. If no `req` bits are asserted at all, `grant` becomes `4'b0000` for that cycle, and the internal pointer does **not** change — the priority ordering carries over unchanged to the next cycle (an idle cycle never causes a requester to lose its earned position in line). This guarantees fairness: if all 4 requesters hold their `req` lines high continuously, each one receives exactly one grant out of every 4 consecutive cycles, in rotating order, with no requester skipped or granted twice in a row ahead of another waiting requester.