Showing results for 
Search instead for 
Did you mean: 
Registered: ‎03-22-2016

Constant module (xlconstant) - checker does not flag wrong cases.

Currently hexadecimal constants are silently being accepted and not flagged. This caused me some grievance and might be potentially be a problem for new users. 

For example, if I set the constant to 0x500000000  (5_0000_0000) I obtain 0x00000010 and 0xe1563500 on the SDK (through 2x32 bit gpio). 

If I feed 0xFFFFFFFF, or any hexadecimal number with a letter, it fails in synthesis with invalid character - as expected.

If instead I feed only 0x5000, it does not give me an error because of the 'x' character but I obtain 0x00000000 and 0x000b1008, which is 725000 in decimal. Coincidentally, 'x' (ascii 120) minus '0' (ascii 48) is exactly 72.

If the constant input is "4294967298" (0x100000002) then I obtain the expected 0x0001 and 0x0002. 

Thankfully I checked other 64-bit decimal constants and they behave okay.

I just want to leave an alert here and make a request to either add support for hexadecimal radix or properly flag them in the GUI when they are entered.

 --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos