πŸ“‘ Master Conversions Cheatsheet: Digital Codes & Canonical Forms

Purpose

This cheatsheet serves as a high-yield, quick-reference guide for all digital code conversions, error control systems, and algebraic canonical transformations. It is designed to be fully compatible with Obsidian reading and editing views.


1. Binary Coded Decimal (8421 BCD) Conversions

1.1 Decimal BCD

  • Decimal to BCD: Directly replace each individual decimal digit with its equivalent 4-bit binary nibble [3].
  • BCD to Decimal: Partition the binary string into 4-bit groups (starting from the LSB) and translate each group into its decimal digit [3].

Decimal BCD Conversion

  • [3]

1.2 BCD Addition Algorithm

  1. Add the two BCD values using standard binary addition [4].
  2. For each 4-bit sum nibble:
    • If Sum and no carry is generated: The nibble is valid [4].
    • If Sum OR a carry is generated: Add a correction factor of to that nibble [4]. This skips the 6 invalid states ( to ) [4, 8]. Propagate any resulting carry to the next higher-order nibble [4].

BCD Addition (Correction Required)

Add and : Final BCD: [5].


2. Excess-3 (XS-3) Code Conversions

2.1 Decimal Excess-3

  • Decimal to Excess-3: Add to the decimal digit , then convert the result into a 4-bit binary representation [17].
  • Excess-3 to Decimal: Convert the 4-bit group into decimal and subtract [13, 17].

Decimal Excess-3 Conversion

  • [17].

2.2 Excess-3 Addition Algorithm

  1. Perform standard binary addition on the two Excess-3 digits. Since both numbers contain an offset of , the raw sum contains an offset of [19].
  2. For each sum nibble:
    • If a carry is generated (Sum ): Add to restore the correct offset [19].
    • If NO carry is generated (Sum ): Subtract (or add ) [19].

Excess-3 Addition (No Carry)

Add and in Excess-3: [20].


3. Weighted 4-Bit Code Conversions

Weighted codes represent a decimal value by multiplying each bit by its assigned positional weight [7]:

3.1 Major Weighted Codes Reference Table

Decimal Digit8421 (BCD) [7]2421 [7]5211 [7]84-2-1 [7]
00000000000000000
10001000100010111
20010001000110110
30011001101000101
40100010001010100
50101101110001011
60110110010011010
70111110110111001
81000111011001000
91001111111111111

3.2 Conversion Example: to 5211 Weighted Code

To convert, translate each decimal digit independently using the weighted positional rules:

  1. Digit 6: [11].
  2. Digit 0: [11].
  3. Digit 5: [11].
  • Result: [11, 12].

4. Reflected (Gray) Code Conversions

4.1 Binary Gray

  1. Keep the Most Significant Bit (MSB) identical [31]:
  2. XOR each subsequent binary bit with the binary bit immediately to its left [31]:
Binary:  B3 -------> B2 -------> B1 -------> B0
         |           |           |           |
         |           XOR         XOR         XOR
         v           v           v           v
Gray:    G3          G2          G1          G0

Binary to Gray Conversion (1011 to Gray)

  • Result: [32].

4.2 Gray Binary

  1. Keep the MSB identical [32]:
  2. XOR the previously calculated binary bit with the next incoming Gray code bit [32]:

Gray to Binary Conversion (1110 to Binary)

  • Result: [33].

7. Standard Canonical Boolean Conversions

  • Canonical Form: Every term contains all domain variables exactly once [67].
  • SOP Canonical Expansion Rule: Multiply each non-canonical product term by for every missing variable [74].
  • POS Canonical Expansion Rule: Add to each non-canonical sum term for every missing variable , then expand via distribution: [74].

SOP & POS Canonical Conversion

Convert into Maxterms () and Minterms ():

  1. Term 1 is missing :
  2. Term 2 is missing and : Expand using distribution into 4 maxterms:
  • Product of Maxterms: [76].
  • Sum of Minterms: Minterm indices are the remaining states (0 to 15):