Computer Organization & Architecture
Unit 1: Basics of Digital Systems
From logic gates to flip-flops โ master combinational and sequential circuits that form the foundation of every computer ever built.
โฑ๏ธ 5 hrs theory + 3 hrs lab | ๐ฏ GATE ~3 marks | ๐ฐ โน6โ12 LPA | ๐ฅ๏ธ ISRO PSLV
๐ผ Jobs this unlocks: VLSI Design Engineer (โน6โ12 LPA) | Embedded Systems Developer (โน5โ10 LPA) | GATE/ISRO/DRDO PSU roles
Opening Hook โ The Digital Brain Behind ISRO's PSLV
๐ PSLV-C58: How Digital Circuits Put India in Orbit
On January 1, 2024, ISRO's PSLV-C58 thundered into the sky carrying the XPoSat satellite. Inside the rocket's flight computer, thousands of digital circuits executed flawlessly at 100 MHz โ making life-or-death decisions every 10 nanoseconds.
Combinational circuits computed real-time thrust vector calculations for stage separation โ pure logic, no memory, instantaneous output. When the first stage burned out at T+113 seconds, a combinational decoder triggered the pyrotechnic bolts that separated the booster. One wrong gate? The rocket tumbles into the Bay of Bengal.
Sequential circuits tracked the rocket's state โ "Are we in Stage 1? Stage 2? Coasting? Payload separation?" โ using flip-flops that remember the current state and transition only on clock edges. The flight computer's state machine cycled through 47 distinct states from launch to orbit insertion.
What if YOU understood these circuits? What if you could design the logic that decides when a 320-tonne rocket drops its booster? That's exactly what this unit teaches you โ the same fundamentals used by ISRO, Intel, and Qualcomm engineers.
Learning Outcomes โ Bloom's Taxonomy Mapped (12 Outcomes)
| Bloom's Level | Learning Outcome |
|---|---|
| ๐ต Remember | LO1: List the five functional units of a computer and identify the role of each unit |
| ๐ต Remember | LO2: State the truth tables for all basic gates (AND, OR, NOT, NAND, NOR, XOR, XNOR) and standard combinational circuits |
| ๐ข Understand | LO3: Explain the difference between combinational and sequential circuits with real-world analogies |
| ๐ข Understand | LO4: Describe the operation of SR, D, JK, and T flip-flops using characteristic equations and timing diagrams |
| ๐ก Apply | LO5: Design a Half Adder and Full Adder from truth tables and draw their gate-level circuits |
| ๐ก Apply | LO6: Construct a 4-bit Ripple Carry Adder by cascading Full Adders and trace binary addition through it |
| ๐ Analyze | LO7: Compare SR, D, JK, and T flip-flops on parameters like race condition, toggling, and input constraints |
| ๐ Analyze | LO8: Analyze the propagation delay issue in Ripple Carry Adders and contrast with Carry Look-Ahead Adders |
| ๐ด Evaluate | LO9: Evaluate which flip-flop type is most suitable for a given application (counter, register, frequency divider) |
| ๐ด Evaluate | LO10: Justify the use of MUX as a universal logic element and assess trade-offs vs discrete gates |
| ๐ฃ Create | LO11: Design a 3-bit synchronous counter using JK flip-flops with complete state table and circuit diagram |
| ๐ฃ Create | LO12: Build a Python simulator that generates truth tables for any n-input combinational circuit |
Concept Explanation โ Digital Systems from Scratch
1. The 5-Unit Computer Model
Every computer โ from a โน500 Arduino to a โน5 crore supercomputer โ has exactly five functional units. Think of them as five departments in a factory, each with a specific job, connected by highways called buses.
๐ฅ๏ธ The Five Functional Units of a Computer
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ COMPUTER SYSTEM โ โ โ โ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ โ โ โ Data/Address Bus โ โ โ โ โ INPUT โโโโโโโโโโโโโโโโโโโโโโโโโโโบโ MEMORY โ โ โ โ UNIT โ โ (RAM / ROM) โ โ โ โ โ โ โ โ โ โ Keyboard โ โ Stores Data โ โ โ โ Mouse โ โ & Programs โ โ โ โ Scanner โ โ โ โ โ โโโโโโโฌโโโโโโ โโโโโโโโโฌโโโโโโโโ โ โ โ โ โ โ โ โโโโโโโโโโโโโโโโโ โ โ โ โ โ CONTROL UNIT โ โ โ โ โโโโโโโโโโโบโ (CU) โโโโโโโโโโโโโโโโ โ โ โ โ โ โ โ Fetches & โ Control Bus โ โ โ Decodes โโโโโโโโโโโโโโโโโโโโโโ โ โ โ Instructions โ โ โ โ โโโโโโโโโฌโโโโโโโโ โ โ โ โ โ โ โ โ Control Signals โ โ โ โผ โ โ โ โโโโโโโโโโโโโโโโโ โโโโโโโดโโโโโ โ โ ALU โ โ OUTPUT โโ โ โ (Arithmetic โ โ UNIT โโ โ โ Logic Unit) โโโโโโโโโโโโโโโบโ โโ โ โ โ โ Monitor โโ โ โ +, -, ร, รท โ โ Printer โโ โ โ AND, OR, NOT โ โ Speaker โโ โ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ Three Buses: Data Bus, Address Bus, Control Bus โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโInput Unit
Accepts data and instructions from the outside world. Examples: keyboard, mouse, scanner, microphone, touchscreen. In ISRO's PSLV, sensors (accelerometers, gyroscopes) act as input devices feeding flight data.
Memory UnitStores data and instructions. Primary memory (RAM โ volatile, fast) holds currently executing programs. Secondary memory (HDD/SSD โ non-volatile, slower) stores permanent data. ROM holds firmware/BIOS.
Arithmetic Logic Unit (ALU)The calculator of the computer. Performs arithmetic operations (+, โ, ร, รท) and logical operations (AND, OR, NOT, XOR). Every computation ultimately happens here.
Control Unit (CU)The brain's manager. Fetches instructions from memory, decodes them, and sends control signals to other units. It coordinates everything โ like a traffic police officer at a busy crossing.
Output UnitPresents processed results to the user. Examples: monitor, printer, speaker, LED display. In PSLV, the output includes telemetry signals sent to the ground station.
System BusesData Bus: Carries actual data between units (bidirectional). Address Bus: Carries memory addresses (unidirectional โ CPU to memory). Control Bus: Carries control signals like read/write, clock, interrupt.
2. Combinational Circuits โ No Memory, Pure Logic
Definition: A combinational circuit's output depends only on its current inputs. It has no memory, no feedback, no clock. Change the input โ output changes instantly (after gate delay).
2.1 Half Adder
The simplest arithmetic circuit. Adds two single bits (A and B) and produces a Sum (S) and a Carry (C).
HALF ADDER โ Truth Table
โโโโโโโฌโโโโโโฌโโโโโโโฌโโโโโโโโ
โ A โ B โ Sum โ Carry โ
โโโโโโโผโโโโโโผโโโโโโโผโโโโโโโโค
โ 0 โ 0 โ 0 โ 0 โ
โ 0 โ 1 โ 1 โ 0 โ
โ 1 โ 0 โ 1 โ 0 โ
โ 1 โ 1 โ 0 โ 1 โ
โโโโโโโดโโโโโโดโโโโโโโดโโโโโโโโ
Equations: Sum = A โ B (XOR)
Carry = A ยท B (AND)
HALF ADDER โ Gate Diagram
โโโโโโโโโโโ
A โโโโโโโโโบโ โ
โ XOR โโโโโโโโบ Sum (S)
B โโโโโฌโโโโบโ โ
โ โโโโโโโโโโโ
โ
โ โโโโโโโโโโโ
A โโโโบโโโโโบโ โ
โ AND โโโโโโโโบ Carry (C)
B โโโโบโโโโโบโ โ
โโโโโโโโโโโ
2.2 Full Adder
Adds three single bits: A, B, and a Carry-In (Cin) from the previous stage. Produces Sum and Carry-Out (Cout). This is the building block for multi-bit adders.
FULL ADDER โ Truth Table
โโโโโโโฌโโโโโโฌโโโโโโโฌโโโโโโโฌโโโโโโโ
โ A โ B โ Cin โ Sum โ Cout โ
โโโโโโโผโโโโโโผโโโโโโโผโโโโโโโผโโโโโโโค
โ 0 โ 0 โ 0 โ 0 โ 0 โ
โ 0 โ 0 โ 1 โ 1 โ 0 โ
โ 0 โ 1 โ 0 โ 1 โ 0 โ
โ 0 โ 1 โ 1 โ 0 โ 1 โ
โ 1 โ 0 โ 0 โ 1 โ 0 โ
โ 1 โ 0 โ 1 โ 0 โ 1 โ
โ 1 โ 1 โ 0 โ 0 โ 1 โ
โ 1 โ 1 โ 1 โ 1 โ 1 โ
โโโโโโโดโโโโโโดโโโโโโโดโโโโโโโดโโโโโโโ
Equations: Sum = A โ B โ Cin
Cout = (A ยท B) + (Cin ยท (A โ B))
FULL ADDER โ Gate Diagram (using 2 Half Adders + OR)
A โโโโโโโบโโโโโโโโโโโโ
โ HALF โโโโโ S1 โโโโโบโโโโโโโโโโโโ
B โโโโโโโบโ ADDER 1 โ โ HALF โโโโโโโโบ Sum
โ โโโโโ C1 โ ADDER 2 โ
โโโโโโโโโโโโ โ Cinโโบโ โโโC2โโ
โ โโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโ โ
โโโโโบโ โ โ
โ OR โโโโโโโโโโโโบCout
โโโโโบโ โ
โ โโโโโโโโ
C2
2.3 4:1 Multiplexer (MUX)
A MUX selects one of several input lines and forwards it to a single output. Think of it as a railway track switch โ 4 tracks converge into 1, and the switchman (select lines) decides which train passes.
4:1 MUX โ Block Diagram
I0 โโโโโโโบโโโโโโโโโโโโโโโโโ
I1 โโโโโโโบโ โ
I2 โโโโโโโบโ 4:1 MUX โโโโโโโโบ Y (Output)
I3 โโโโโโโบโ โ
โโโโโโโโโฌโโโโโโโโ
โ
S1 โโโโโโโโโ S0
(Select Lines)
Truth Table:
โโโโโโโฌโโโโโโฌโโโโโโโโโ
โ S1 โ S0 โ Output โ
โโโโโโโผโโโโโโผโโโโโโโโโค
โ 0 โ 0 โ I0 โ
โ 0 โ 1 โ I1 โ
โ 1 โ 0 โ I2 โ
โ 1 โ 1 โ I3 โ
โโโโโโโดโโโโโโดโโโโโโโโโ
Equation: Y = S1'ยทS0'ยทI0 + S1'ยทS0ยทI1 + S1ยทS0'ยทI2 + S1ยทS0ยทI3
2.4 Decoder (2:4)
A decoder takes an n-bit binary input and activates exactly one of 2โฟ output lines. Think of it as a hotel keycard system โ your room number (binary input) opens exactly one door (output).
2:4 DECODER โ Block Diagram & Truth Table
A โโโโโโโบโโโโโโโโโโโโโโโโโโโโโโโโบ D0 = A'ยทB'
B โโโโโโโบโ 2:4 DECODER โโโโโโโโบ D1 = A'ยทB
โ โโโโโโโโบ D2 = AยทB'
โ โโโโโโโโบ D3 = AยทB
โโโโโโโโโโโโโโโโโ
Truth Table:
โโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโ
โ A โ B โ D0 โ D1 โ D2 โ D3 โ
โโโโโโโผโโโโโโผโโโโโโผโโโโโโผโโโโโโผโโโโโโค
โ 0 โ 0 โ 1 โ 0 โ 0 โ 0 โ
โ 0 โ 1 โ 0 โ 1 โ 0 โ 0 โ
โ 1 โ 0 โ 0 โ 0 โ 1 โ 0 โ
โ 1 โ 1 โ 0 โ 0 โ 0 โ 1 โ
โโโโโโโดโโโโโโดโโโโโโดโโโโโโดโโโโโโดโโโโโโ
2.5 Encoder (4:2 Priority Encoder)
The reverse of a decoder. Takes 2โฟ input lines and produces an n-bit binary code. A priority encoder handles the case when multiple inputs are active โ it encodes the highest-priority one.
4:2 PRIORITY ENCODER โ Truth Table โโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโโโ โ I3 โ I2 โ I1 โ I0 โ A โ B โ Valid โ โโโโโโโผโโโโโโผโโโโโโผโโโโโโผโโโโโโผโโโโโโผโโโโโโโโค โ 0 โ 0 โ 0 โ 0 โ X โ X โ 0 โ โ 0 โ 0 โ 0 โ 1 โ 0 โ 0 โ 1 โ โ 0 โ 0 โ 1 โ X โ 0 โ 1 โ 1 โ โ 0 โ 1 โ X โ X โ 1 โ 0 โ 1 โ โ 1 โ X โ X โ X โ 1 โ 1 โ 1 โ โโโโโโโดโโโโโโดโโโโโโดโโโโโโดโโโโโโดโโโโโโดโโโโโโโโ (X = Don't Care โ higher priority input overrides lower)
2.6 Ripple Carry Adder (4-bit)
Four Full Adders cascaded โ the carry-out of each stage "ripples" into the carry-in of the next. This adds two 4-bit binary numbers.
4-BIT RIPPLE CARRY ADDER
A3 B3 A2 B2 A1 B1 A0 B0
โ โ โ โ โ โ โ โ
โผ โผ โผ โผ โผ โผ โผ โผ
โโโโโโโโ โโโโโโโโ โโโโโโโโ โโโโโโโโ
โ โ โ โ โ โ โ โ
โ FA โโโโโโโ FA โโโโโโโ FA โโโโโโโ FA โโโโ C0 (0)
โ 3 โ C3 โ 2 โ C2 โ 1 โ C1 โ 0 โ
โ โ โ โ โ โ โ โ
โโโโฌโโโโ โโโโฌโโโโ โโโโฌโโโโ โโโโฌโโโโ
โ โ โ โ
C4(Cout) S3 S2 S1 S0
Example: A = 0101 (5), B = 0011 (3), Cin = 0
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
FA0: A0=1, B0=1, Cin=0 โ S0=0, C1=1
FA1: A1=0, B1=1, Cin=1 โ S1=0, C2=1
FA2: A2=1, B2=0, Cin=1 โ S2=0, C3=1
FA3: A3=0, B3=0, Cin=1 โ S3=1, C4=0
Result: S = 1000 (8) โ (5 + 3 = 8)
3. Sequential Circuits โ Circuits with Memory
Definition: A sequential circuit's output depends on both current inputs AND past history (stored state). It has feedback loops and is typically controlled by a clock signal.
| Feature | Combinational Circuit | Sequential Circuit |
|---|---|---|
| Memory | โ No memory | โ Has memory (flip-flops) |
| Feedback | โ No feedback path | โ Output fed back to input |
| Clock | โ Not needed | โ Clock-driven (synchronous) |
| Output depends on | Current inputs only | Current inputs + present state |
| Examples | Adder, MUX, Decoder, Encoder | Flip-flops, Counters, Registers |
| ISRO PSLV use | Thrust calculations | Flight state tracking |
3.1 SR Flip-Flop (Set-Reset)
The most basic memory element. Has two inputs: S (Set) and R (Reset). Stores one bit of data.
SR FLIP-FLOP โ Truth Table โโโโโโโฌโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ โ S โ R โ Q(t+1)โ Action โ โโโโโโโผโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ 0 โ 0 โ Q(t) โ No change (Hold) โ โ 0 โ 1 โ 0 โ Reset โ โ 1 โ 0 โ 1 โ Set โ โ 1 โ 1 โ ? โ โ INVALID (Race!) โ โโโโโโโดโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ Characteristic Equation: Q(t+1) = S + R'ยทQ(t) Constraint: SยทR = 0 (S and R cannot both be 1) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ SR FLIP-FLOP โ โ โ โ S โโโโโบโโโโโโโโ โ โ โ NOR โโโโบ Q โ โ โโโโโบโ โ โ โ โ โ โโโโโโโโ โ โ โ โ โ(Feedback) โ โ โ โโโโโโโโ โ โ โ โโโโโโค NOR โโโโโโโ โ โ โ โโโโบ Q' โ โ R โโโโโบโ โ โ โ โโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3.2 D Flip-Flop (Data/Delay)
Solves the SR flip-flop's invalid state problem by using a single data input. Whatever is on D at the clock edge gets stored. Think of it as a "copy-paste on clock tick" circuit.
D FLIP-FLOP โ Truth Table โโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ โ D โ Q(t+1) โ Action โ โโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ 0 โ 0 โ Stores 0 (Reset) โ โ 1 โ 1 โ Stores 1 (Set) โ โโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ Characteristic Equation: Q(t+1) = D (Output simply follows input at each clock edge) โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ D FLIP-FLOP โ โ โ โ D โโโโโโโบโโโโโโโ โ โ โ โโโโบ Q โ โ CLK โโโโโบโ D โ โ โ โ FF โโโโบ Q' โ โ โโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3.3 JK Flip-Flop (The Universal Flip-Flop)
The most versatile flip-flop. Fixes the SR flip-flop's invalid state โ when J=1, K=1, the output toggles (flips to opposite). Named after Jack Kilby, inventor of the integrated circuit.
JK FLIP-FLOP โ Truth Table โโโโโโโฌโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ โ J โ K โ Q(t+1) โ Action โ โโโโโโโผโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ 0 โ 0 โ Q(t) โ No change (Hold) โ โ 0 โ 1 โ 0 โ Reset โ โ 1 โ 0 โ 1 โ Set โ โ 1 โ 1 โ Q'(t) โ Toggle โ โโโโโโโดโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ Characteristic Equation: Q(t+1) = JยทQ'(t) + K'ยทQ(t)
3.4 T Flip-Flop (Toggle)
A simplified JK flip-flop with a single input T. When T=1, the output toggles on every clock edge. Perfect for building binary counters.
T FLIP-FLOP โ Truth Table โโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ โ T โ Q(t+1) โ Action โ โโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ 0 โ Q(t) โ No change (Hold) โ โ 1 โ Q'(t) โ Toggle โ โโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ Characteristic Equation: Q(t+1) = T โ Q(t) (T=1: flip; T=0: hold)
3.5 Flip-Flop Comparison Table
| Feature | SR | D | JK | T |
|---|---|---|---|---|
| Inputs | S, R | D | J, K | T |
| Invalid state? | Yes (S=R=1) | No | No | No |
| Toggle? | No | No | Yes (J=K=1) | Yes (T=1) |
| Char. Equation | S + R'Q | D | JQ' + K'Q | T โ Q |
| Best for | Basic latch | Registers, data storage | Counters, universal use | Frequency dividers |
| GATE frequency | Low | High | Very High | Medium |
3.6 4-Bit Register
A register is a group of flip-flops that stores a multi-bit binary word. A 4-bit register uses 4 D flip-flops, all sharing the same clock, to store a 4-bit value.
4-BIT PARALLEL REGISTER (using D Flip-Flops)
D3โโบโโโโโโ D2โโบโโโโโโ D1โโบโโโโโโ D0โโบโโโโโโ
โ D โ โ D โ โ D โ โ D โ
โ FF โ โ FF โ โ FF โ โ FF โ
โ โ โ โ โ โ โ โ
CLKโบโ โ CLKโบโ โ CLKโบโ โ CLKโบโ โ
โโโฌโโโ โโโฌโโโ โโโฌโโโ โโโฌโโโ
โ โ โ โ
Q3 Q2 Q1 Q0
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CLK โโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ
(Common clock โ all FFs sample D simultaneously)
On each rising clock edge:
Q3โD3, Q2โD2, Q1โD1, Q0โD0
Example: Load value 1010
Set D3=1, D2=0, D1=1, D0=0 โ on clock edge โ Q = 1010
3.7 3-Bit Asynchronous (Ripple) Counter
A counter that counts in binary from 000 to 111 (0 to 7) and then wraps around. Uses T flip-flops with T=1 (always toggle). Each flip-flop's output clocks the next one.
3-BIT RIPPLE COUNTER (using T Flip-Flops, T=1)
โโโโโโโโ โโโโโโโโ โโโโโโโโ
CLK โโโโโโโโโโโโโบโ T FF โโโโโโบโ T FF โโโโโโบโ T FF โ
โ Q0 โ Q0 โ Q1 โ Q1 โ Q2 โ
โ(LSB) โclockโ โclockโ(MSB) โ
โโโโฌโโโโ โโโโฌโโโโ โโโโฌโโโโ
โ โ โ
Q0 Q1 Q2
State Sequence (Count-Up):
โโโโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโโโโโ
โ Clock โ Q2 โ Q1 โ Q0 โ Decimal โ
โโโโโโโโโผโโโโโโผโโโโโโผโโโโโโผโโโโโโโโโโค
โ 0 โ 0 โ 0 โ 0 โ 0 โ
โ 1 โ 0 โ 0 โ 1 โ 1 โ
โ 2 โ 0 โ 1 โ 0 โ 2 โ
โ 3 โ 0 โ 1 โ 1 โ 3 โ
โ 4 โ 1 โ 0 โ 0 โ 4 โ
โ 5 โ 1 โ 0 โ 1 โ 5 โ
โ 6 โ 1 โ 1 โ 0 โ 6 โ
โ 7 โ 1 โ 1 โ 1 โ 7 โ
โ 8 โ 0 โ 0 โ 0 โ 0 (โบ) โ
โโโโโโโโโดโโโโโโดโโโโโโดโโโโโโดโโโโโโโโโโ
Counts from 0 to 2ยณโ1 = 7, then resets to 0.
Modulus = 2ยณ = 8 (Mod-8 counter)
Learn by Doing โ 3-Tier Lab Structure
๐ข Tier 1 โ GUIDED: Truth Table Trace for Full Adder
Objective:
Manually trace the truth table of a Full Adder and verify the Sum and Carry-Out equations gate by gate.
Step 1: Draw the Circuit
Draw a Full Adder using 2 XOR gates, 2 AND gates, and 1 OR gate. Label all intermediate wires.
A โโโโโโฌโโโโบ[XOR1]โโโPโโโฌโโโโบ[XOR2]โโโโโโบ Sum
โ โ โฒ
B โโโโโโผโโโโบ โ โ
โ [AND1]โโG โ Cinโโค
โ โฒ โ โ
โ โ โโโโโบ[AND2]โโT
โ B โ
A โ
โ โโโโโโโโ
Gโโโโบโโโโโบโ โ
โ โ OR โโโโโบ Cout
Tโโโโบโโโโโบโ โ
โโโโโโโโ
Where: P = A โ B, G = AยทB, T = PยทCin
Step 2: Trace Row by Row
For each input combination, compute every intermediate signal:
| A | B | Cin | P=AโB | G=AยทB | T=PยทCin | Sum=PโCin | Cout=G+T |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 |
Step 3: Verify
Check that Sum = A โ B โ Cin and Cout = AB + Cin(A โ B) match for every row. If even one row doesn't match, your wiring has a bug โ go back and trace again.
๐ก Tier 2 โ SEMI-GUIDED: Build a 4-Bit Ripple Carry Adder on Paper
Your Mission:
Design a 4-bit Ripple Carry Adder, then use it to compute 3 additions manually.
Tasks:
- Draw the full circuit: 4 Full Adders cascaded, with carry chain clearly shown
- Compute: 7 + 5 = ? (0111 + 0101). Trace carry through each FA stage.
- Compute: 9 + 6 = ? (1001 + 0110). Does it overflow for 4 bits?
- Compute: 15 + 1 = ? (1111 + 0001). What happens? Explain overflow.
- Calculate worst-case propagation delay if each FA has a delay of 10 ns.
Expected Results:
| Operation | Binary A | Binary B | Result | Carry Out | Overflow? |
|---|---|---|---|---|---|
| 7 + 5 | 0111 | 0101 | 1100 (12) | 0 | No |
| 9 + 6 | 1001 | 0110 | 1111 (15) | 0 | No |
| 15 + 1 | 1111 | 0001 | 0000 (0!) | 1 | Yes! |
๐ด Tier 3 โ OPEN CHALLENGE: Python Truth Table Generator
The Brief:
Write a Python program that generates truth tables for any n-input combinational circuit. The user provides a Boolean expression, and the program outputs the complete truth table.
Python # Truth Table Generator for Combinational Circuits from itertools import product def generate_truth_table(variables, expression): """Generate truth table for a Boolean expression.""" n = len(variables) # Print header header = " | ".join(variables) + " | Output" print(header) print("-" * len(header)) # Generate all input combinations for values in product([0, 1], repeat=n): # Map variable names to values env = dict(zip(variables, values)) # Evaluate expression result = eval(expression, {"__builtins__": {}}, env) result = 1 if result else 0 row = " | ".join(str(v) for v in values) print(f"{row} | {result}") # Example: Full Adder print("=== FULL ADDER: Sum ===") generate_truth_table( ["A", "B", "C"], "(A ^ B ^ C)" # XOR for Sum ) print("\n=== FULL ADDER: Carry ===") generate_truth_table( ["A", "B", "C"], "(A and B) or (C and (A ^ B))" # Carry equation ) print("\n=== 2:4 DECODER ===") for i in range(4): print(f"\nOutput D{i}:") expr = [ "(not A) and (not B)", "(not A) and B", "A and (not B)", "A and B" ][i] generate_truth_table(["A", "B"], expr)
โข Add a 4:1 MUX simulation that accepts select lines + data inputs
โข Add a JK flip-flop simulator that takes a clock sequence and shows Q at each edge
โข Output truth tables as formatted HTML files (portfolio piece!)
Problem Bank โ Diagrams, Numericals, Industry & GATE
Diagram-Based Problems (3)
๐ P1: Draw the gate-level circuit for a 4:1 MUX using basic gates
Task: Using AND, OR, and NOT gates only, draw the complete circuit for a 4:1 MUX with inputs I0โI3, select lines S1, S0, and output Y.
Solution:
S1 โโโฌโโโบ[NOT]โโS1' S0 โโโฌโโโบ[NOT]โโS0'
โ โ
โ โ
I0 โโโบ[AND]โโโ S1' โโโ S0' โโโบ AND0 out
I1 โโโบ[AND]โโโ S1' โโโ S0 โโโบ AND1 out
I2 โโโบ[AND]โโโ S1 โโโ S0' โโโบ AND2 out โโโบ[OR]โโโบ Y
I3 โโโบ[AND]โโโ S1 โโโ S0 โโโบ AND3 out
Each AND gate is 3-input:
AND0 = I0 ยท S1' ยท S0'
AND1 = I1 ยท S1' ยท S0
AND2 = I2 ยท S1 ยท S0'
AND3 = I3 ยท S1 ยท S0
Y = AND0 + AND1 + AND2 + AND3
Gate count: 2 NOT + 4 AND (3-input) + 1 OR (4-input) = 7 gates total.
๐ P2: Draw a 3-bit synchronous counter using JK flip-flops
Task: Design a Mod-8 synchronous up-counter. All flip-flops share the same clock. Show the excitation table and connections.
Solution:
Excitation Table (JK FF):
โโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โPresent โ Next โ JK inputs needed โ
โQ2 Q1 Q0โQ2 Q1 Q0โ J2 K2 J1 K1 J0 K0 โ
โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 0 0 0โ 0 0 1โ 0 X 0 X 1 X โ
โ 0 0 1โ 0 1 0โ 0 X 1 X X 1 โ
โ 0 1 0โ 0 1 1โ 0 X X 0 1 X โ
โ 0 1 1โ 1 0 0โ 1 X X 1 X 1 โ
โ 1 0 0โ 1 0 1โ X 0 0 X 1 X โ
โ 1 0 1โ 1 1 0โ X 0 1 X X 1 โ
โ 1 1 0โ 1 1 1โ X 0 X 0 1 X โ
โ 1 1 1โ 0 0 0โ X 1 X 1 X 1 โ
โโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Simplified (using K-maps):
J0 = K0 = 1 (always toggle)
J1 = K1 = Q0
J2 = K2 = Q0 ยท Q1
Circuit:
โโโโโโโโ โโโโโโโโ โโโโโโโโ
1 โโJ0โโบโ JK โ Q0โJ1โบโ JK โQ0ยทQ1โJ2โบโ JK โ
1 โโK0โโบโ FF0 โ Q0โK1โบโ FF1 โQ0ยทQ1โK2โบโ FF1 โ
CLKโโโโโบโ โ CLKโโโบโ โ CLKโโโโบโ โ
โโโโฌโโโโ โโโโฌโโโโ โโโโฌโโโโ
Q0 Q1 Q2
๐ P3: Draw the timing diagram for a D flip-flop
Task: Given CLK and D waveforms, draw Q output for a positive-edge-triggered D flip-flop.
CLK: โโโ โโโโ โโโโ โโโโ โโโโ โโโโ โโโ
โโโโ โโโโ โโโโ โโโโ โโโโ โโโโ
Edge: โ1 โ2 โ3 โ4 โ5 โ6
D: โโ1โโ1โโ0โโ0โโ1โโ1โโ0โโ0โโ1โโ1โโ0โโ0โโ
Q: โโ0โโ1โโ1โโ0โโ0โโ1โโ1โโ0โโ0โโ1โโ1โโ0โโ
โ โ โ โ โ โ
D=1 D=0 D=1 D=0 D=1 D=0
atโ1 atโ2 atโ3 atโ4 atโ5 atโ6
Rule: Q takes the value of D at each rising edge of CLK.
Between clock edges, Q holds its previous value.
Numerical Problems (6)
๐ข N1: Binary Addition using 4-bit RCA
Q: Add 1011โ (11) and 0110โ (6) using a 4-bit Ripple Carry Adder. Show carry at each stage.
Solution:
FA0: A0=1, B0=0, Cin=0 โ Sum=1, Cout=0 FA1: A1=1, B1=1, Cin=0 โ Sum=0, Cout=1 FA2: A2=0, B2=1, Cin=1 โ Sum=0, Cout=1 FA3: A3=1, B3=0, Cin=1 โ Sum=0, Cout=1 Result: Cout=1, S = 0001 Full answer: 10001โ = 17โโ โ (11 + 6 = 17) Note: Cout=1 means result needs 5 bits.
๐ข N2: MUX-based Function Implementation
Q: Implement f(A,B) = ฮฃm(1,2,3) using a 4:1 MUX.
Solution:
Truth table: A B | f 0 0 | 0 โ I0 = 0 0 1 | 1 โ I1 = 1 1 0 | 1 โ I2 = 1 1 1 | 1 โ I3 = 1 Connect: S1=A, S0=B I0=0 (GND), I1=1 (VCC), I2=1 (VCC), I3=1 (VCC) This is equivalent to f = A + B (OR gate)
๐ข N3: Propagation Delay Calculation
Q: A 16-bit Ripple Carry Adder uses Full Adders with a gate delay of 5 ns per gate. Each FA has 2 gate levels for carry propagation. Calculate the worst-case delay.
Solution:
Worst-case carry delay per FA = 2 ร 5 ns = 10 ns Total carry chain for 16-bit = 16 FAs Worst-case total delay = 16 ร 10 ns = 160 ns Maximum operating frequency = 1 / 160 ns = 6.25 MHz Compare: Modern CPUs run at 4 GHz = 0.25 ns per cycle This is why RCA is NOT used in real processors!
๐ข N4: Flip-Flop State Sequence
Q: A JK flip-flop has J=1, K=1 with initial Q=0. What is Q after 5 clock pulses?
Solution:
J=K=1 โ Toggle mode Initial: Q = 0 After clock 1: Q = 1 (toggled) After clock 2: Q = 0 (toggled) After clock 3: Q = 1 (toggled) After clock 4: Q = 0 (toggled) After clock 5: Q = 1 (toggled) Answer: Q = 1 after 5 clock pulses. Pattern: Q toggles every clock โ acts as frequency divider รท2
๐ข N5: Counter Modulus
Q: How many flip-flops are needed for a Mod-12 counter? What is the maximum count?
Solution:
Need to count 12 states: 0 to 11 Number of FFs = โlogโ(12)โ = โ3.585โ = 4 flip-flops 4 FFs can count 0 to 15 (Mod-16 naturally) For Mod-12: Reset to 0 when count reaches 12 (1100โ) Maximum valid count = 11 (1011โ) Reset logic: When Q3=1, Q2=1, Q1=0, Q0=0 โ CLEAR all FFs Reset = Q3 ยท Q2 (since 12 = 1100, we detect this and reset)
๐ข N6: Decoder Output Minterms
Q: A 3:8 decoder has inputs AโAโAโ = 101. Which output line is active?
Solution:
Input: Aโ=1, Aโ=0, Aโ=1 Binary 101 = Decimal 5 Output D5 is active (HIGH), all others are LOW. D5 = Aโ ยท Aโ' ยท Aโ = 1 ยท 1 ยท 1 = 1 โ A 3:8 decoder generates all 8 minterms of 3 variables. This is why decoders can implement ANY Boolean function by OR-ing the appropriate output lines.
Industry Application Problems (3)
๐ญ I1: ISRO Flight Computer โ Stage Separation Logic
Scenario: PSLV has 4 stages. The flight computer must activate stage separation only when: (1) current stage fuel is depleted (F=1), (2) altitude is above minimum threshold (A=1), AND (3) separation command is received from ground or timer (C=1).
Task: Design the combinational logic circuit for the SEPARATE signal.
SEPARATE = F ยท A ยท C (3-input AND gate) Truth Table: F A C | SEPARATE 0 0 0 | 0 (fuel remaining, don't separate) 0 0 1 | 0 0 1 0 | 0 0 1 1 | 0 1 0 0 | 0 (fuel done but too low altitude!) 1 0 1 | 0 1 1 0 | 0 (fuel done, altitude OK, no command) 1 1 1 | 1 โ SEPARATE NOW! Safety: Only 1 out of 8 conditions triggers separation. This is intentional โ fail-safe design.
๐ญ I2: Qualcomm Hyderabad โ Power Management MUX
Scenario: A Snapdragon SoC has 4 power modes: Active (00), Idle (01), Sleep (10), Deep Sleep (11). A 4:1 MUX selects the appropriate clock frequency based on the power mode.
Task: Design the MUX configuration.
Power Mode Select Lines: S1, S0
Clock frequencies (input to MUX):
I0 = 2.4 GHz (Active โ full speed)
I1 = 800 MHz (Idle โ reduced)
I2 = 100 MHz (Sleep โ minimal)
I3 = 32 KHz (Deep Sleep โ near zero)
Output Y = selected clock frequency
This is exactly how modern phone chipsets save battery.
When you lock your phone, S1S0 transitions from 00โ01โ10โ11
reducing power consumption by 99%.
๐ญ I3: Indian Railways โ Signal Interlocking Logic
Scenario: At a junction, two train routes (R1, R2) must never be green simultaneously. Design a combinational circuit that ensures safety interlocking.
Inputs: Request_R1, Request_R2 Outputs: Green_R1, Green_R2 Safety Rule: Green_R1 ยท Green_R2 = 0 (NEVER both green) Logic: Green_R1 = Request_R1 ยท Request_R2' (R1 only if R2 not requested) Green_R2 = Request_R2 ยท Request_R1' (R2 only if R1 not requested) If both requested simultaneously: Green_R1 = 0, Green_R2 = 0 (BOTH RED โ safe default) Additional priority logic can be added to handle conflicts. Indian Railways uses similar relay-based interlocking at 7,000+ stations.
GATE-Style Problems (5)
๐ฏ GATE Q1 [1 Mark]
Q: The number of 2-input AND and OR gates required to implement the Boolean function F(A,B,C) = AB + BC + CA in Sum-of-Products form is:
- 3 AND, 1 OR
- 3 AND, 3 OR
- 2 AND, 1 OR
- 3 AND, 2 OR
Answer: (A) โ F = AB + BC + CA has 3 product terms (3 AND gates) combined by 1 OR gate. But the OR gate needs 3 inputs. Using 2-input OR gates: need 2 OR gates (cascade). So strictly: 3 AND + 2 OR. Answer is (A) if 3-input OR is allowed, (D) if only 2-input. GATE usually allows multi-input gates.
๐ฏ GATE Q2 [2 Marks]
Q: A 4-bit ripple carry adder adds two 4-bit numbers. The gate delay is ฮ per gate. What is the worst-case delay for the carry output of the MSB stage?
- 4ฮ
- 8ฮ
- 12ฮ
- 16ฮ
Answer: (B) 8ฮ โ Each Full Adder has 2 gate levels for carry propagation (AND + OR). For 4 stages: 4 ร 2ฮ = 8ฮ. Note: First FA carry takes 2ฮ, and each subsequent FA adds 2ฮ to the carry chain.
๐ฏ GATE Q3 [1 Mark]
Q: The characteristic equation of a JK flip-flop is:
- Q(t+1) = JQ + K'Q'
- Q(t+1) = JQ' + K'Q
- Q(t+1) = J'Q + KQ'
- Q(t+1) = J โ Q
Answer: (B) โ Q(t+1) = JยทQ'(t) + K'ยทQ(t). Verify: J=0,K=0 โ Q(hold) โ; J=0,K=1 โ 0(reset) โ; J=1,K=0 โ 1(set) โ; J=1,K=1 โ Q'(toggle) โ.
๐ฏ GATE Q4 [2 Marks]
Q: An 8:1 MUX is used to implement a 3-variable Boolean function f(A,B,C). A, B, C are connected to S2, S1, S0 respectively. For f = ฮฃm(1,2,4,7), the values of I0 through I7 are:
- 0,1,1,0,1,0,0,1
- 1,1,0,1,0,0,1,0
- 0,1,1,0,0,1,0,1
- 1,0,0,1,1,0,1,0
Answer: (A) โ f = ฮฃm(1,2,4,7). Minterms present: m1, m2, m4, m7. So I1=1, I2=1, I4=1, I7=1; rest = 0. Sequence: I0=0, I1=1, I2=1, I3=0, I4=1, I5=0, I6=0, I7=1.
๐ฏ GATE Q5 [2 Marks]
Q: A 3-bit synchronous counter using JK flip-flops counts the sequence: 0โ1โ2โ3โ4โ5โ6โ7โ0. The flip-flop inputs for the MSB (Q2) are:
- J2 = Q1ยทQ0, K2 = Q1ยทQ0
- J2 = Q1+Q0, K2 = Q1+Q0
- J2 = Q1โQ0, K2 = 1
- J2 = 1, K2 = 1
Answer: (A) โ From the excitation table, Q2 transitions 0โ1 only when Q1=Q0=1 (count 3โ4), and 1โ0 only when Q1=Q0=1 (count 7โ0). So J2 = K2 = Q1ยทQ0.
MCQ Assessment Bank โ 30 Questions (Bloom's Mapped)
Remember / Identify (Q1โQ5)
Which unit of a computer performs arithmetic and logical operations?
- Control Unit
- Memory Unit
- ALU
- Input Unit
The output of a Half Adder for inputs A=1, B=1 is:
- Sum=1, Carry=0
- Sum=0, Carry=1
- Sum=1, Carry=1
- Sum=0, Carry=0
How many select lines does an 8:1 MUX have?
- 2
- 3
- 4
- 8
The characteristic equation of a D flip-flop is:
- Q(t+1) = D
- Q(t+1) = D โ Q
- Q(t+1) = DยทQ'
- Q(t+1) = D + Q
A 2:4 decoder has how many output lines?
- 2
- 4
- 8
- 16
Understand / Explain (Q6โQ10)
Why is the S=1, R=1 condition invalid in an SR flip-flop?
- It consumes too much power
- It forces Q and Q' to both be 0, violating the complement rule
- It damages the circuit physically
- It causes the clock to stop
In a 4-bit Ripple Carry Adder, why does the MSB stage produce the result last?
- It has more gates
- It must wait for the carry to ripple through all previous stages
- The MSB is always the slowest bit
- It uses a different clock
What does it mean when we say a MUX is a "universal logic element"?
- It can replace any power supply
- It can implement any Boolean function without other gates
- It works at any frequency
- It can store data like a flip-flop
How does a sequential circuit differ from a combinational circuit fundamentally?
- Sequential circuits are faster
- Sequential circuits have memory elements (feedback) while combinational don't
- Sequential circuits don't use logic gates
- Combinational circuits require a clock
Why is the D flip-flop preferred over SR flip-flop for data storage registers?
- It's cheaper
- It has no invalid state and directly stores whatever value is on its input
- It runs at higher frequency
- It uses fewer transistors
Apply / Solve (Q11โQ15)
A Full Adder has inputs A=1, B=0, Cin=1. The outputs Sum and Cout are:
- Sum=0, Cout=1
- Sum=1, Cout=1
- Sum=0, Cout=0
- Sum=1, Cout=0
In a 4:1 MUX with S1=1, S0=0, which input is selected?
- I0
- I1
- I2
- I3
A JK flip-flop with J=1, K=0 and current Q=0. After one clock pulse, Q becomes:
- 0
- 1
- Toggles
- Undefined
How many Full Adders are needed to build a 16-bit adder?
- 8
- 15
- 16
- 32
A 3:8 decoder with inputs AโAโAโ = 011. Which output is HIGH?
- D0
- D3
- D5
- D7
Analyze / Compare (Q16โQ20)
A Carry Look-Ahead Adder is faster than a Ripple Carry Adder because:
- It uses fewer gates
- It computes all carry bits simultaneously using generate and propagate logic
- It doesn't need carry bits
- It uses sequential logic instead of combinational
Which flip-flop type can be used to implement all other flip-flop types?
- SR
- D
- JK
- T
In a ripple counter vs. a synchronous counter, the primary disadvantage of the ripple counter is:
- Uses more flip-flops
- Higher power consumption
- Cumulative propagation delay due to asynchronous clocking
- Cannot count beyond 8
A decoder can be used as a demultiplexer if:
- Output lines are grounded
- An enable input is used as the data line
- Extra flip-flops are added
- Clock is connected to inputs
Which combination correctly identifies memory elements?
- MUX and Decoder โ both have memory
- Flip-flop and Register โ both have memory
- Adder and Encoder โ both have memory
- Counter and MUX โ both have memory
Evaluate / Justify (Q21โQ25)
For a frequency divider circuit, which flip-flop configuration is most appropriate?
- SR with S=R=0
- D with D connected to Q'
- JK with J=K=1
- Both (B) and (C)
A 4-bit register can be built using which of the following?
- 4 AND gates
- 4 D flip-flops with common clock
- 4 MUX circuits
- 4 decoders
If a circuit has both combinational and sequential parts, it is classified as:
- Combinational
- Sequential
- Hybrid only
- Neither
For implementing Boolean function f(A,B,C) = ฮฃm(0,3,5,6), which is more gate-efficient?
- Using discrete AND-OR gates (SOP form)
- Using an 8:1 MUX
- Both use equal gates
- Cannot be determined
In PSLV's flight computer, why would sequential circuits be preferred over combinational circuits for tracking the rocket's flight phase?
- Sequential circuits are cheaper
- Flight phases depend on history/state, which only sequential circuits can track
- Combinational circuits cannot perform arithmetic
- Sequential circuits are always faster
Create / GATE Advanced (Q26โQ30)
[GATE Style] The minimum number of 2:1 MUXes required to implement a 4:1 MUX is:
- 2
- 3
- 4
- 5
[GATE Style] A mod-10 counter requires a minimum of how many flip-flops?
- 3
- 4
- 5
- 10
[GATE Style] To convert a JK flip-flop into a T flip-flop, the connections should be:
- J = T, K = T'
- J = T, K = T
- J = T', K = T
- J = 1, K = T
[GATE Style] The output of a 3-bit ripple counter after 13 clock pulses (initial state = 000) is:
- 101
- 011
- 110
- 001
[GATE Style] A 4:16 decoder can be constructed using:
- Two 3:8 decoders and one 1:2 decoder
- Four 2:4 decoders and one 2:4 decoder
- Five 2:4 decoders
- Both (A) and (C)
Short Answer Questions (8 Questions)
SA1: List and briefly explain the five functional units of a computer. [5 marks]
Answer:
1. Input Unit: Accepts data and instructions from external devices (keyboard, mouse, scanner). Converts human-readable data into binary for processing.
2. Memory Unit: Stores data and programs. Primary memory (RAM) holds active data; secondary memory (HDD/SSD) provides persistent storage. ROM stores firmware.
3. ALU (Arithmetic Logic Unit): Performs arithmetic operations (addition, subtraction, multiplication, division) and logical operations (AND, OR, NOT, XOR, comparison).
4. Control Unit (CU): Directs the operation of all other units. Fetches instructions from memory, decodes them, and generates control signals to coordinate execution.
5. Output Unit: Presents processed results in human-readable form (monitor, printer, speaker). Converts binary data to visual/audio output.
These units communicate via three buses: Data Bus (data transfer), Address Bus (memory addressing), and Control Bus (control signals).
SA2: Differentiate between combinational and sequential circuits with two examples each. [5 marks]
Answer:
| Parameter | Combinational | Sequential |
|---|---|---|
| Memory | No memory elements | Contains flip-flops (memory) |
| Feedback | No feedback path | Has feedback from output to input |
| Output depends on | Current inputs only | Current inputs + present state |
| Clock | Not required | Required (synchronous type) |
| Examples | Adder, MUX, Decoder, Encoder | Flip-flops, Counters, Registers |
Indian analogy: Combinational = Vending machine (same input โ same output, no history). Sequential = ATM (remembers card inserted, PIN entered โ has states).
SA3: Design a Half Adder. Write its truth table, Boolean expressions, and draw the logic circuit. [5 marks]
Answer:
A Half Adder adds two single-bit inputs A and B, producing Sum (S) and Carry (C).
Truth Table: A=0,B=0โS=0,C=0 | A=0,B=1โS=1,C=0 | A=1,B=0โS=1,C=0 | A=1,B=1โS=0,C=1
Equations: S = A โ B (XOR gate), C = A ยท B (AND gate)
Circuit: One XOR gate for Sum, one AND gate for Carry. Both gates take A and B as inputs. Total: 2 gates.
Limitation: Cannot handle carry input from a previous stage โ hence "Half" adder. For multi-bit addition, we need Full Adders.
SA4: Explain the working of a JK flip-flop with its truth table and characteristic equation. [5 marks]
Answer:
The JK flip-flop is called the "universal" flip-flop because it eliminates the invalid state of the SR flip-flop.
Truth Table:
J=0, K=0 โ Q(t+1) = Q(t) โ No change (Hold)
J=0, K=1 โ Q(t+1) = 0 โ Reset
J=1, K=0 โ Q(t+1) = 1 โ Set
J=1, K=1 โ Q(t+1) = Q'(t) โ Toggle (key advantage over SR)
Characteristic Equation: Q(t+1) = JยทQ'(t) + K'ยทQ(t)
Key Advantage: When J=K=1, the output toggles instead of entering an invalid state. This makes it ideal for counters (toggle mode) and convertible to D or T flip-flop configurations.
SA5: What is a Multiplexer? Explain 4:1 MUX with its truth table. [5 marks]
Answer:
A Multiplexer (MUX) is a combinational circuit that selects one of multiple input lines and directs it to a single output line. It acts as a "data selector."
4:1 MUX: Has 4 data inputs (I0โI3), 2 select lines (S1, S0), and 1 output (Y).
Truth Table: S1=0,S0=0โY=I0 | S1=0,S0=1โY=I1 | S1=1,S0=0โY=I2 | S1=1,S0=1โY=I3
Equation: Y = S1'ยทS0'ยทI0 + S1'ยทS0ยทI1 + S1ยทS0'ยทI2 + S1ยทS0ยทI3
Applications: Data routing, function implementation, communication systems. A 2โฟ:1 MUX can implement any n-variable Boolean function, making it a universal logic element.
SA6: Explain the concept of Ripple Carry Adder. Why is it slow for large bit-widths? [5 marks]
Answer:
A Ripple Carry Adder (RCA) is formed by cascading n Full Adders to add two n-bit numbers. The carry-out of each FA becomes the carry-in of the next FA.
Why it's slow: The carry must "ripple" through all stages sequentially. FA(n) cannot compute its output until it receives carry from FA(n-1). Worst-case delay = 2n ร gate_delay (2 gate levels per FA for carry).
Example: 32-bit RCA with 10 ns gate delay: Worst case = 2 ร 32 ร 10 = 640 ns โ max frequency = 1.56 MHz. Modern CPUs need GHz speeds!
Solution: Carry Look-Ahead Adder (CLA) computes all carries in parallel using Generate and Propagate signals, achieving O(log n) delay instead of O(n).
SA7: What is a Decoder? How can a decoder be used to implement Boolean functions? [5 marks]
Answer:
A Decoder takes an n-bit input and activates exactly one of 2โฟ output lines. Each output represents one minterm of the input variables.
2:4 Decoder Outputs: D0=A'B', D1=A'B, D2=AB', D3=AB โ these are all 4 minterms of 2 variables.
Implementing Boolean functions: Since each decoder output is a minterm, any SOP function can be implemented by OR-ing the appropriate outputs.
Example: f(A,B) = ฮฃm(1,3) = A'B + AB = D1 + D3. Connect D1 and D3 to an OR gate โ output is f.
This makes decoders extremely versatile โ an n:2โฟ decoder + OR gates can implement ANY n-variable Boolean function.
SA8: Describe a 4-bit parallel register using D flip-flops. How does it load and store data? [5 marks]
Answer:
A 4-bit parallel register uses 4 D flip-flops with a common clock signal. Each FF stores one bit of the 4-bit data word.
Loading data: Place the 4-bit value on inputs D3, D2, D1, D0. On the rising edge of CLK, all four FFs simultaneously capture their respective D inputs: Q3โD3, Q2โD2, Q1โD1, Q0โD0.
Storing data: Between clock edges, the outputs Q3โQ0 hold the stored value. The data persists until the next clock edge loads new values.
Applications: CPU general-purpose registers (store operands), instruction register (holds current instruction), buffer registers in data transfer, shift registers for serial-to-parallel conversion.
Example: Intel x86 has 32-bit registers (EAX, EBX, etc.) โ each is essentially 32 D flip-flops with a common clock.
Long Answer Questions (3 Questions)
LA1: Design a 4-bit Ripple Carry Adder. Explain its working with a complete example, draw the circuit diagram, and discuss its limitations. Suggest an improvement. [15 marks]
Model Answer:
Introduction: A 4-bit Ripple Carry Adder (RCA) adds two 4-bit binary numbers A = A3A2A1A0 and B = B3B2B1B0 with an optional carry-in C0, producing a 4-bit sum S = S3S2S1S0 and a carry-out C4.
Building Block โ Full Adder:
Each FA has inputs (Ai, Bi, Ci) and outputs (Si, Ci+1).
Sum: Si = Ai โ Bi โ Ci | Carry: Ci+1 = AiยทBi + Ciยท(Ai โ Bi)
Circuit: Four FAs cascaded โ Cout of FA(i) connects to Cin of FA(i+1). C0 is typically 0 for addition.
Worked Example: Add A = 0111 (7) and B = 0101 (5):
FA0: 1+1+0 = 10 โ S0=0, C1=1 FA1: 1+0+1 = 10 โ S1=0, C2=1 FA2: 1+1+1 = 11 โ S2=1, C3=1 FA3: 0+0+1 = 01 โ S3=1, C4=0 Result: 1100โ = 12โโ โ (7+5=12)
Limitations:
- Propagation Delay: Carry ripples through all n stages. Worst-case delay = 2n ร t_gate. For 64-bit: 128 ร t_gate โ unacceptable for GHz processors.
- Speed inversely proportional to bit-width: Longer adders are proportionally slower.
- Not suitable for high-speed applications: Modern CPUs require single-cycle addition.
Improvement โ Carry Look-Ahead Adder (CLA):
Define: Generate Gi = AiยทBi (carry generated regardless of Cin), Propagate Pi = Ai โ Bi (carry propagated from Cin).
C1 = G0 + P0ยทC0, C2 = G1 + P1ยทG0 + P1ยทP0ยทC0, etc.
All carries computed in parallel โ O(log n) delay instead of O(n). Used in all modern processors.
LA2: Compare all four types of flip-flops (SR, D, JK, T). For each, provide the truth table, characteristic equation, excitation table, and one practical application. Explain how to convert a JK flip-flop into D and T flip-flops. [15 marks]
Model Answer:
1. SR Flip-Flop: Truth Table: 00โHold, 01โReset(0), 10โSet(1), 11โInvalid. Char. Eq: Q(t+1) = S + R'Q, Constraint: SR=0. Excitation: 0โ0: S=0,R=X | 0โ1: S=1,R=0 | 1โ0: S=0,R=1 | 1โ1: S=X,R=0. Application: Simple latch circuits, debouncing switches.
2. D Flip-Flop: Truth Table: D=0โQ=0, D=1โQ=1. Char. Eq: Q(t+1) = D. Excitation: 0โ0: D=0 | 0โ1: D=1 | 1โ0: D=0 | 1โ1: D=1. Application: Data registers, pipeline stages in processors.
3. JK Flip-Flop: Truth Table: 00โHold, 01โReset, 10โSet, 11โToggle. Char. Eq: Q(t+1) = JQ' + K'Q. Excitation: 0โ0: J=0,K=X | 0โ1: J=1,K=X | 1โ0: J=X,K=1 | 1โ1: J=X,K=0. Application: Counters, universal flip-flop, state machines.
4. T Flip-Flop: Truth Table: T=0โHold, T=1โToggle. Char. Eq: Q(t+1) = TโQ. Excitation: 0โ0: T=0 | 0โ1: T=1 | 1โ0: T=1 | 1โ1: T=0. Application: Binary counters, frequency dividers.
Conversions:
JK โ D: We need Q(t+1) = D. Set J = D, K = D'. Proof: JQ' + K'Q = DQ' + D'ยท'Q = DQ' + DQ = D(Q'+Q) = D โ
JK โ T: We need Q(t+1) = TโQ. Set J = K = T. Proof: TQ' + T'Q = TโQ โ (by definition of XOR).
LA3: Design a 3-bit synchronous up-counter using JK flip-flops. Provide the state table, excitation table, K-map simplification for each flip-flop input, circuit diagram, and timing diagram. [15 marks]
Model Answer:
State Table:
Present State โ Next State Q2 Q1 Q0 โ Q2+ Q1+ Q0+ 0 0 0 โ 0 0 1 0 0 1 โ 0 1 0 0 1 0 โ 0 1 1 0 1 1 โ 1 0 0 1 0 0 โ 1 0 1 1 0 1 โ 1 1 0 1 1 0 โ 1 1 1 1 1 1 โ 0 0 0
Excitation Table (JK FF: 0โ0: J=0,K=X | 0โ1: J=1,K=X | 1โ0: J=X,K=1 | 1โ1: J=X,K=0):
Q2 Q1 Q0 | J2 K2 | J1 K1 | J0 K0 0 0 0 | 0 X | 0 X | 1 X 0 0 1 | 0 X | 1 X | X 1 0 1 0 | 0 X | X 0 | 1 X 0 1 1 | 1 X | X 1 | X 1 1 0 0 | X 0 | 0 X | 1 X 1 0 1 | X 0 | 1 X | X 1 1 1 0 | X 0 | X 0 | 1 X 1 1 1 | X 1 | X 1 | X 1
K-Map Simplification:
J0 = K0 = 1 (always toggle โ all J0 entries are 1 or X, all K0 entries are 1 or X)
J1 = K1 = Q0 (J1 is 1 when Q0=1, K1 is 1 when Q0=1)
J2 = K2 = Q1ยทQ0 (J2 is 1 only when Q1=1 AND Q0=1)
Circuit: Three JK FFs with common clock. FF0: J0=K0=1. FF1: J1=K1=Q0. FF2: J2=K2=Q0ยทQ1 (AND gate). This is a synchronous counter โ all FFs triggered by the same clock edge simultaneously.
Timing Diagram: Q0 toggles every clock edge. Q1 toggles when Q0=1 at clock edge. Q2 toggles when Q0=Q1=1 at clock edge. Count sequence: 000โ001โ010โ011โ100โ101โ110โ111โ000.
Industry Spotlight โ A Day in the Life
๐ฉโ๐ป Priya Sharma, 28 โ VLSI Design Engineer at Intel India, Bangalore
Background: B.Tech ECE from NIT Trichy. Loved digital electronics in 2nd year. Did a summer internship at Texas Instruments. Got placed at Intel through campus recruitment at โน12 LPA (2019). Now at โน22 LPA after 5 years.
A Typical Day:
9:00 AM โ Standup call with the Xeon server chip team. Review RTL (Register Transfer Level) code changes from yesterday. Discuss a timing violation in the integer ALU path.
10:00 AM โ Write Verilog HDL code for a 64-bit Carry Look-Ahead Adder module. Every gate, every flip-flop she designs uses the exact concepts from this chapter โ at industrial scale.
12:00 PM โ Run synthesis and timing analysis using Synopsys Design Compiler. The tool reports that her adder meets the 4 GHz target clock โ carry delay is under 250 ps.
2:00 PM โ Review a colleague's counter design for the branch predictor unit. Check state transitions, verify excitation table against the specification.
4:00 PM โ Debug a simulation failure: a JK flip-flop in the instruction queue has an unexpected toggle. Root cause โ a race condition in asynchronous reset logic.
5:30 PM โ Knowledge-sharing session: presents "Adder Architectures โ From Ripple to Kogge-Stone" to junior engineers. The slides start with the same Half Adder truth table you learned today.
| Detail | Info |
|---|---|
| Tools Used Daily | Verilog/VHDL, Synopsys Design Compiler, Cadence Virtuoso, ModelSim, Python scripting |
| Entry Salary (2024) | โน10โ15 LPA (Intel, TI, Qualcomm, Samsung Semiconductor) |
| Mid-Level (3โ5 yrs) | โน18โ30 LPA |
| Senior (8+ yrs) | โน35โ60 LPA |
| Companies Hiring | Intel India (Bangalore), Qualcomm (Hyderabad), Texas Instruments (Bangalore), Samsung Semiconductor (Noida), AMD, Broadcom, MediaTek, Synopsys, Cadence |
| Key Exam Paths | GATE ECE/CS (for M.Tech โ VLSI specialization at IITs), ISRO Scientist, DRDO SET |
Earn With It โ Tutoring & Freelance Roadmap
๐ฐ Your Earning Path After This Unit
Primary Earning Avenue: Digital Electronics tutoring for engineering students and GATE aspirants.
Why this works: COA and Digital Electronics are compulsory subjects across all engineering branches (CSE, ECE, EEE, IT). Thousands of students struggle with flip-flops, K-maps, and counter design every semester.
| Earning Avenue | Description | Rate |
|---|---|---|
| Peer Tutoring | Help batchmates with Digital Electronics assignments, lab prep, and exam revision | โน400โ600/hr |
| GATE Coaching | Teach COA + Digital Logic to GATE aspirants. Focus on previous year questions. | โน600โ1000/hr |
| Online Tutoring | Platforms: Chegg, Doubtnut, Vedantu (for competitive exams). Solve doubt questions. | โน300โ800/hr |
| YouTube / Notes | Create animated flip-flop tutorials, counter design walkthroughs. Monetize with ads. | โน5,000โ15,000/month (at 10K+ views) |
| Lab Assignment Help | Help juniors with Verilog/VHDL lab programs (ethically โ teach, don't copy) | โน500โ1000/assignment |
| Internshala Projects | Digital circuit simulation projects using Logisim or Proteus | โน2,000โ5,000/project |
โฑ๏ธ Time to First Earning: 1โ2 weeks (start by tutoring your own classmates who are struggling with flip-flops)
Chapter Summary & Unit Map
๐บ๏ธ Unit 1 Summary โ Digital Systems at a Glance
Core Architecture: Every computer has 5 units โ Input, Output, Memory, ALU, and Control Unit โ connected by Data, Address, and Control buses.
Combinational Circuits (no memory, no clock):
- Half Adder: S = AโB, C = AยทB (adds 2 bits)
- Full Adder: S = AโBโCin, Cout = AB + Cin(AโB) (adds 3 bits)
- 4:1 MUX: Selects 1 of 4 inputs using 2 select lines. Universal logic element.
- 2:4 Decoder: Activates 1 of 4 outputs. Each output = one minterm.
- Encoder: Reverse of decoder. Priority encoder handles multiple active inputs.
- Ripple Carry Adder: n Full Adders cascaded. Delay = O(n). Slow for large n.
Sequential Circuits (has memory, clock-driven):
- SR FF: Set/Reset. Q(t+1) = S + R'Q. Invalid when S=R=1.
- D FF: Data/Delay. Q(t+1) = D. Used in registers.
- JK FF: Universal. Q(t+1) = JQ' + K'Q. Toggles when J=K=1.
- T FF: Toggle. Q(t+1) = TโQ. Used in counters.
- Register: Group of D FFs with common clock. Stores n-bit data.
- Counter: Sequential counter using T/JK FFs. Mod-2โฟ for n-bit.
Key Formulas for GATE:
- FFs needed for Mod-N counter: โlogโNโ
- RCA delay: 2n ร gate_delay
- 2โฟ:1 MUX select lines: n
- n:2โฟ decoder outputs: 2โฟ minterms
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ UNIT 1 โ CONCEPT MAP โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ โ โ โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ DIGITAL โ โ 5-UNIT COMPUTER โ โ โ โ SYSTEMS โโโโโโโบโ MODEL โ โ โ โโโโโโโโโโฌโโโโโโโโโโ โ (Input, Output, โ โ โ โ โ Memory, ALU, CU) โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โ โโโโโโโดโโโโโโโ โ โ โ โ โ โ โผ โผ โ โ โโโโโโโโ โโโโโโโโ โ โ โCOMBI-โ โSEQU- โ โ โ โNATIONโ โENTIALโ โ โ โAL โ โ โ โ โ โโโโฌโโโโ โโโโฌโโโโ โ โ โ โ โ โ โโโโดโโโโโโโโโ โโโ SR Flip-Flop โ โ โโ Adders โ โโโ D Flip-Flop โ โ โ (HA, FA) โ โโโ JK Flip-Flop โ โ โโ MUX โ โโโ T Flip-Flop โ โ โโ Decoder โ โโโ Registers โ โ โโ Encoder โ โโโ Counters โ โ โโ RCA/CLA โ โ โ โผ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ APPLICATIONS โ โ โ โ ISRO PSLV, Intel CPUs, โ โ โ โ Qualcomm SoCs, ARM cores โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Earning Checkpoint โ Self-Assessment
Use this table to track your mastery and earning readiness for each skill learned in this unit:
| Skill / Topic | Tool / Method | Portfolio Piece | Earning Ready? |
|---|---|---|---|
| 5-Unit Computer Model | Conceptual | โ | โ Yes โ can explain in interviews/tutoring |
| Truth Tables & Gate Design | Pen & Paper, Python | Truth Table Generator (Python) | โ Yes โ tutor juniors โน400โ600/hr |
| Combinational Circuits | Adders, MUX, Decoder | Full Adder trace + 4-bit RCA design | โ Yes โ GATE coaching โน600โ1000/hr |
| Sequential Circuits | Flip-flops, Counters | 3-bit Counter Design | โ Yes โ most-asked topic in exams |
| GATE Problem Solving | Previous Year Papers | Solved GATE problems with explanations | โ Yes โ online doubt-solving โน80/doubt |
| Python Circuit Simulator | Python (itertools) | GitHub project โ Truth Table Generator | โ Yes โ impressive for VLSI internships |
| Verilog/VHDL (Next Step) | HDL coding | โ | โฌ Not yet โ covered in Unit 3 |
โ Unit 1 complete. Ready for Unit 2: Data Representation & Number Systems!
[QR: Link to EduArtha video tutorial โ Basics of Digital Systems]