🔢 Data Representation and Boolean Logic

1. Number Systems

Computers understand data in the form of bits (0s and 1s). The base (or radix) of a number system indicates the number of unique digits it uses.

  • 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 (where A=10, B=11... F=15).

2. Number Conversions

Decimal to Binary: Successive division by 2 and recording the remainders from bottom to top.

Binary to Decimal: Multiplying each bit by its positional weight (powers of 2) and adding them up.

Example: 1011₂ to Decimal = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀

3. Encoding Schemes

Computers use encoding schemes to represent characters (letters, numbers, symbols) as binary numbers.

Standard Codes

ASCII: American Standard Code for Information Interchange. 7-bit code representing 128 characters.

ISCII: Indian Standard Code for Information Interchange. Used for Indian languages.

Unicode: Universal coding scheme. E.g., UTF-8 can represent almost all characters of all human languages.

4. Boolean Logic

A form of algebra where variables can only have two values: True (1) or False (0).

Fundamental Logic Gates

NOT Gate: Inverts the input (A → A').

AND Gate: Output is 1 ONLY if both inputs are 1 (A · B).

OR Gate: Output is 1 if AT LEAST ONE input is 1 (A + B).

De Morgan's Laws: (A+B)' = A'·B' and (A·B)' = A'+B'.