Number Systems Quick Reference

Overview of Number Systems

  • A number system is a method of representing numbers using a specific set of symbols and mathematical rules.
  • Computers store and process all data (text, images, sound, video, code, memory addresses) as strings of binary bits (00 and 11).

Classification of Number System Types

Primary Number Systems

  • Decimal Number System (Base 10):

    • Uses ten digits: 0,1,2,3,4,5,6,7,8,90, 1, 2, 3, 4, 5, 6, 7, 8, 9.
    • Used in everyday human life and standard arithmetic.
    • Place values are powers of 1010 (100,101,102,…10^0, 10^1, 10^2, \dots to the left of decimal point; 10−1,10−2,…10^{-1}, 10^{-2}, \dots to the right).
  • Binary Number System (Base 2):

    • Uses two digits: 00 and 11.
    • Forms the foundation of digital systems and electronic computing.
    • Place values are powers of 22 (20,21,22,…2^0, 2^1, 2^2, \dots).
  • Octal Number System (Base 8):

    • Uses eight digits: 0,1,2,3,4,5,6,70, 1, 2, 3, 4, 5, 6, 7.
    • Used in computer programming and Linux/Unix file permissions as a compact binary representation.
    • Place values are powers of 88 (80,81,82,…8^0, 8^1, 8^2, \dots). Each octal digit maps to 33 binary bits.
  • Hexadecimal Number System (Base 16):

    • Uses sixteen symbols: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F0, 1, 2, 3, 4, 5, 6, 7, 8, 9, \text{A}, \text{B}, \text{C}, \text{D}, \text{E}, \text{F}.
    • Letter equivalences: A=10\text{A} = 10, B=11\text{B} = 11, C=12\text{C} = 12, D=13\text{D} = 13, E=14\text{E} = 14, F=15\text{F} = 15.
    • Used for memory addressing and low-level data handling.
    • Place values are powers of 1616 (160,161,162,…16^0, 16^1, 16^2, \dots). Each hex digit maps to 44 binary bits.

Digit Significance and Complements

  • Bit Positions:

    • Most Significant Bit (MSB): Leftmost bit holding the highest place value.
    • Least Significant Bit (LSB): Rightmost bit holding the lowest place value.
  • Decimal Complements:

    • 9's Complement: Subtract each digit of a base-10 number from 9$.\n - **10's Complement**: Add 1 to the LSB of its 9's complement.\n\n- **Binary Complements**:\n - **1's Complement**: Flip all bits (0 \rightarrow 1,,1 \rightarrow 0).\n - **2's Complement**: Add 1 to the LSB of its 1's complement.\n\n# Binary Arithmetic Operations\n\n- **Binary Addition Rules**:\n - 0 + 0 = 0(Carry(Carry0)\n - 0 + 1 = 1(Carry(Carry0)\n - 1 + 0 = 1(Carry(Carry0)\n - 1 + 1 = 0(Carry(Carry1)\n\n- **Binary Subtraction Rules**:\n - 0 - 0 = 0(Borrow(Borrow0)\n - 0 - 1 = 1(Borrow(Borrow1)\n - 1 - 0 = 1(Borrow(Borrow0)\n - 1 - 1 = 0(Borrow(Borrow0)\n\n- **Binary Multiplication Rules**:\n - 0 \times 0 = 0\n - 0 \times 1 = 0\n - 1 \times 0 = 0\n - 1 \times 1 = 1\n\n- **Binary Division**:\n - Executed using long division rules analogous to decimal division.\n\n# Base Conversion Methods\n\n- **Decimal to Target Base (b)**:\n - Divide the decimal number repeatedly by base b.\n - Record remainders until the quotient is 0$.
    • Read remainders in reverse order (bottom to top).
  • Target Base (bb) to Decimal:

    • Multiply each digit by bpb^p, where pp is the position index from right (starting at 0).
    • Sum all resulting products.
  • Binary ↔\leftrightarrow Octal:

    • Binary to Octal: Group binary bits into sets of 33 starting from LSB to MSB; map each group to its octal digit.
    • Octal to Binary: Replace each octal digit with its 33-bit binary equivalent.
  • Binary ↔\leftrightarrow Hexadecimal:

    • Binary to Hexadecimal: Group binary bits into sets of 44 starting from LSB to MSB; map each group to its hexadecimal symbol.
    • Hexadecimal to Binary: Replace each hex symbol with its 44-bit binary equivalent.
  • Octal ↔\leftrightarrow Hexadecimal:

    • Convert through binary as an intermediate step (e.g., Octal →\rightarrow 3-bit Binary →\rightarrow Group by 4 →\rightarrow Hexadecimal).