Digital Logic Design (DLD) teaches how computers work at the level of bits and circuits. It is a core BSCS, BSIT and electrical engineering course. This guide covers number systems, logic gates, Boolean algebra, Karnaugh maps, adders, multiplexers and flip-flops with worked examples.
1. Number Systems
| System | Base | Digits |
|---|---|---|
| Binary | 2 | 0, 1 |
| Octal | 8 | 0–7 |
| Decimal | 10 | 0–9 |
| Hexadecimal | 16 | 0–9, A–F |
Worked Example: Convert 45 (decimal)
- Binary: 45 = 32 + 8 + 4 + 1 = 101101₂
- Hexadecimal: group binary in fours from the right: 0010 1101 = 2D₁₆
- Octal: group in threes: 101 101 = 55₈
Two’s Complement (Negative Numbers)
To write −5 in 8 bits: start with +5 = 00000101, invert all bits = 11111010, then add 1 = 11111011.
2. Logic Gates
| Gate | Expression | Output is 1 when |
|---|---|---|
| AND | A · B | all inputs are 1 |
| OR | A + B | at least one input is 1 |
| NOT | A′ | input is 0 |
| NAND | (A · B)′ | not all inputs are 1 |
| NOR | (A + B)′ | all inputs are 0 |
| XOR | A ⊕ B | inputs are different |
| XNOR | (A ⊕ B)′ | inputs are the same |
NAND and NOR are universal gates: any logic circuit can be built using only NAND gates (or only NOR gates).
3. Boolean Algebra Laws
- Identity: A + 0 = A, A · 1 = A
- Null: A + 1 = 1, A · 0 = 0
- Idempotent: A + A = A, A · A = A
- Complement: A + A′ = 1, A · A′ = 0
- Absorption: A + AB = A, A(A + B) = A
- De Morgan: (A · B)′ = A′ + B′ and (A + B)′ = A′ · B′
Example: simplify F = AB + AB′ = A(B + B′) = A · 1 = A.
4. Karnaugh Maps (K-Maps)
A K-map is a grid that makes Boolean simplification visual. Adjacent cells differ by one variable, so you group 1s in blocks of 1, 2, 4 or 8 to remove variables.
Example: F(A, B, C) = Σm(1, 3, 5, 7). These minterms are 001, 011, 101 and 111: every row where C = 1. Grouping all four 1s removes A and B, so F = C.
Tips: make groups as large as possible, groups may overlap, and the map wraps around at the edges.
5. Combinational Circuits
The output depends only on the current inputs.
- Half adder: adds two bits. Sum = A ⊕ B, Carry = A · B.
- Full adder: adds three bits (A, B and carry-in). Sum = A ⊕ B ⊕ Cin, Carry = AB + Cin(A ⊕ B).
- Multiplexer (MUX): selects one of many inputs using select lines; a 4-to-1 MUX needs 2 select lines.
- Decoder: converts n inputs into up to 2ⁿ outputs, e.g. a 3-to-8 decoder.
- Encoder: does the reverse of a decoder.
6. Sequential Circuits and Flip-Flops
Sequential circuits have memory: the output depends on current inputs and the previous state. They are controlled by a clock.
| Flip-flop | Behaviour |
|---|---|
| SR | S = 1 sets, R = 1 resets; S = R = 1 is invalid |
| D | Output Q takes the value of D at the clock edge |
| JK | Like SR, but J = K = 1 toggles the output |
| T | T = 1 toggles the output, T = 0 keeps it |
Flip-flops are combined to build registers (store bits) and counters (count clock pulses).
FAQ
What is the difference between combinational and sequential circuits?
Combinational circuits have no memory and depend only on present inputs; sequential circuits store a state and depend on past inputs too.
Why are NAND and NOR called universal gates?
Because AND, OR and NOT, and therefore any circuit, can be built using only NAND gates or only NOR gates.
Next, see assembly language tools and the BSCS Study Hub.
0 comments:
Post a Comment