Chargement…
Chargement…
The exercise follows the PDF idea: group structured data in a record, then put shared definitions in a package.
Behaviour
time_of_day_pkg.vhd declares t_time_of_day with hours, minutes, seconds;f_is_valid accepts only 00:00:00 to 23:59:59;f_next_second increments by one second and wraps after 23:59:59;i_reset='1' forces 00:00:00;i_load='1' loads i_time only if the time is valid;i_enable='1' increments by one second;| Signal | Direction | Type | Description |
|---|---|---|---|
i_clk | Input | 1 bit | System clock |
i_reset | Input | 1 bit | Active-high synchronous reset |
i_enable | Input | 1 bit | One-second increment |
i_load | Input | 1 bit | Parallel load |
i_time | Input | t_time_of_day | Time to load |
o_time | Output | t_time_of_day | Current time |
o_midday | Output | 1 bit | Active at 12:00:00 |