Either way, you'll get the exact same synthesis result because synthesis
doesn't give a hoot if your logic goes out of range at run time.
Kevin Jennings
The synthesis tool may not care, but it is also not bound by the
language to any specific behavior. Synthesis will generally implement
enough bits to handle the range specication of the natural signal (in
this case, four bits). However, if the assignment goes out of the
effective range of the number of bits implemented, the synthesis tool
is free to do whatever it wants. Since the most efficient
implementation is just to truncate, that is usually implemented. In
order to specify that the synthesis results must be truncated to the
implemented bits, a modulo operation is generally required prior to
assignment.
Technically, the synthesizer is free to do anything it wants for
asignements outside even the specified range (values 0 to 9 in this
case) since those cannot be performed within the bounds of the
language itself. This also means that comparisons on the contents
could be optimized. For instance, a comparison of Address = 9 need
only look at bits 0 and 3 if the range of Address is 0 to 9. It does
not matter what the other two bits are, since per the range
specification, they cannot be set if 0 and 3 are set. I have seen
similar optimizations using a natural counter with a range 0 to 5, but
I do not know whether the synthesis tool made the optimizations based
on a reachability analysis of the counter, or on just the range
specification.
Andy