1.1.4 Using Number Bases
All operations involving numbers in the CUPL compiler are performed with 32-bit accuracy. Therefore, numbers may have values from 0 to 232-1. A number may be represented in any of the four common bases: binary, octal, decimal or hexadecimal. The default base for all numbers used in the source file is hexadecimal, except for device pin numbers and indexed variables, which are always decimal. Binary, octal and hexadecimal numbers can have "don't care" (“X”) values intermixed with numerical values.
| Number | Base | Decimal Value |
|---|---|---|
| ‘b’0 | Binary | 0 |
| ‘B’1101 | Binary | 13 |
| ‘O’663 | Octal | 435 |
| ‘D’92 | Decimal | 92 |
| ‘h’BA | Hexadecimal | 186 |
| ‘O’[300..477] | Octal (range) | 192..314 |
| ‘H’7FXX | Hexadecimal (range) | 32512..32767 |
