Number Base Converter (32-bit)
embedcalc_number_base_convertConvert numbers between decimal, hex, binary, and octal with 32-bit two's complement interpretation, returning unsigned, signed, and bit counts.
Instructions
Convert a number between decimal/hex/binary/octal with 32-bit two's complement semantics (negative decimals wrap; MSB-set values get a signed reading).
Args: value (string) — decimal ('-1', '42'), hex ('0xFF'), binary ('0b1010'), or octal ('0o17'). Returns (structured): { unsigned, signed, hex, bin (4-bit groups), oct, ones_count }. Example: '-1' -> 0xFFFFFFFF, unsigned 4294967295, 32 ones.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | Number in any base: decimal, 0x hex, 0b binary, 0o octal |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bin | Yes | ||
| hex | Yes | ||
| oct | Yes | ||
| signed | Yes | ||
| unsigned | Yes | ||
| ones_count | Yes |