Digital Logic Systems

Digital Logic Systems Unit 1: Fundamental Concepts

Digital Logic Systems Unit 1: Fundamental Concepts

High-Yield Revision Hub

Master Digital Logic Systems Unit 1: Fundamental Concepts

Study number systems, base conversions, signed representations, fixed/floating-point formats, binary codes, basic logic gates, and Boolean postulates/theorems.

Concept Breakdown

Detailed technical explanation

Unit 1: Fundamental Concepts

This unit covers the foundational building blocks of digital systems: number systems, data representation, binary arithmetic, binary codes, basic logic gates, and the postulates/theorems of Boolean algebra.


1. Number Systems and Base Conversions

Digital systems process binary data (00 and 11). However, humans use decimal, and programmers often use octal or hexadecimal for brevity. A number system with base (or radix) rr uses rr unique symbols.

Number SystemRadix (rr)Allowed Digits / SymbolsExample
Binary220,10, 11011.0121011.01_2
Octal880,1,2,3,4,5,6,70, 1, 2, 3, 4, 5, 6, 774.5874.5_8
Decimal10100,1,2,3,4,5,6,7,8,90, 1, 2, 3, 4, 5, 6, 7, 8, 998.61098.6_{10}
Hexadecimal16160-90\text{-}9, A(10),B(11),C(12),D(13),E(14),F(15)\text{A}(10), \text{B}(11), \text{C}(12), \text{D}(13), \text{E}(14), \text{F}(15)3A.C163\text{A}.\text{C}_{16}

1.1 Base Conversions

  1. Any Base to Decimal: Sum the digits multiplied by their positional weight rir^i. Value=i=mn1diri\text{Value} = \sum_{i=-m}^{n-1} d_i \cdot r^i Example: 101.112=(122)+(021)+(120)+(121)+(122)=4+0+1+0.5+0.25=5.7510101.11_2 = (1 \cdot 2^2) + (0 \cdot 2^1) + (1 \cdot 2^0) + (1 \cdot 2^{-1}) + (1 \cdot 2^{-2}) = 4 + 0 + 1 + 0.5 + 0.25 = 5.75_{10}.
  2. Decimal to Any Base:
    • Integer part: Successive division by target base rr, collecting remainders from bottom to top (LSB to MSB).
    • Fractional part: Successive multiplication by target base rr, collecting integer carries from top to bottom.
  3. Binary \leftrightarrow Octal / Hexadecimal: Group binary bits in sets of 33 (for octal) or 44 (for hex) starting from the radix point, moving left for integers and right for fractions. Pad with zeros if necessary.

2. Signed Number Representations

In digital hardware, negative numbers are represented using binary signs. There are three primary formats for representing signed integers using nn bits:

2.1 Sign and Magnitude (SM)

  • MSB (Most Significant Bit): 00 for positive (++), 11 for negative (-).
  • Remaining n1n-1 bits: Represent the absolute magnitude of the number.
  • Range: (2n11)-(2^{n-1} - 1) to +(2n11)+(2^{n-1} - 1).
  • Pitfall: Dual representation of zero (+0=000...0+0 = 000...0, 0=100...0-0 = 100...0), which complicates ALU design.

2.2 1's Complement Notation

  • Positive Numbers: Same as sign-magnitude with MSB = 00.
  • Negative Numbers: Obtained by bitwise inverting (NOT operation) all bits of the positive counterpart.
  • Range: (2n11)-(2^{n-1} - 1) to +(2n11)+(2^{n-1} - 1).
  • Pitfall: Still has dual representation of zero (+0=000...0+0 = 000...0, 0=111...1-0 = 111...1).

2.3 2's Complement Notation (Standard in Modern ALUs)

  • Positive Numbers: Same as sign-magnitude with MSB = 00.
  • Negative Numbers: Obtained by adding 11 to the 1's complement of the number: 2’s Complement=1’s Complement+1\text{2's Complement} = \text{1's Complement} + 1
  • Range: 2n1-2^{n-1} to +(2n11)+(2^{n-1} - 1).
  • Advantages:
    • Unique representation of zero (000...0000...0).
    • Simple subtraction: ABA - B is computed as A+(B)A + (-B) using the same adder hardware.
Decimal (for n=4n=4)Sign-Magnitude1's Complement2's Complement
+7+7011101110111011101110111
+0+0000000000000000000000000
0-01000100011111111N/A
7-7111111111000100010011001
8-8N/AN/A10001000

3. Fixed-Point vs. Floating-Point Representation

  • Fixed-Point: The position of the binary point is pre-determined (usually at the end for integers, or after the MSB for fractions).
    • Simple hardware, limited range, fixed precision.
  • Floating-Point: Represents numbers as ±M×rE\pm M \times r^E, where MM is the mantissa, rr is the base, and EE is the exponent. Standardized by IEEE 754 (Single Precision: 32-bit, Double Precision: 64-bit).
    • High dynamic range, complex hardware, variable precision.

4. Binary Codes

4.1 Classification of Codes

  1. Weighted Codes: Each bit position has a specific weight.
    • Examples: BCD (8421), 2421, 84-2-1.
  2. Non-Weighted Codes: Position has no arithmetic weight.
    • Examples: Excess-3, Gray Code.
  3. Self-Complementing Codes: A code where the 1's complement of a codeword represents the 9's complement of its decimal digit.
    • Examples: Excess-3, 2421. (Note: 8421 BCD is not self-complementing).
  4. Reflected/Unit-Distance Codes: Only one bit changes between consecutive numbers.
    • Example: Gray Code. Essential for reducing glitches in mechanical shafts and asynchronous transitions.

4.2 Gray Code Conversions

  • Binary to Gray:
    • Gn1=Bn1G_{n-1} = B_{n-1} (Keep MSB)
    • Gi=Bi+1BiG_i = B_{i+1} \oplus B_i for i<n1i < n-1
  • Gray to Binary:
    • Bn1=Gn1B_{n-1} = G_{n-1} (Keep MSB)
    • Bi=Bi+1GiB_i = B_{i+1} \oplus G_i for i<n1i < n-1

4.3 BCD Addition Rule

If the sum of two BCD digits is greater than 99 (100121001_2) or if a carry is generated from the digit position:

  • Add 66 (011020110_2) to that digit group to skip the 6 invalid states (10101010 to 11111111), and propagate the carry to the next higher digit.

5. Basic Logic Gates

Logic gates are physical electronic devices implementing Boolean functions.

AND OR NOT +-----+ +-----+ +---+ A ---| \ A ---\ \ | | | & )--- Y | \ )--- Y A -----| >o|--- Y B ---| / B ---/ / | | +-----+ +-----+ +---+ Y = A • B Y = A + B Y = A' NAND NOR XOR +-----+o +-----+o +---+ A ---| \ A ---\ \ A | \ \ | & )--- Y | \ )--- Y | | )--- Y B ---| / B ---/ / B | / / +-----+o +-----+o +---+ Y = (A • B)' Y = (A + B)' Y = A ⊕ B = AB'+A'B

5.1 Universal Gates

NAND and NOR are universal gates because any Boolean expression can be realized using only NAND or only NOR gates.

  • Minimum gates for standard functions:
Target FunctionNAND Gate CountNOR Gate Count
NOT1111
AND2233
OR3322
XOR4455
XNOR5544

6. Boolean Algebra: Postulates & Theorems

Boolean algebra operates on a set 0,1{0, 1} with operators ++ (OR), \cdot (AND), and ' (NOT).

6.1 Huntington's Postulates

  1. Closure: For any a,bBa, b \in B, a+bBa+b \in B and abBa \cdot b \in B.
  2. Identity: a+0=aa + 0 = a and a1=aa \cdot 1 = a.
  3. Commutative: a+b=b+aa + b = b + a and ab=baa \cdot b = b \cdot a.
  4. Distributive:
    • a(b+c)=(ab)+(ac)a \cdot (b + c) = (a \cdot b) + (a \cdot c)
    • a+(bc)=(a+b)(a+c)a + (b \cdot c) = (a + b) \cdot (a + c) (Highly tested in exams)
  5. Complement: a+a=1a + a' = 1 and aa=0a \cdot a' = 0.

6.2 Key Theorems of Boolean Algebra

  • Idempotent Law: A+A=AA + A = A, AA=AA \cdot A = A.
  • Boundedness (Dominance): A+1=1A + 1 = 1, A0=0A \cdot 0 = 0.
  • Involution Law: (A)=A(A')' = A.
  • Absorption Law:
    • A+AB=AA + AB = A
    • A(A+B)=AA(A + B) = A
    • A+AB=A+BA + A'B = A + B (Simplification powerhouse!)
  • Demorgan's Laws:
    • (A+B)=AB(A + B)' = A' \cdot B' (The complement of a sum is the product of complements)
    • (AB)=A+B(A \cdot B)' = A' + B' (The complement of a product is the sum of complements)
  • Consensus Theorem:
    • AB+AC+BC=AB+ACAB + A'C + BC = AB + A'C
    • (A+B)(A+C)(B+C)=(A+B)(A+C)(A+B)(A'+C)(B+C) = (A+B)(A'+C)
    • Proof: BC=BC(A+A)=ABC+ABCBC = BC(A+A') = ABC + A'BC. Substitute this back: AB+AC+ABC+ABC=AB(1+C)+AC(1+B)=AB+ACAB + A'C + ABC + A'BC = AB(1+C) + A'C(1+B) = AB + A'C.
  • Shannon's Expansion Theorem:
    • F(A,B,C,...)=AF(1,B,C,...)+AF(0,B,C,...)F(A, B, C, ...) = A \cdot F(1, B, C, ...) + A' \cdot F(0, B, C, ...)

7. Exam Tips & Common Pitfalls

[!WARNING]

  • Overflow in 2's Complement: Arithmetic overflow occurs only when adding two numbers of the same sign and getting a result with the opposite sign. Formally: V=CinCoutV = C_{in} \oplus C_{out} at the MSB adder stage. If V=1V=1, overflow occurred.
  • Distributive Law Trap: Students often forget that OR distributes over AND: A+BC=(A+B)(A+C)A + BC = (A+B)(A+C).
  • Consensus Theorem Identification: Look for three terms, where each of three variables (A,B,CA, B, C) appears twice, and one variable appears in both complemented and uncomplemented forms. The term containing only uncomplemented/complemented counterparts of the other two variables is redundant.

Key Revision Rules

Essential formulas and core points to memorize

  • 1Binary, Octal, Decimal, and Hexadecimal number systems conversions.
  • 2Signed representations: Sign-Magnitude, 1's Complement, and 2's Complement with exact range calculations.
  • 3Binary codes: Weighted (8421 BCD, 2421) vs. Non-Weighted (Excess-3, Gray code unit-distance transitions).
  • 4Huntington's postulates of Boolean algebra: closure, identity, commutativity, distributivity, and complement.
  • 5Boolean theorems: Absorption, De Morgan's laws, and the Consensus theorem (AB + A'C + BC = AB + A'C).

Common Exam Mistakes

Where students frequently lose marks

Swapping sign representation ranges: 8-bit sign-magnitude and 1's complement are -127 to +127, while 2's complement is -128 to +127.
Forgetting the BCD addition rule: add 6 (0110) if the sum of two digits exceeds 9 or generates a carry.
Leaving CMOS or TTL inputs floating: CMOS inputs must never float to avoid electrostatic destruction.

Topic Quiz Practice

1 of 10
Question 1

What is the decimal equivalent of the binary number (1101.11)2(1101.11)_2?