Base Number Calculation
CalcES allow you to perform calculation on DECIMAL, BINARY, OCTAL and HEXADECIMAL bases.
-
Press MODE , select
BASE-N
to enter Base-N Calculations mode -
The Base-N display contains the current base and the bit size.
Base-n and bit size
Supported bases
- BINARY: base 2, 01
- OCTAL: base 8, 01234567
- DECIMAL: base 10, 0123456789
- HEXADECIMAL: base 16: 0123456789ABCDEF
![drawing](/docs/_astro/img_2.BYJTLAcX_ZMUroL.webp)
Supported data types
- 8 bits (byte, int8)
- 16 bits (short, int16)
- 32 bits (int, int32)
- 64 bits (long, int64)
![drawing](/docs/_astro/img_3.CLDOgOfN_Z1AnUwK.webp)
Converting from a base to another base
Example: Converting 542
(base 10) to base 2
(binary) and base 16
(hex)
-
Switch to
DECIMAL
base by pressingDEC
-
Enter
542
-
Press
HEX
to convert to hex -
Press
BIN
to convert to binary
Operators
Arithmetic operators
Plus:
BINARY 16 bits signed
1001 + 1111 = 1 1000
![drawing](/docs/_astro/img_8.D5qyXlfR_1ax6wQ.webp)
Subtract:
BINARY 16 bits signed
1 0101- 11 0100=1111 1111 1110 0001
![drawing](/docs/_astro/img_9.pWgHeUn3_Z147sD.webp)
Multiply
HEXADECIMAL 16 bits34E * FECB = 2DA
![drawing](/docs/_astro/img_10.DynhnLGU_Z1aNgyP.webp)
Divide
For non-integer value, (like 12.5
), the calculator DOES NOT use an IEEE-754 format.
Instead, it uses the following format:
12.52 (decimal) = 1100.1000 0101 0001 1110... (binary)
12.52 = 12 + 0.52
12 (decimal) = 1100 (binary) = 1*2^3 + 1*2^2 + 0*2^1 + 0*2^0 (decimal) = 8 + 4 + 0 + 0 (decimal) = 12 (decimal)
0.52 (decimal) = 0.1000 0101 0001 1110 (binary) = 1*2^-1 + 1*2^-6 + 1*2^-8 + 1*2^-12 ... (decimal) = 0.5 + 0.0015625 + 0.003 906 25 + ... (decimal) = 0.52
Example
BINARY 16 bits signed1110 ÷ 110 = 10.0101 0101 0101 0101
(14 ÷ 6) = 2.333 333 ... (decimal)
![drawing](/docs/_astro/img_15.RK4tdEjj_1Oqlgz.webp)
Mod
DECIMAL63 mod 60 = 3
![drawing](/docs/_astro/img_11.CH5tA94j_Z2kP5N.webp)
Logical operators
And
1 0011^1 0110=1 0011
![drawing](/docs/_astro/Screenshot_20230830_230326.DQu480yD_2iN6bQ.webp)
Nand
Or
1 0011v 1 0110= 1 0111
![drawing](/docs/_astro/Screenshot_20230830_230548.D8tIBGJy_1XH3i2.webp)
Nor
Xor
1 0011⊕ 1 0110= 0 0101
![drawing](/docs/_astro/Screenshot_20230830_230702.DX0QvAI5_ZaBjAp.webp)
Nxor
Not
BINARY 8 bits signed
~1 0011 = 1110 1100
![drawing](/docs/_astro/Screenshot_20230830_230830.3imJhSog_1rcPGO.webp)
ShiftRight
When shifting right, the right most bit is lost and 0 is inserted on the left most.
1011 >>> 1 = 0101
![drawing](/docs/_astro/Screenshot_20230830_231309.QmlXo0OB_ZPecX9.webp)
If a number is negative (encoded using two’s complement), then a right shift preserves the number’s sign
BINARY 8 bits signed
1101 1111 >> 1 = 1110 1111
![drawing](/docs/_astro/Screenshot_20230830_231608.D-THuIB7_Z1iGauQ.webp)
![drawing](/docs/_astro/Screenshot_20230830_231614.BnBPqEDe_Z2745ef.webp)
ShiftLeft
0010 << 1 = 0100
![drawing](/docs/_astro/Screenshot_20230830_231021.DU4QU6DW_1GSr0e.webp)
Logical functions
RotateLeft
BINARY 8 bits signed
RotateLeft(1001 0111, 1)=0010 1111
![drawing](/docs/_astro/Screenshot_20230830_232355.BkTFS3Np_OHo1w.webp)
RotateRight
BINARY 8 bits signed
RotateRight(1001 0111, 1)=1100 1011
![drawing](/docs/_astro/Screenshot_20230830_232534.BDy-BFjB_1CEnAi.webp)
Floor
Ceil
Settings
Digit grouping format settings
The calculator allow to customize the digits grouping.
Example: the number 1001010010101001
can be formatted with 4, 9, 16 and 32 digits per group
1001 0100 1010 100110010100 101010011001010010101001
![drawing](/docs/_astro/Screenshot_20230830_232657.Dvu57JE7_gtaJv.webp)
![drawing](/docs/_astro/Screenshot_20230830_232704.DL55jxCf_Z14PD8T.webp)
Fractional part precision of non-integer
This option allow to change the number of digits in fractional part of non-integer number.
3.1235123 (decimal) = 11.00011111 (binary)3.1235123 (decimal) = 11.0001111110011110 (binary)3.1235123 (decimal) = 11.00011111100111101000000010001001 (binary)
![drawing](/docs/_astro/Screenshot_20230830_232719.Cc2QeqVu_2nWee8.webp)