Exhaustive Study Notes on Number Systems, Base Conversions, and Binary Arithmetic
Overview of Number Systems & Hardware Logic
Primary Objectives:
- Understand the principles and foundational mathematics of number systems.
- Understand why computer systems operate using the binary (Base-2) system.
- Master positional notation across Base-2, Base-8, Base-10, and Base-16.
- Master conversion methodologies among all four bases.
Hardware Rationale for Binary Usage:
- Modern computers are built from electronic switches.
- Each physical switch operates in one of two discrete states: ON or OFF.
- Numerical mapping of switch states:
- Logic represents the ON state.
- Logic represents the OFF state.
- Electrical voltage levels in digital logic circuits:
- Logic corresponds to .
- Logic corresponds to either or .
Taxonomy of Common Number Systems
Characteristics of Standard Bases:
- Binary: Base , designated by symbol
B. Uses digits . Utilized directly by computer hardware, not typically used by humans. - Octal: Base , designated by symbol
O. Uses digits . Serves as a human-readable shorthand representation for binary; not used directly by computers or in general human communication. - Decimal: Base , designated by symbol
D. Uses digits . Used universally by humans, not used natively by computer hardware. - Hexadecimal: Base , designated by symbol
H. Uses digits , where letters represent values through (, , , , , ). Serves as a compact human-readable shorthand for binary strings; not native to computer hardware.
- Binary: Base , designated by symbol
Counting Equivalence Across Number Systems ( to Decimal):
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
- Decimal = Binary = Octal = Hexadecimal
Positional Weight & Base Mechanics
Positional Weight Structure (Base-10 Model):
- Digits located to the left of the radix (decimal) point represent values between zero and nine multiplied by increasing non-negative powers of ten ().
- Digits located to the right of the radix point represent values between zero and nine multiplied by increasing negative powers of ten ().
- Place values and positional weights:
- Thousands:
- Hundreds:
- Tens:
- Ones:
- Tenths:
- Hundredths:
- Thousandths:
Fully Expanded Decimal Examples:
- Example 1 ():
- Example 2 ():
Detailed Base Conversions & Worked Examples
Binary to Decimal Conversion:
- Method: Multiply each binary digit by , where is the position weight starting from on the rightmost bit, and calculate the sum of all terms.
- Example 1 ():
- Term 0:
- Term 1:
- Term 2:
- Term 3:
- Term 4:
- Sum:
- Example 2 ():
- Bit 0 (weight ):
- Bit 1 (weight ):
- Bit 2 (weight ):
- Bit 3 (weight ):
- Bit 4 (weight ):
- Bit 5 (weight ):
- Sum:
- Example 3 ():
- Expansion:
- Sum:
Octal to Decimal Conversion:
- Method: Multiply each octal digit by , where is the position weight starting from on the rightmost digit, and add all term values.
- Positional Placeholders for Octal System:
- For an octal value like :
- "Sixty-Fours" position ():
- "Eights" position ():
- "Ones" position ():
- Example ():
- Digit 4 (weight ):
- Digit 2 (weight ):
- Digit 7 (weight ):
- Sum:
Hexadecimal to Decimal Conversion:
- Method: Multiply each hexadecimal digit by , where is the position weight starting from on the rightmost digit, and sum the results. Replace letter symbols with decimal values ().
- Example ():
- Digit (, weight ):
- Digit (, weight ):
- Digit (, weight ):
- Sum:
Decimal to Binary Conversion:
- Method (Repeated Division by ):
- Divide the decimal integer by 2$.\n * Record the remainder (010 (Least Significant Bit - LSB).\n * Divide the resulting quotient by 2 again, recording the remainder.\n * Repeat until the quotient reaches 0$.
- Write the binary string starting from the last remainder generated (Most Significant Bit - MSB) on the left to the first remainder (LSB) on the right.
- Example 1 (Convert to binary):
- (LSB)
- (MSB)
- Result:
- Example 2 (Convert to binary):
- (LSB)
- (MSB)
- Result:
Octal to Binary Conversion:
- Method: Convert each octal digit directly into its equivalent 3-bit binary group.
- Example (Convert to binary):
- Digit
- Digit
- Digit
- Result:
Hexadecimal to Binary Conversion:
- Method: Convert each hexadecimal digit directly into its equivalent 4-bit binary group.
- Example (Convert to binary):
- Digit
- Digit
- Digit
- Digit
- Result:
Decimal to Octal Conversion:
- Method (Repeated Division by ):
- Divide the decimal integer by and record the remainder.
- Continue dividing quotients by until the quotient is 0$.\n * Read remainders from bottom (MSB) to top (LSB).\n * Example 1 (Convert 1234_{10} to octal):\n * 1234 \div 8 = 154\text{ remainder } 2\n * 154 \div 8 = 19\text{ remainder } 2\n * 19 \div 8 = 2\text{ remainder } 3\n * 2 \div 8 = 0\text{ remainder } 2\n * Result: 1234_{10} = 2322_8\n * Example 2 (Convert 44978_{10} to octal):\n * 44978 \div 8 = 5622\text{ remainder } 2\n * 5622 \div 8 = 702\text{ remainder } 6\n * 702 \div 8 = 87\text{ remainder } 6\n * 87 \div 8 = 10\text{ remainder } 7\n * 10 \div 8 = 1\text{ remainder } 2\n * 1 \div 8 = 0\text{ remainder } 1\n * Result: 44978_{10} = 127662_8\n\n* Decimal to Hexadecimal Conversion:\n * Method (Repeated Division by 16):\n * Divide the decimal number by 16 and record the remainder.\n * Replace remainders 1015AF$.
- Repeat until quotient is . Read remainders from bottom to top.
- Example (Convert to hexadecimal):
- Result:
Binary to Octal Conversion:
- Method: Group binary bits into sets of three starting from the rightmost bit (LSB). Convert each 3-bit group to its octal digit.
- Example (Convert to octal):
- Bit grouping from right:
- Group conversions:
- Result:
Binary to Hexadecimal Conversion:
- Method: Group binary bits into sets of four starting from the rightmost bit (LSB). Convert each 4-bit group to its hexadecimal digit.
- Example (Convert to hexadecimal):
- Bit grouping from right:
- Group conversions:
- ()
- ()
- Result:
Octal to Hexadecimal Conversion:
- Method: Use binary as an intermediary base:
- Convert octal digits into 3-bit binary groups.
- Regroup the resulting binary string into 4-bit groups starting from the right.
- Convert each 4-bit group into its hexadecimal digit.
- Example (Convert to hexadecimal):
- Step 1 (Octal to 3-bit Binary):
- Combined binary:
- Step 2 (Regroup into 4-bit groups):
- Step 3 (4-bit Binary to Hex):
- Result:
Hexadecimal to Octal Conversion:
- Method: Use binary as an intermediary base:
- Convert hexadecimal digits into 4-bit binary groups.
- Regroup the resulting binary string into 3-bit groups starting from the right.
- Convert each 3-bit group into its octal digit.
- Example (Convert to octal):
- Step 1 (Hex to 4-bit Binary):
- Combined binary:
- Step 2 (Regroup into 3-bit groups from right):
- Step 3 (3-bit Binary to Octal):
- Result:
Comprehensive Conversion Reference Table:
- Decimal | Binary | Octal | Hexadecimal
- Decimal | Binary | Octal | Hexadecimal
- Decimal | Binary | Octal | Hexadecimal
- Decimal | Binary | Octal | Hexadecimal
- Decimal | Binary | Octal | Hexadecimal
Binary Arithmetic Operations
Binary Addition Fundamentals:
- Basic 1-bit Addition Rules:
- ( sum with a carry of to the next higher bit position)
- Carry Comparison with Decimal:
- Decimal (Base-10):
- Binary (Base-2):
- Procedure for Multi-bit (-bit) Binary Addition:
- Align numbers by position starting at LSB.
- Add bits column by column.
- Whenever a column sum is (), record in that column and propagate a carry of to the left column.
- Whenever a column sum is ( from carry), record in that column and propagate a carry of to the left column.
- Worked Example ():
- Value 1:
- Value 2:
- Column addition steps:
- Column 0 (LSB): , carry
- Column 1:
- Column 2:
- Column 3:
- Column 4: , carry
- Column 5:
- Sum:
Practice Arithmetic Exercises:
- Addition Problems:
- Subtraction Problems:
Binary Multiplication Mechanics:
- Decimal Comparison ():
- Total Sum:
- Single-bit Binary Multiplication Rules:
- Multi-bit Binary Multiplication Steps:
- Multiply multiplicand by each bit of the multiplier to form partial products.
- Shift each successive partial product one bit to the left.
- Add all partial products together using binary addition.
- Worked Example ():
- Multiplicand: ()
- Multiplier: ()
- Partial Products:
- Bit 0 ():
- Bit 1 ():
- Bit 2 ():
- Bit 3 ():
- Summing Partial Products:
- ()
Fractional Number Representation & Conversions
Fractional Expansion in Decimal:
- Example ():
- Sum:
Binary Fractional Conversion to Decimal:
- Method:
- For digits left of binary point, multiply by positive powers of two ().
- For digits right of binary point, multiply by negative powers of two ().
- Negative powers of two equivalents:
- Worked Example (Convert to decimal):
- Integer Part ():
- Fractional Part ():
- Sum of all terms: