Number Systems & Boolean Algebra
संख्या पद्धतियाँ, कूटन और बूलियन बीजगणित
Bases, conversions and negative numbers
| System | Base | Digits |
|---|---|---|
| binary | 2 | 0, 1 |
| octal | 8 | 0–7 |
| decimal | 10 | 0–9 |
| hexadecimal | 16 | 0–9, A–F |
Conversions
Negative integers — in an n-bit word:
The trap: an 8-bit two's complement word reaches −128 but only +127 — the range is not symmetric.
संख्या पद्धतियाँ, कूटन और बूलियन बीजगणित
Encoding characters — ASCII, ISCII and Unicode
| Code | Width | Covers |
|---|---|---|
| ASCII | 7 bits — 128 characters | English letters, digits, punctuation, control codes |
| ISCII | 8 bits | Indian scripts — adopted as a standard in 1991 |
| Unicode | a code point for every character of every script | Devanagari sits at U+0900 to U+097F |
Values worth knowing in ASCII — 'A' = 65, 'a' = 97, '0' = 48, space = 32; a capital and its small letter differ by 32, a single bit.
Unicode's encodings
Units — 4 bits = a nibble · 8 bits = a byte · 1 KB = 1024 bytes · 1 MB = 1024 KB.
The trap: ASCII is a 7-bit code with 128 characters — the 8-bit 'extended ASCII' tables are vendor additions, not the standard.
संख्या पद्धतियाँ, कूटन और बूलियन बीजगणित
Boolean algebra — the laws and simplification
| Law | OR form | AND form |
|---|---|---|
| identity | A + 0 = A | A · 1 = A |
| null | A + 1 = 1 | A · 0 = 0 |
| idempotent | A + A = A | A · A = A |
| complement | A + A′ = 1 | A · A′ = 0 |
| absorption | A + AB = A | A(A + B) = A |
| distributive | A + BC = (A + B)(A + C) | A(B + C) = AB + AC |
| De Morgan | (A + B)′ = A′B′ | (AB)′ = A′ + B′ |
Simplifying
Universal gates — NAND and NOR can each build every other gate: NOT A is A NAND A; AND is a NAND followed by a NOT.
The trap: the distributive law A + BC = (A + B)(A + C) holds in Boolean algebra but not in ordinary arithmetic — students who refuse it cannot simplify A + A′B.
संख्या पद्धतियाँ, कूटन और बूलियन बीजगणित
Gates, adders and Karnaugh maps
| Gate | Output is 1 when |
|---|---|
| AND | all inputs are 1 |
| OR | any input is 1 |
| NOT | the input is 0 |
| NAND | not all inputs are 1 |
| NOR | all inputs are 0 |
| XOR | the inputs differ — A′B + AB′ |
| XNOR | the inputs are equal |
Adders
Canonical forms — a function can be written as a sum of minterms (SOP) or a product of maxterms (POS).
Karnaugh maps — cells are arranged in Gray code so neighbours differ in one variable; group 1s in blocks of 1, 2, 4 or 8, as large as possible, wrapping round the edges.
The trap: a K-map group must contain a power of two cells — a group of three or six is never allowed.
संख्या पद्धतियाँ, कूटन और बूलियन बीजगणित
Points to Remember