Program the terminal count for a tick generator before a board changes its system clock.
Hardware context: ap_soc serial peripherals. Console and flash bring-up
A local UART counts system edges starting at zero. On the edge seeing TOP it emits a sample tick and restarts from zero.
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
All rates are exercise values. UART sends one bit per symbol. A receiver using M samples per bit needs M ticks in each bit period. The BOARD entries divide exactly. The final ticket has its own rounding rule.
| Entry | Your decision |
|---|---|
| BOARD_0 | 16 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP. |
| BOARD_1 | 32 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP. |
| BOARD_2 | 48 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP. |
| BOARD_3 | 24 MHz, 3 Mbaud, 1 tick(s) per bit. Enter TOP. |
| BOARD_4 | 64 MHz, 2 Mbaud, 8 tick(s) per bit. Enter TOP. |
| BOARD_5 | 96 MHz, 3 Mbaud, 16 tick(s) per bit. Enter TOP. |
| BOARD_6 | 80 MHz, 1 Mbaud, 16 tick(s) per bit. Enter TOP. |
| BOARD_7 | 128 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP. |
| BOARD_8 | 255 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP. |
| BOARD_9 | 16 MHz, 1 Mbaud, 16 tick(s) per bit. Enter TOP. |
| BOARD_10 | 256 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP. |
| ROUNDED_TOP | Clock 50 MHz, RATE in Mbaud, one tick per bit. Round periods per bit to nearest integer, ties upward. Enter TOP. |
Examples
Example 1
BOARD 0- Input
16 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP.
- Output
TOP = 15
Each tick takes 16 clock periods. Count zero as the first state.
Example 2
BOARD 1- Input
32 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP.
- Output
TOP = 31
Each tick takes 32 clock periods. Count zero as the first state.
Example 3
BOARD 2- Input
48 MHz, 1 Mbaud, 1 tick(s) per bit. Enter TOP.
- Output
TOP = 47
Each tick takes 48 clock periods. Count zero as the first state.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For ROUNDED_TOP, enter a constant expression using RATE. Only this entry changes with the parameter. The supported integer range is 1 through 8, inclusive.
Hints
Hint 1
Use the sample rate when the receiver oversamples.
Hint 2
Divide the system rate by the required tick rate.
Hint 3
Label the first period zero.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
16 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