Keil Logo


Numbers may be specified in hexadecimal (base 16), decimal (base 10), octal (base 8), and binary (base 2). The default representation is decimal. A decimal, octal, or binary number's first character must always be a digit (0-9). Hexadecimal numbers whose first character is not a digit (0-9) must be prefixed with a zero ('0').

The base of a number is specified by the last character in the number. A number that is specified without an explicit base is interpreted as decimal number.

The following table illustrates various types of numbers:

Base Suffix Legal Characters Examples
Hexadecimal H,h 0-9, A-F, a-f 1234H 99H 123H 0A0F0H 0FFH
Decimal D,d 0-9 1234 65590D 20d 123
Octal O,o,Q,q 0-7 177O 7777o 25O 123o 177777O
Binary B,b 0-1 1111B 10011111B 101010101B


  • Hexadecimal numbers may be written using C notation. For example, 0x12AB.
  • Hexadecimal numbers must begin with a 0 if the first digit is A-F.
  • The dollar sign character ('$') may be used in numbers to make them more readable (as long it is not the first or last character). For example:
    1111$0000$1010$0011B   - is equivalent to -   1111000010100011B
    1$2$3$4                - is equivalent to -   1234
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.