⚡0 XP🔥0

Ch 3 · Number Systems and Encoding | संख्या पद्धति और एन्कोडिंग

Lesson 3 of 11 ⏱ 3 min read ❓ 5-question quiz ▶ Runs Python

Binary, octal, decimal and hexadecimal number systems, conversions between them, and encoding schemes - ASCII, ISCII and Unicode (UTF-8, UTF-32).

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
Ctrl + Enter to run
हिंदी में समझें

दशमलव संख्या को किसी आधार में बदलने के लिए बार-बार उस आधार से भाग देकर शेषफल नीचे से ऊपर पढ़ें। बाइनरी से ऑक्टल के लिए 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.

Quick Quiz

Q1.

Binary of decimal 10 is

Q2.

Hexadecimal uses base

Q3.

Decimal value of 1111₂ is

Q4.

ASCII code of 'A' is

Q5.

Encoding that covers all world scripts is