Number systems#
| System | Base | Digits |
|---|---|---|
| Binary | 2 | 0, 1 |
| Octal | 8 | 0–7 |
| Decimal | 10 | 0–9 |
| Hexadecimal | 16 | 0–9, A–F |
Conversions#
- Decimal → other base: divide repeatedly by the base, read remainders bottom to top. 25 → 11001₂.
- Other base → decimal: multiply each digit by powers of the base. 1011₂ = 8 + 0 + 2 + 1 = 11.
- Binary ↔ octal: group bits in threes; binary ↔ hex: group in fours. 11010110₂ = 326₈ = D6₁₆.
- Fractions: multiply the fractional part by the base repeatedly.
▶ Try it YourselfPython
हिंदी में समझें
दशमलव संख्या को किसी आधार में बदलने के लिए बार-बार उस आधार से भाग देकर शेषफल नीचे से ऊपर पढ़ें। बाइनरी से ऑक्टल के लिए 3-3 बिट और हेक्साडेसिमल के लिए 4-4 बिट के समूह बनाएँ।
Encoding schemes#
- ASCII: 7-bit (128 characters); 'A' = 65, 'a' = 97, '0' = 48.
- ISCII: 8-bit, for Indian scripts.
- Unicode: a code for every character of every language; encodings UTF-8 (1–4 bytes, compatible with ASCII), UTF-16, UTF-32 (fixed 4 bytes).
Exam tips#
- Practise 5 conversions of each type; know ASCII of A, a and 0.