Predict useful output from a finite batch, including startup, idle service slots and the last partially occupied interval.
Hardware context: Versioned subsystem with a finite work queue. Pre-silicon subsystem integration
This exercise queue begins empty. A producer offers six one-word tickets in order, starting at tick zero. It holds each ticket until accepted and stops after all six enter.
This worksheet uses named constants. The first three entries show how to record your decisions.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
The queue has two entries. At each tick the sink can take one previously queued ticket on an even tick only. The producer can fill a slot freed on that tick. A ticket entering an empty queue cannot leave on the same tick.
A window of N ticks includes ticks 0 through N minus one. Count only departures as useful work.
| Entry | Your decision |
|---|---|
| SLOTS | Physical queue entries. |
| AT_ZERO | Departures on tick zero. |
| AFTER_ONE | Tickets stored just after tick one. |
| EARLIEST | Tick of the first departure. |
| BLOCKED | First tick with an offered ticket refused. |
| IN_SIX | Admissions in a window of six ticks. |
| OUT_SIX | Departures in a window of six ticks. |
| LAST_IN | Tick accepting the sixth ticket. |
| LAST_OUT | Tick delivering the final ticket. |
| POST | Occupancy just after tick ten. |
| DELIVERED | Total tickets delivered during WINDOW ticks. |
Examples
Example 1
SLOTS- Input
Physical queue entries.
- Output
matches = 1
There are two storage slots.
Example 2
AT ZERO- Input
Departures on tick zero.
- Output
matches = 1
The first service opportunity sees an empty queue.
Example 3
AFTER ONE- Input
Tickets stored just after tick one.
- Output
matches = 1
Two arrivals fill the two entries.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For DELIVERED, enter a constant expression using WINDOW. Only this entry changes with the parameter. The supported integer range is 1 through 17, inclusive.
Hints
Hint 1
Write the inclusive tick labels before counting service slots.
Hint 2
An accepted ticket may still be waiting when the window closes.
Hint 3
An empty service slot contributes zero departures.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
12 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 2 problems on this path