In the constant block I see the value 0x10 = 16. Why?
Altair Forum User
Altair Employee
Answers
-
Submitted by Anders89 on Wed, 09/07/2011 - 18:18.
The constant blocks, like other VisSim blocks, accept C syntax. C uses a 0x prefix as indicating hex notation (a base 16 number). Base 16 can be useful when looking at bit patterns in binary words. Since 16 is a power of 2, each hex digit maps to the same 4-bit pattern shifted by 4*digit position. For instance, 0xF0F is 4 upper bits all 1, 4 middle bits zero and 4 lower bits all 1. This is handy when manipulating bits on an embedded target.
Also, hex numbers are always integer typed. So prefixing with 0x is an easy way to create an integer constant in VisSim.0