Number System Basics

The four number systems used in computing, and why computers use binary.

Number System Basics

Number System (संख्या पद्धति) किसी संख्या को represent (प्रस्तुत) करने की एक व्यवस्थित विधि है। Computer Science में number systems का विशेष महत्व है क्योंकि computer data को मुख्य रूप से binary digits (0 और 1) के रूप में process और store करता है।

याद रखें: Number System किसी संख्या को लिखने और represent करने की एक निश्चित पद्धति है। Computer में Binary Number System का सबसे अधिक उपयोग होता है।

What is a Number System?

किसी संख्या को represent करने के लिए जिन symbols (प्रतीकों) और rules (नियमों) का उपयोग किया जाता है, उन्हें मिलाकर Number System बनता है। प्रत्येक number system का एक निश्चित base या radix होता है।

उदाहरण के लिए, हम दैनिक जीवन में Decimal Number System का उपयोग करते हैं, जिसका base 10 है। इसमें 0 से 9 तक के दस digits का उपयोग किया जाता है।

Base or Radix

Base (Radix) यह बताता है कि किसी number system में कितने अलग-अलग digits या symbols का उपयोग किया जाता है।

Number System Base Digits Used
Decimal 10 0–9
Binary 2 0, 1
Octal 8 0–7
Hexadecimal 16 0–9, A–F
Important: किसी number system में उपयोग होने वाले digits की संख्या उसके base के बराबर होती है।

Common Number Systems

Computer Science में मुख्य रूप से निम्न चार number systems का अध्ययन किया जाता है:

  1. Decimal Number System
  2. Binary Number System
  3. Octal Number System
  4. Hexadecimal Number System

1. Decimal Number System

Decimal Number System वह number system है जिसका उपयोग हम सामान्य दैनिक गणनाओं में करते हैं। इसका base 10 होता है। इसमें 0 से 9 तक कुल 10 digits का उपयोग किया जाता है।

उदाहरण:

Decimal Numbers: 25, 100, 345, 2026

Decimal number में प्रत्येक digit का positional value उसके position के आधार पर निर्धारित होता है।

उदाहरण के लिए:

345 = 3 × 10² + 4 × 10¹ + 5 × 10⁰

अर्थात:

345 = 3 × 100 + 4 × 10 + 5 × 1
    = 300 + 40 + 5
    = 345

2. Binary Number System

Binary Number System computer का सबसे महत्वपूर्ण number system है। इसका base 2 होता है और इसमें केवल दो digits का उपयोग किया जाता है:

Binary Digits: 0 और 1

Binary number system में प्रत्येक digit को bit (Binary Digit) कहा जाता है।

उदाहरण:

Binary Numbers: 1010, 1101, 1001, 1111

Binary number 1011 का decimal equivalent इस प्रकार निकाला जा सकता है:

1011 = 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰
     = 8 + 0 + 2 + 1
     = 11

इसलिए (1011)2 = (11)10

Why Does Computer Use Binary?

Computer electronic circuits पर आधारित होता है। Electronic circuits में दो अलग-अलग states को आसानी से represent किया जा सकता है, जैसे ON और OFF। इन्हें binary digits 1 और 0 के रूप में represent किया जाता है।

Electronic State Binary Representation
ON 1
OFF 0
याद रखें: Computer binary system का उपयोग करता है क्योंकि electronic circuits में two-state representation को आसानी से implement किया जा सकता है।

3. Octal Number System

Octal Number System का base 8 होता है। इसमें 0 से 7 तक कुल 8 digits का उपयोग किया जाता है।

Octal Digits: 0, 1, 2, 3, 4, 5, 6, 7

Octal system में 8 और उससे बड़ी digit का उपयोग नहीं किया जाता। इसलिए 128 एक valid octal number नहीं है, क्योंकि इसमें digit 8 मौजूद है।

उदाहरण के लिए, octal number 25 को decimal में convert करें:

25 = 2 × 8¹ + 5 × 8⁰
   = 16 + 5
   = 21

इसलिए (25)8 = (21)10

4. Hexadecimal Number System

Hexadecimal Number System का base 16 होता है। इसमें 16 symbols का उपयोग किया जाता है—0 से 9 तक digits और 10 से 15 तक values के लिए A से F तक letters का उपयोग किया जाता है।

Decimal Hexadecimal
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F

उदाहरण:

Hexadecimal Numbers: 1A, 2F, A5, FF

Hexadecimal number 2F का decimal equivalent:

2F = 2 × 16¹ + F × 16⁰
   = 2 × 16 + 15 × 1
   = 32 + 15
   = 47

इसलिए (2F)16 = (47)10

Comparison of Number Systems

Number System Base Digits / Symbols Example
Decimal 10 0–9 125
Binary 2 0, 1 10101
Octal 8 0–7 157
Hexadecimal 16 0–9, A–F 2A

Positional Number System

Decimal, Binary, Octal और Hexadecimal सभी positional number systems हैं। इसमें किसी digit का actual value उसके position और base पर निर्भर करता है।

सामान्य रूप से किसी number को इस प्रकार represent किया जा सकता है:

dₙ × baseⁿ + dₙ₋₁ × baseⁿ⁻¹ + ... + d₁ × base¹ + d₀ × base⁰

उदाहरण के लिए binary number 1101:

1101 = 1 × 2³ + 1 × 2² + 0 × 2¹ + 1 × 2⁰
     = 8 + 4 + 0 + 1
     = 13

Place Value in Number Systems

किसी number system में rightmost digit का positional weight base⁰ होता है। उसके बाद प्रत्येक position का weight base की अगली power से बढ़ता जाता है।

Number System Rightmost Position Next Position Next Position
Decimal 10⁰ 10¹ 10²
Binary 2⁰
Octal 8⁰
Hexadecimal 16⁰ 16¹ 16²

Bit and Byte

Bit का पूरा नाम Binary Digit है। यह computer में data की सबसे छोटी unit है और इसका मान 0 या 1 हो सकता है।

Byte सामान्यतः 8 bits का समूह होता है।

Remember:
1 Bit = 0 या 1
1 Byte = 8 Bits

Binary Representation of Decimal Numbers

Decimal number को binary में बदलने के लिए सामान्यतः repeated division by 2 method का उपयोग किया जाता है।

उदाहरण के लिए decimal number 13 को binary में convert करें:

Division Quotient Remainder
13 ÷ 2 6 1
6 ÷ 2 3 0
3 ÷ 2 1 1
1 ÷ 2 0 1

Remainders को नीचे से ऊपर पढ़ने पर:

(13)10 = (1101)2

Binary to Decimal Conversion

Binary number को decimal में convert करने के लिए प्रत्येक bit को 2 की corresponding power से multiply करके सभी values को add किया जाता है।

उदाहरण:

(10110)₂

= 1 × 2⁴ + 0 × 2³ + 1 × 2² + 1 × 2¹ + 0 × 2⁰
= 16 + 0 + 4 + 2 + 0
= 22
Answer: (10110)₂ = (22)₁₀

Octal and Binary Relationship

Octal और binary number systems के बीच एक महत्वपूर्ण relationship है। क्योंकि 8 = 2³, इसलिए एक octal digit को 3 binary bits से represent किया जा सकता है।

Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111

Hexadecimal and Binary Relationship

Hexadecimal और binary के बीच भी महत्वपूर्ण relationship है क्योंकि 16 = 2⁴। इसलिए एक hexadecimal digit को 4 binary bits से represent किया जा सकता है।

Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111

Example: Hexadecimal to Binary

Hexadecimal number 2A को binary में convert करने के लिए प्रत्येक hexadecimal digit को उसके 4-bit binary equivalent से replace किया जाता है।

2 = 0010
A = 1010

Therefore,

(2A)₁₆ = (00101010)₂

Number System in Computer Programming

Programming और computer systems में number systems का उपयोग data representation, memory addresses, machine-level operations, color codes और अन्य technical applications में किया जाता है।

विशेष रूप से:

  • Binary: Computer's internal data representation में
  • Decimal: Human-readable numerical values में
  • Octal: कुछ computing और legacy systems में
  • Hexadecimal: Memory addresses, machine-level data और color representation आदि में

Number System Representation in C++

C++ में integer literals को अलग-अलग number systems में represent करने के लिए prefixes का उपयोग किया जा सकता है।

#include <iostream>
using namespace std;

int main()
{
    int decimal = 25;
    int binary = 0b11001;
    int octal = 031;
    int hexadecimal = 0x19;

    cout << decimal << endl;
    cout << binary << endl;
    cout << octal << endl;
    cout << hexadecimal << endl;

    return 0;
}
Output:
25
25
25
25

यहाँ अलग-अलग number systems में लिखी गई सभी values का decimal value 25 है।

Important: C++ में binary integer literal के लिए 0b, octal के लिए leading 0 और hexadecimal के लिए 0x prefix का उपयोग किया जाता है।

Important Points

  • Number System किसी संख्या को represent करने की एक पद्धति है।
  • Base या Radix किसी number system में available digits/symbols की संख्या बताता है।
  • Decimal number system का base 10 है।
  • Binary number system का base 2 है।
  • Octal number system का base 8 है।
  • Hexadecimal number system का base 16 है।
  • Binary system में केवल 0 और 1 digits होते हैं।
  • Hexadecimal में A से F तक symbols का उपयोग 10 से 15 के लिए किया जाता है।
  • Bit का अर्थ Binary Digit है।
  • 1 Byte में सामान्यतः 8 Bits होते हैं।
  • Computer internally binary representation का उपयोग करता है।
  • एक octal digit को 3 binary bits से represent किया जा सकता है।
  • एक hexadecimal digit को 4 binary bits से represent किया जा सकता है।

Board Focus

Exam के लिए याद रखें:
Decimal → Base 10 → Digits 0–9
Binary → Base 2 → Digits 0, 1
Octal → Base 8 → Digits 0–7
Hexadecimal → Base 16 → Digits 0–9, A–F
1 Byte → 8 Bits
1 Octal Digit → 3 Binary Bits
1 Hexadecimal Digit → 4 Binary Bits

Board Important Questions

Very Short Answer Questions

Q1. Number System क्या है?

Answer: किसी संख्या को represent करने की व्यवस्थित पद्धति को Number System कहा जाता है।

Q2. Binary Number System का base क्या है?

Answer: Binary Number System का base 2 है।

Q3. Decimal Number System का base क्या है?

Answer: Decimal Number System का base 10 है।

Q4. Octal Number System में कौन-कौन से digits होते हैं?

Answer: Octal Number System में 0 से 7 तक के digits होते हैं।

Q5. Hexadecimal Number System का base क्या है?

Answer: Hexadecimal Number System का base 16 है।

Q6. Bit क्या है?

Answer: Bit का पूरा नाम Binary Digit है और इसका मान 0 या 1 हो सकता है।

Q7. 1 Byte में कितने Bits होते हैं?

Answer: 1 Byte में 8 Bits होते हैं।

Q8. Computer मुख्य रूप से किस number system का उपयोग करता है?

Answer: Computer मुख्य रूप से Binary Number System का उपयोग करता है।

Short Answer Questions

Q9. Binary Number System को समझाइए।

Answer: Binary Number System का base 2 होता है और इसमें केवल 0 तथा 1 digits का उपयोग किया जाता है। Computer electronic circuits की two-state nature के कारण binary system का उपयोग करता है।

Q10. Decimal, Binary, Octal और Hexadecimal Number Systems की तुलना कीजिए।

System Base Digits
Decimal 10 0–9
Binary 2 0, 1
Octal 8 0–7
Hexadecimal 16 0–9, A–F

Q11. Base या Radix क्या है?

Answer: किसी number system में उपयोग किए जाने वाले अलग-अलग digits या symbols की संख्या को उसका Base या Radix कहा जाता है।

Q12. Computer Binary Number System का उपयोग क्यों करता है?

Answer: Computer electronic circuits पर आधारित होता है और circuits में two-state conditions को आसानी से represent किया जा सकता है। इन states को 0 और 1 के रूप में represent किया जाता है।

Long Answer Questions

Q13. Number System के विभिन्न प्रकारों को उदाहरण सहित समझाइए।

Answer: Computer Science में मुख्यतः Decimal, Binary, Octal और Hexadecimal number systems का उपयोग किया जाता है। Decimal का base 10 और digits 0–9 होते हैं। Binary का base 2 और digits 0 तथा 1 होते हैं। Octal का base 8 और digits 0–7 होते हैं। Hexadecimal का base 16 होता है तथा इसमें 0–9 और A–F symbols का उपयोग होता है।

Q14. Binary number (10110)2 को Decimal में convert कीजिए।

(10110)₂
= 1 × 2⁴ + 0 × 2³ + 1 × 2² + 1 × 2¹ + 0 × 2⁰
= 16 + 0 + 4 + 2 + 0
= 22
Answer:
(10110)₂ = (22)₁₀

Q15. Decimal number 13 को Binary में convert कीजिए।

Division Quotient Remainder
13 ÷ 2 6 1
6 ÷ 2 3 0
3 ÷ 2 1 1
1 ÷ 2 0 1
Answer:
(13)₁₀ = (1101)₂

Q16. Hexadecimal number (2F)16 को Decimal में convert कीजिए।

(2F)₁₆
= 2 × 16¹ + F × 16⁰
= 2 × 16 + 15 × 1
= 32 + 15
= 47
Answer:
(2F)₁₆ = (47)₁₀

Quick Revision

  • Number System: Numbers को represent करने की पद्धति
  • Base: Number system में digits/symbols की संख्या
  • Decimal: Base 10
  • Binary: Base 2
  • Octal: Base 8
  • Hexadecimal: Base 16
  • Bit: Binary Digit
  • Byte: 8 Bits
  • Octal Digit: 3 Binary Bits
  • Hexadecimal Digit: 4 Binary Bits
One-Line Revision: Computer Science में Decimal, Binary, Octal और Hexadecimal प्रमुख number systems हैं, जिनके bases क्रमशः 10, 2, 8 और 16 होते हैं।

Practice Questions

  1. Number System की परिभाषा लिखिए।
  2. Base या Radix क्या है?
  3. Decimal Number System की विशेषताएँ लिखिए।
  4. Binary Number System क्या है?
  5. Computer Binary Number System का उपयोग क्यों करता है?
  6. Octal Number System में कौन-कौन से digits होते हैं?
  7. Hexadecimal Number System में A से F तक के symbols किन values को represent करते हैं?
  8. Decimal number 25 को Binary में convert कीजिए।
  9. Binary number 10101 को Decimal में convert कीजिए।
  10. Decimal number 25 को Octal में convert कीजिए।
  11. Octal number 35 को Decimal में convert कीजिए।
  12. Hexadecimal number 2A को Decimal में convert कीजिए।
  13. Decimal number 47 को Hexadecimal में convert कीजिए।
  14. एक Octal digit कितने Binary bits के बराबर होता है?
  15. एक Hexadecimal digit कितने Binary bits के बराबर होता है?
  16. Bit और Byte में अंतर बताइए।
  17. Decimal, Binary, Octal और Hexadecimal number systems की तुलना कीजिए।
  18. C++ में Binary, Octal और Hexadecimal integer literals के prefixes लिखिए।
Lesson 32 of 39
On This Page