Forum Discussion
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- because natural is a subtype of integer, (d4-d2) is actually an integer. its only when it's assigned is range checking done, so can go negative. --- Quote End --- So you mean, (d4-d2) will get the correct numeric value? I'm not sure from which type property this could be derived. Actually, integer types are converted to signed and unsigned before synthesis, so I fear, the subtype doesn't mean anything here. Furthermore, the bit width is increased by one in the assignment. P.S.: Perhaps more important, it's impossible to guess how the code is synthesized from the shown snippets. The various variables used in the design, including d1 to d4 aren't real design objects unless they convert to registers or LE outputs.