KJ wrote:
> Better to have 'Phase_Ctr' defined as a natural instead of a
> std_logic_vector since that is how it is being used
> i.e.
> signal Phase_Ctr: natural range 0 to 7;
Yes sometimes a natural range counter is cleaner.
The downside is I lose the automatic rollover of unsigned.
Here are some related objects from
http://home.comcast.net/~mike_treseler/uart.vhd
constant roll_c : natural := tic_per_bit_c - 1;
subtype tic_count_t is natural range 0 to roll_c;
variable RxBitSampleCount_v : tic_count_t;
variable TxBitSampleCount_v : tic_count_t;
subtype bit_count_t is natural range 0 to char_len_c;
variable RxBitCount_v : bit_count_t;
variable TxBitCount_v : bit_count_t;
-- Mike Treseler