Knowledge / Computer Science and Engineering / Digital logic for computer science

Digital logic for computer science

Computer Science and Engineering (B.E./B.Tech) · Theory and architecture · free study notes for exams, placements and interviews

In short

Digital logic is the study of circuits that process two-valued signals: how numbers and symbols are coded in binary, how Boolean algebra describes gate networks, and how those networks are minimised and assembled into combinational and sequential blocks. Everything above it — processors, memories, controllers, network switches — is built from these blocks, so it is the foundation layer of computer science and of VLSI practice. It is a separately weighted section of GATE CS and GATE EC (typically 6–9 marks), a core second-year paper in the AICTE model curriculum ("Digital Design" / "Switching Theory and Logic Design"), and the first thing asked in VLSI and embedded interviews at Intel, Qualcomm, Nvidia, Texas Instruments, AMD, Synopsys, Cadence, Tessolve, eInfochips, Sasken, Bosch, BEL, ISRO, DRDO, C-DAC and SCL Mohali. Placement aptitude and technical rounds for product and hardware roles lean heavily on K-maps, flip-flop behaviour and timing arithmetic.

Explained

Number systems, codes and binary arithmetic

Boolean algebra and logic gates

Minimisation: K-maps and Quine–McCluskey

Combinational circuit building blocks

Latches, flip-flops and sequential design

Timing, hazards and practical issues

Logic families, programmable logic and HDL

Key points

Formulas and examples

Value of (a_(n−1)…a_0 . a_(−1)…a_(−m))_r = Σ a_i × ri — r = base (radix), a_i = digit, i = position index
2's complement of N in n bits = 2n − N ; 1's complement = (2n − 1) − N
Signed range (n bits, 2's complement) = −2n−1 to +2n−1 − 1 ; unsigned 0 to 2n − 1
Overflow (signed addition) V = C_in(MSB) ⊕ C_out(MSB)
Gray from binary: g_i = b_i ⊕ b_(i+1), g_(n−1) = b_(n−1) ; Binary from Gray: b_i = g_i ⊕ b_(i+1)
Hamming check bits: 2k ≥ m + k + 1 — m = data bits, k = parity bits
Number of functions of n variables = 22n ; number of minterms = 2n
Full adder: S = A ⊕ B ⊕ C_in ; C_out = AB + C_in(A ⊕ B)
Ripple-carry adder worst-case delay ≈ (2n + 1) × t_g — n = bits, t_g = one gate delay
Flip-flops for a mod-N counter: n = ⌈log₂ N⌉ ; ripple counter stage i output frequency = f_in / 2i
Setup (max-delay) constraint: T_clk(min) = t_cq + t_comb(max) + t_su + t_skew ; f_max = 1 / T_clk(min)
Hold (min-delay) constraint: t_cq(min) + t_comb(min) ≥ t_h + t_skew — all times in ns
Ripple counter: T_clk(min) = n × t_pd(FF) + t_su(decode)
Noise margins: NM_H = V_OH(min) − V_IH(min) ; NM_L = V_IL(max) − V_OL(max) — in volts
Fan-out = I_OL(driver) / I_IL(load)
ROM needed for n inputs and m outputs = 2n words × m bits
CMOS dynamic power P = α C V_DD² f — α = activity factor, C in farads, f in Hz, P in watts

Example 1 — conversions, 2's complement, overflow and BCD.

Example 2 — K-map with don't cares. F(A,B,C,D) = Σm(1,3,7,11,15) with don't cares d(0,2,5).

Example 3 — mux and decoder realisation. F(A,B,C) = Σm(1,2,4,7).

Example 4 — timing and maximum frequency. A synchronous block has t_cq = 1.2 ns, worst-case combinational delay 4.5 ns, t_su = 0.8 ns, clock skew 0.5 ns.

Example 5 — 3-bit synchronous up counter with T flip-flops. States 000→001→…→111→000.

FeatureMealy FSMMoore FSM
Output depends onPresent state + inputPresent state only
States neededUsually fewerUsually more
Output timingSame cycle (faster)One clock later
GlitchesFollows input glitchesRegistered, clean
FeatureTTL (74LS)CMOS (74HC)
Static powerSignificantNear zero
Dynamic powerLower at high f∝ C V² f
Supply5 V ± 5%2–6 V
Noise immunityModerateHigh
Fan-out~20 LS loadsVery high (capacitive limit)
Unused inputsMust be tiedMust be tied (never float)
DeviceAND arrayOR arrayUse
ROM/PROMFixed (all minterms)ProgrammableLook-up tables, code converters
PALProgrammableFixedFast glue logic
PLAProgrammableProgrammableBest term sharing, slower
FPGALUT-based, reconfigurable—Prototyping, low-volume products

Where it is used

Interview questions

Common mistakes

Related topics

Computer organisation and architecture · Discrete mathematics for computing · Theory of computation basics · Microprocessors and embedded systems · VLSI design and HDL (Verilog/VHDL) · Signals and digital electronics (logic families and interfacing)

Open in the Knowledge reader →Find jobs →