Topics

  • Number Systems:
    • Binary, Octal, Decimal, and Hexadecimal number systems.
    • Complements of numbers (1’s complement, 2’s complement).
    • Weighted and Non-weighted codes (BCD, Gray code, Excess-3 code).
  • Boolean Algebra:
    • Basic theorems and properties.
    • Switching functions: Canonical (SOP, POS) and Standard forms.
    • Algebraic simplification of Boolean expressions.
  • Digital Logic Gates:
    • AND, OR, NOT, NAND, NOR, XOR, XNOR gates.
    • Universal gates (NAND, NOR).
    • Multilevel NAND/NOR realizations.

Number Systems in Digital Electronics

In digital electronics, number systems are used to represent and manipulate numerical data. The most common number systems include:

  1. Binary (Base-2)
  2. Octal (Base-8)
  3. Decimal (Base-10)
  4. Hexadecimal (Base-16)

Each system has a different base (radix) and is used in different computing applications.


1. Binary Number System (Base-2)

  • Uses only two digits: 0 and 1.
  • Fundamental system in digital circuits (since computers work with ON/OFF states).
  • Each digit is called a bit (Binary Digit).
  • Example:

Applications:

  • Used in processors, memory, and digital logic circuits.

2. Octal Number System (Base-8)

  • Uses 8 digits: 0 to 7.
  • Convenient for representing 3-bit binary numbers (since ).
  • Example:

Applications:

  • Early computing systems (now less common).
  • Sometimes used in file permissions (Unix/Linux).

3. Decimal Number System (Base-10)

  • Uses 10 digits: 0 to 9.
  • The standard system for human counting.
  • Example:

Applications:

  • Everyday arithmetic, financial calculations.

4. Hexadecimal Number System (Base-16)

  • Uses 16 digits: 0 to 9 and A (10), B (11), C (12), D (13), E (14), F (15).
  • Represents 4-bit binary numbers compactly (since ).
  • Example:

Applications:

  • Memory addressing, color codes (HTML/CSS), assembly language.

Conversion Between Number Systems

Conversion TypeMethod
Binary ↔ DecimalUse weighted positional expansion (powers of 2).
Octal ↔ BinaryGroup 3 bits per octal digit.
Hexadecimal ↔ BinaryGroup 4 bits per hex digit.
Decimal ↔ BinaryRepeated division by 2 (for integer part).
Decimal ↔ Hex/OctalDivide by 16/8 and collect remainders.

Example Conversions

  1. Binary to Decimal:

  2. Decimal to Binary:
    (Remainder 1)
    (Remainder 0)
    (Remainder 0)
    (Remainder 1)
    (Remainder 1)
    Read backwards:

  3. Binary to Hexadecimal:
    → Group into 4 bits:

  4. Hexadecimal to Binary:
    ,


Summary Table

Number SystemBaseDigitsBinary GroupingExample
Binary20,1-
Octal80-73 bits
Decimal100-9-
Hexadecimal160-9, A-F4 bits

Why Different Number Systems?

  • Binary: Used by computers (simplest for digital logic).
  • Octal/Hex: Compact representation of binary (easier for humans).
  • Decimal: Natural for human counting.

CC

Weighted and Non-Weighted Codes in Digital Electronics

In digital systems, binary codes are used to represent numbers, letters, or symbols. These codes can be classified into two main categories:

  1. Weighted Codes
  2. Non-Weighted Codes

Each type has different properties and applications in digital circuits and computing.


1. Weighted Codes

  • Each bit position has a specific weight (like in traditional binary numbers).
  • The decimal equivalent is obtained by summing the weighted bits.
  • Examples:
    • Binary Coded Decimal (BCD)
    • 8421 Code
    • 2421 Code
    • Excess-3 Code (XS-3) (partially weighted but has a bias)

(a) Binary Coded Decimal (BCD)

  • A 4-bit code where each decimal digit (0-9) is represented by its 4-bit binary equivalent.
  • Weights: 8, 4, 2, 1 (like standard binary).
  • Invalid codes: 1010 (10) to 1111 (15) are unused.
DecimalBCD (8421)
00000
10001
91001

Example:
in BCD → 0101 0011 (5 = 0101, 3 = 0011)

Applications:

  • Digital displays (7-segment LEDs).
  • Financial and calculator systems.

(b) 2421 Code

  • A self-complementing weighted code (9’s complement can be obtained by inverting bits).
  • Weights: 2, 4, 2, 1.
  • Example:
    (since )

Applications:

  • Used in some arithmetic circuits.

2. Non-Weighted Codes

  • No positional weights are assigned to bits.
  • Used for error detection, sequencing, and encoding.
  • Examples:
    • Gray Code (Reflected Binary Code)
    • Excess-3 Code (XS-3) (has a fixed bias but is non-weighted in structure)

(a) Gray Code

  • Only one bit changes between consecutive numbers.
  • Prevents glitches in digital circuits (e.g., encoders, Karnaugh maps).
DecimalBinaryGray Code
000000000
100010001
200100011
300110010

Conversion (Binary → Gray):

  1. MSB remains the same.
  2. XOR each bit with the next higher bit.

Example:
Binary: → Gray:


  • Gray Code = 1111

Applications:

  • Rotary encoders (position sensing).
  • Error correction in digital communication.

(b) Excess-3 Code (XS-3)

  • A biased code where each digit is represented by BCD + 3.
  • Non-weighted but derived from BCD.
  • Self-complementing (9’s complement is obtained by inverting bits).
DecimalBCD (8421)Excess-3
000000011
100010100
910011100

Example:
in XS-3 → BCD (0101) + 3 (0011) = 1000

Applications:

  • Older computing systems.
  • Some arithmetic operations (simplifies subtraction).

Comparison: Weighted vs. Non-Weighted Codes

FeatureWeighted Codes (BCD, 8421)Non-Weighted Codes (Gray, XS-3)
Bit Position WeightYes (e.g., 8-4-2-1)No
Arithmetic UseCommon (e.g., BCD adders)Rare (except XS-3)
Error DetectionNoYes (Gray code reduces glitches)
Sequential ChangesMultiple bits may changeOnly one bit changes (Gray)

Key Takeaways

  • Weighted Codes (BCD, 8421, 2421) → Used in arithmetic operations.
  • Non-Weighted Codes (Gray, XS-3) → Used in sequencing, error detection.
  • Gray Code → Prevents glitches in digital transitions.
  • Excess-3 → Simplifies subtraction in some cases.

Boolean Algebra in Digital Electronics

Boolean algebra is the mathematical foundation of digital logic circuits. It deals with binary variables (0 and 1) and logical operations (AND, OR, NOT). Below is a structured breakdown of key concepts:


Basic Theorems and Properties

Boolean algebra follows fundamental laws similar to conventional algebra but with binary operations.

(a) Fundamental Operations

OperationSymbolExpression
AND or none
OR
NOT or

(b) Boolean Postulates

  1. Identity Law
  2. Null Law
  3. Idempotent Law
  4. Inverse Law
  5. Commutative Law
  6. Associative Law
  7. Distributive Law
  8. De Morgan’s Theorem

(c) Duality Principle

  • Any Boolean expression remains valid if:
    • and are swapped.
    • and are swapped.

Example:
→ Dual is .


Switching functions: Canonical (SOP, POS) and Standard forms

1. Switching Functions

A switching function is a Boolean expression that defines the output of a digital circuit based on its input variables. It can be represented as:

Example:


2. Canonical Forms

Canonical forms are unique and standardized ways of representing Boolean functions using minterms (for SOP) or maxterms (for POS).

(a) Sum of Products (SOP) Form (Minterm Canonical Form)

  • Represents a function as a sum (OR) of minterms (AND terms).
  • A minterm is a product term where all variables appear exactly once (either in true or complemented form).
  • Each minterm corresponds to a row in the truth table where the output is 1.

Example:

Consider a function with the truth table:

ABF
001
010
101
111

The SOP form is: (OR of all minterms where )

Minterm Notation:

(where )


(b) Product of Sums (POS) Form (Maxterm Canonical Form)

  • Represents a function as a product (AND) of maxterms (OR terms).
  • A maxterm is a sum term where all variables appear exactly once (either true or complemented).
  • Each maxterm corresponds to a row in the truth table where the output is 0.

Example:

Using the same truth table as above:

ABF
001
010
101
111

The POS form is: (Only one maxterm where , i.e., )

Maxterm Notation:


3. Standard Forms

Standard forms are simplified versions of canonical forms where not all variables need to appear in every term.

(a) Standard SOP Form
  • A simplified version of the canonical SOP.
  • Each product term may not contain all variables.

Example:
(Not all terms have all variables.)

(b) Standard POS Form
  • A simplified version of the canonical POS.
  • Each sum term may not contain all variables.

Example:
(Not all terms have all variables.)


Key Differences: Canonical vs. Standard Forms

FeatureCanonical FormStandard Form
UniquenessUnique for a given truth tableNot unique (multiple possible forms)
CompletenessAll variables appear in every termSome variables may be missing
ComplexityMore complex (more terms)Simplified (fewer terms)

3. Algebraic Simplification of Boolean Expressions

Simplification reduces the number of logic gates required in a circuit.

(a) Techniques

  1. Using Boolean Theorems

    • Apply Distributive, De Morgan’s, and Identity Laws.
    • Example:
  2. Consensus Theorem

  3. Karnaugh Maps (K-Maps) (Graphical method for 2-6 variables).

(b) Example Simplifications

  1. Simplify

    • (since )
    • (Absorption Law)
  2. Simplify

    • (Distributive Law)

Summary Table

ConceptKey Points
Boolean TheoremsIdentity, Null, Distributive, De Morgan’s Laws.
Canonical FormsSOP (minterms), POS (maxterms).
Standard FormsSimplified SOP/POS.
SimplificationBoolean algebra rules, K-Maps.

Applications

  • Logic gate minimization (fewer transistors, lower power).
  • Digital circuit design (adders, multiplexers).
  • Error detection and correction.

Digital Logic Gates: Fundamentals and Applications

Logic gates are the basic building blocks of digital circuits. They perform Boolean operations on binary inputs (0 and 1) to produce a single output. Below is a detailed breakdown of logic gates, universal gates, and their implementations.

1. Basic Logic Gates

(a) AND Gate

  • Truth Table:
ABY = A·B
000
010
100
111
  • Function: Output is 1 only if all inputs are 1.

(b) OR Gate

  • Truth Table:
ABY = A+B
000
011
101
111
  • Function: Output is 1 if at least one input is 1.

(c) NOT Gate (Inverter)

  • Truth Table:
AY = A’
01
10
  • Function: Output is the complement of the input.

(d) NAND Gate (NOT-AND)

  • Truth Table:
ABY = (A·B)‘
001
011
101
110
  • Function: Output is 0 only if all inputs are 1.

(e) NOR Gate (NOT-OR)

  • Truth Table:
ABY = (A+B)‘
001
010
100
110
  • Function: Output is 1 only if all inputs are 0.

(f) XOR Gate (Exclusive-OR)

  • Truth Table:
ABY = A⊕B
000
011
101
110
  • Function: Output is 1 if inputs are different.

(g) XNOR Gate (Exclusive-NOR)

  • Truth Table:
ABY = A⊙B
001
010
100
111
  • Function: Output is 1 if inputs are the same.

2. Universal Gates

Universal gates can implement any Boolean function without needing other gates. The two universal gates are:

(a) NAND Gate as Universal

  • Can implement NOT, AND, OR:
    • NOT: A NAND A = A'
    • AND: (A NAND B) NAND (A NAND B) = A·B
    • OR: (A NAND A) NAND (B NAND B) = A+B

(b) NOR Gate as Universal

  • Can implement NOT, AND, OR:
    • NOT: A NOR A = A'
    • OR: (A NOR B) NOR (A NOR B) = A+B
    • AND: (A NOR A) NOR (B NOR B) = A·B

3. Multilevel NAND/NOR Realizations

(a) NAND-NAND Realization (SOP Form)

  • Convert Sum of Products (SOP) to NAND gates only.
  • Example:
    → Implement as:
    AB → NAND + NAND (invert twice)  
    CD → NAND + NAND  
    Final OR → NAND (De Morgan’s Law)  
    

(b) NOR-NOR Realization (POS Form)

  • Convert Product of Sums (POS) to NOR gates only.
  • Example:
    → Implement as:
    A+B → NOR + NOR (invert twice)  
    C+D → NOR + NOR  
    Final AND → NOR (De Morgan’s Law)  
    

Summary Table

GateFunctionUniversal?
ANDA·BNo
ORA+BNo
NOTA’No
NAND(A·B)‘Yes
NOR(A+B)‘Yes
XORA⊕BNo
XNORA⊙BNo

Applications

  • NAND/NOR: Used in IC design (simplifies fabrication).
  • XOR: Used in adders, parity checkers, cryptography.
  • Universal Gates: Help in minimizing circuit cost.