These are complete study notes for Unit 2, Digital Logic Design, of Paper I Section (A) in the Nepal Rastra Bank Assistant Director (Information Technology), Officer Third Class, Technical Service open competitive examination. Everything below follows the official syllabus approved on 2080/05/07, sub-topic by sub-topic, from 2.1 right through to 2.10.
Paper I carries 100 marks with a pass mark of 40: 25 multiple-choice questions of 1 mark each in 30 minutes with 0.2 marks deducted for every wrong answer and no calculator, then 9 short questions of 5 marks and 3 long questions of 10 marks in 2 hours 30 minutes. The questions are set in English and your answers must be written in English, so each section here carries an Exam line — a sentence in examination English that you can reproduce as written. The Nepali paragraphs are there to make the idea clear, not to be copied into your answer book.
This is the second unit of four. Unit 1, Computer Architecture and Organization and Microprocessors, is already published, and the arithmetic in section 2.5 below overlaps directly with Booth’s algorithm and IEEE-754 there — revise the two together. If you are also preparing the law component of the same examination, see the notes on the Nepal Rastra Bank Act 2058 and BAFIA 2073.
The same syllabus heading appears in the Assistant Director (Cyber Security) advertisement, and Nepal Bank, Rastriya Banijya Bank and Public Service Commission IT papers cover the same ground, so these notes serve several examinations at once. Syllabus text covered here, exactly as NRB prints it:
| # | Syllabus heading |
|---|---|
| 2.1 | Introduction |
| 2.2 | Digital Logic: Basic, Exclusive and Universal Gates, Positive and Negative Logics |
| 2.3 | Combinational Logic Circuits: Boolean Algebra, K-Map, Minterms and Maxterms, SOP and POS |
| 2.4 | Data Processing Circuits: Adders and Subtractors, Multiplexer and Demultiplexer, Encoders and Decoders, Parity Generators and Checkers, Comparators, ROM and PLDs |
| 2.5 | Arithmetic Circuits: Binary Addition, Subtraction, Signed- and Unsigned Numbers |
| 2.6 | Flip-flops: Latches and Flip-flops, SR, D, T and JK Flip-flops, Flip-flop Conversion, Characteristic Equations, Excitation Tables, Master-slave Flip-flops |
| 2.7 | Registers: Different Types of Flip-flops, SISO, SIPO, PISO, PIPO |
| 2.8 | Counters: Synchronous Counters, Asynchronous Counters, Up/Down Counters, Modulus Counters, Decade Counters, Digital Clock |
| 2.9 | Sequential Machines: Synchronous Machines with Single and Multiple Serial Inputs, Synchronous Machines Design using Different types of Flip-flops, Asynchronous Machine Design Examples |
| 2.10 | Digital Integrated Circuits: BJT and MOSFET as the Switches, RTL and DTL Circuits, TTL Circuits, Integrated Injection Logics (I2L), Emitter-Coupled Logic (ECL), MOS and CMOS Logics, Bi-MOS Logic Circuits |
2.1 Introduction
Analog versus digital
An analog signal is continuous in both time and amplitude — it can take any value inside its range. A digital signal is discrete: it is allowed only a fixed set of values, and in binary digital systems only two, written 0 and 1.
एनालग सिग्नलले दायराभित्रको जुनसुकै मान लिन सक्छ, डिजिटल सिग्नलले भने तोकिएका मान मात्र लिन्छ। बाइनरी प्रणालीमा ती मान दुईवटा मात्र हुन्छन् — ० र १।
Exam line — A digital system represents information by a finite number of discrete levels, whereas an analog system represents it by a continuously variable physical quantity; the two binary levels are implemented as voltage ranges, not exact voltages.
That last clause is the one candidates forget. Logic 0 and logic 1 are ranges. In standard 5 V TTL, any input from 0 V to 0.8 V is read as 0 and anything from 2.0 V to 5 V is read as 1; the band between 0.8 V and 2.0 V is undefined and must not be used in steady state.
Why digital won
| Property | Digital | Analog |
|---|---|---|
| Noise immunity | High — noise smaller than the margin is removed at every gate | Low — noise accumulates and cannot be separated from signal |
| Storage | Exact, unlimited duplication without loss | Degrades on copying and with time |
| Design | Systematic, from Boolean algebra | Component-by-component, device dependent |
| Accuracy | Set by number of bits, extendable | Set by component tolerance |
| Programmability | Yes, same hardware runs different functions | Rarely |
| Power at high speed | Higher switching loss | Often lower |
डिजिटल प्रणालीको सबैभन्दा ठूलो फाइदा noise immunity हो — हरेक गेटले सिग्नललाई पुनः ०/१ मा पुनर्स्थापित गरिदिन्छ, त्यसैले हल्का नोइज आफैँ हराउँछ।
Number systems you must convert fluently
| System | Base | Digits | Use |
|---|---|---|---|
| Binary | 2 | 0, 1 | Internal representation |
| Octal | 8 | 0–7 | Shorthand, 3 bits per digit |
| Decimal | 10 | 0–9 | Human interface |
| Hexadecimal | 16 | 0–9, A–F | Shorthand, 4 bits per digit |
Weighted conversion. A number in base r with digits d is worth the sum of d x r^position. So 1011.101 in binary is 8 + 0 + 2 + 1 + 0.5 + 0 + 0.125 = 11.625.
Decimal to binary. Integer part by repeated division by 2, reading remainders bottom to top. Fraction part by repeated multiplication by 2, reading carries top to bottom.
45 to binary 0.6875 to binary
45 / 2 = 22 r 1 0.6875 x 2 = 1.375 -> 1
22 / 2 = 11 r 0 0.375 x 2 = 0.75 -> 0
11 / 2 = 5 r 1 0.75 x 2 = 1.5 -> 1
5 / 2 = 2 r 1 0.5 x 2 = 1.0 -> 1
2 / 2 = 1 r 0 remainder 0, stop
1 / 2 = 0 r 1
read up: 101101 read down: .1011
45.6875 = 101101.1011Shortcut between binary and octal/hex. Group bits from the binary point outwards — three at a time for octal, four at a time for hexadecimal.
1 0110 1101 1 . 1011 01
binary : 1011011011.101101
hex : 2DB.B4 (0010 1101 1011 . 1011 0100)
octal : 1333.552 (001 011 011 011 . 101 101 000)Binary codes
| Code | Rule | Where it is used |
|---|---|---|
| BCD (8421) | Each decimal digit as 4 bits, 1010–1111 unused | Displays, calculators, financial arithmetic |
| Excess-3 | BCD value + 3 | Self-complementing, older arithmetic units |
| Gray code | Only one bit changes between consecutive values | Shaft encoders, K-map ordering, avoiding glitches |
| ASCII | 7 bits, 128 characters | Text |
| Parity-extended | One extra bit forcing an even or odd count of 1s | Error detection |
Binary to Gray. Keep the MSB; every other Gray bit is the XOR of the two binary bits above it. Gray to binary. Keep the MSB; every other binary bit is the XOR of the previous binary bit and the current Gray bit.
Binary 1 0 1 1 -> Gray 1 1 1 0
\ \ \ (1, 1^0=1, 0^1=1, 1^1=0)
Gray 1 1 1 0 -> Binary 1 0 1 1
(1, 1^1=0, 0^1=1, 1^0=1)ग्रे कोडमा लगातार दुई मानबीच एउटा मात्र बिट फरक पर्छ। त्यसैले मेकानिकल एन्कोडरमा दुई बिट एकैपटक बदलिँदा आउने गलत पढाइ हट्छ।
Exam line — Gray code is a unit-distance, non-weighted, cyclic code in which successive code words differ in exactly one bit position, which eliminates the transient false outputs produced when several bits change simultaneously.
2.2 Digital Logic: gates, universal gates, positive and negative logic
The three basic gates
| Gate | Symbol in algebra | Truth table (A, B) | Statement |
|---|---|---|---|
| AND | A·B or AB | 00→0, 01→0, 10→0, 11→1 | Output 1 only when all inputs are 1 |
| OR | A + B | 00→0, 01→1, 10→1, 11→1 | Output 1 when any input is 1 |
| NOT | A’ or Ā | 0→1, 1→0 | Inverts |
Derived and exclusive gates
| Gate | Expression | Output is 1 when |
|---|---|---|
| NAND | (A·B)’ | Not all inputs are 1 |
| NOR | (A + B)’ | All inputs are 0 |
| XOR | A ⊕ B = A’B + AB’ | Inputs differ (odd number of 1s) |
| XNOR | (A ⊕ B)’ = AB + A’B’ | Inputs are equal (even number of 1s) |
Useful XOR identities, all examinable:
A ^ 0 = A A ^ A = 0 A ^ 1 = A'
A ^ A' = 1 A ^ B = B ^ A associative too
(A ^ B)' = A XNOR B = A ^ B' = A' ^ BXOR लाई “असमान पत्ता लगाउने गेट” भनेर सम्झनुहोस् — दुवै इनपुट फरक भए मात्र १ दिन्छ। XOR ले एउटा इनपुटलाई नियन्त्रित इन्भर्टरजस्तै काम गर्न लगाउन सकिन्छ: A ^ 1 = A’, A ^ 0 = A।
Universal gates
Exam line — NAND and NOR are called universal gates because any Boolean function can be realised using only NAND gates or only NOR gates, since each can produce NOT, AND and OR by itself.
| Function | Using NAND only | Using NOR only |
|---|---|---|
| NOT A | NAND(A, A) | NOR(A, A) |
| A·B | NAND( NAND(A,B), NAND(A,B) ) | NOR( NOR(A,A), NOR(B,B) ) |
| A + B | NAND( NAND(A,A), NAND(B,B) ) | NOR( NOR(A,B), NOR(A,B) ) |
Counts worth memorising: XOR needs 4 NAND gates (or 5 NOR gates), XNOR needs 5 NAND gates (or 4 NOR gates). A half adder is 5 NAND gates; a full adder is 9 NAND gates.
परीक्षामा “XOR लाई कति वटा NAND गेटले बनाउन सकिन्छ?” भन्ने प्रश्न पटक-पटक आउँछ। उत्तर ४ हो।
Positive and negative logic
The electrical circuit does not know about 1 and 0 — we assign them.
| Convention | High voltage means | Low voltage means |
|---|---|---|
| Positive logic | 1 | 0 |
| Negative logic | 0 | 1 |
Exam line — A given physical gate performs a different logical function under the two conventions: a positive-logic AND gate is a negative-logic OR gate, and a positive-logic NAND gate is a negative-logic NOR gate. This correspondence is the duality principle applied to the assignment of logic levels.
एउटै भौतिक सर्किटले positive logic मा AND गर्छ भने negative logic मा OR गर्छ। यो नै ड्युअलिटीको व्यावहारिक रूप हो।
| Same hardware | Positive logic | Negative logic |
|---|---|---|
| Circuit 1 | AND | OR |
| Circuit 2 | OR | AND |
| Circuit 3 | NAND | NOR |
| Circuit 4 | NOR | NAND |
Logic level parameters
| Parameter | Meaning |
|---|---|
| V_OH | Minimum voltage the output guarantees for logic 1 |
| V_OL | Maximum voltage the output guarantees for logic 0 |
| V_IH | Minimum voltage the input will accept as logic 1 |
| V_IL | Maximum voltage the input will accept as logic 0 |
| Noise margin high | NM_H = V_OH − V_IH |
| Noise margin low | NM_L = V_IL − V_OL |
For standard TTL: V_OH = 2.4 V, V_IH = 2.0 V, V_IL = 0.8 V, V_OL = 0.4 V, so NM_H = NM_L = 0.4 V.
2.3 Combinational logic circuits
A combinational circuit’s output depends only on the present inputs. It has no memory and no feedback path. Everything in 2.3 and 2.4 is combinational; memory appears only from 2.6 onwards.
Boolean algebra — the laws
| Law | OR form | AND form |
|---|---|---|
| Identity | A + 0 = A | A · 1 = A |
| Null / dominance | A + 1 = 1 | A · 0 = 0 |
| Idempotent | A + A = A | A · A = A |
| Complement | A + A’ = 1 | A · A’ = 0 |
| Involution | (A’)’ = A | — |
| Commutative | A + B = B + A | AB = BA |
| Associative | A + (B + C) = (A + B) + C | A(BC) = (AB)C |
| Distributive | A + BC = (A + B)(A + C) | A(B + C) = AB + AC |
| Absorption | A + AB = A | A(A + B) = A |
| Redundancy | A + A’B = A + B | A(A’ + B) = AB |
| De Morgan | (A + B)’ = A’B’ | (AB)’ = A’ + B’ |
| Consensus | AB + A’C + BC = AB + A’C | (A+B)(A’+C)(B+C) = (A+B)(A’+C) |
Two that catch people out: A + A'B = A + B (not A+B’), and the consensus term BC is redundant and can be deleted.
Boolean algebra मा सबैभन्दा धेरै प्रयोग हुने दुई नियम absorption (A + AB = A) र redundancy (A + A’B = A + B) हुन्। सरलीकरणका प्रश्नमा पहिले यिनै खोज्नुहोस्।
Duality principle. Swap AND with OR and 0 with 1 and a valid identity stays valid. The dual is not the complement — De Morgan gives the complement, duality gives a second theorem.
Exam line — De Morgan’s theorems state that the complement of a sum equals the product of the complements and the complement of a product equals the sum of the complements; they allow any AND-OR network to be converted into a NAND-only or NOR-only network.
Minterms and maxterms
For n variables there are 2^n minterms and 2^n maxterms.
- A minterm (m_i) is an AND of all variables, each either plain or complemented; it is 1 for exactly one input combination.
- A maxterm (M_i) is an OR of all variables; it is 0 for exactly one input combination.
- They are complements of each other: M_i = (m_i)’.
| A B C | Minterm | Expression | Maxterm | Expression |
|---|---|---|---|---|
| 0 0 0 | m0 | A’B’C’ | M0 | A + B + C |
| 0 0 1 | m1 | A’B’C | M1 | A + B + C’ |
| 0 1 0 | m2 | A’BC’ | M2 | A + B’ + C |
| 0 1 1 | m3 | A’BC | M3 | A + B’ + C’ |
| 1 0 0 | m4 | AB’C’ | M4 | A’ + B + C |
| 1 0 1 | m5 | AB’C | M5 | A’ + B + C’ |
| 1 1 0 | m6 | ABC’ | M6 | A’ + B’ + C |
| 1 1 1 | m7 | ABC | M7 | A’ + B’ + C’ |
The rule for writing them: in a minterm, a variable that is 0 appears complemented; in a maxterm, a variable that is 1 appears complemented. That inversion is the single most common slip in the exam.
SOP and POS
Canonical SOP is the OR of the minterms for which the function is 1, written F(A,B,C) = Σm(1,3,5,7). Canonical POS is the AND of the maxterms for which the function is 0, written F(A,B,C) = ΠM(0,2,4,6).
The two lists are complementary — every index appears in exactly one of them.
F(A,B,C) = Sm(1,2,4,7) = PM(0,3,5,6)
F'(A,B,C) = Sm(0,3,5,6) = PM(1,2,4,7)Σm मा जुन index छैनन्, ती सबै ΠM मा आउँछन्। यो सम्बन्ध सम्झिए रूपान्तरण सेकेन्डमा गर्न सकिन्छ।
Karnaugh maps
A K-map is the truth table redrawn so that physically adjacent squares differ in exactly one variable — the rows and columns are labelled in Gray code order (00, 01, 11, 10), never in binary order. That adjacency is what lets a group of squares collapse into a smaller product term.
4-variable K-map, cell numbers (AB across, CD down)
CD=00 01 11 10
AB=00 | 0 | 1 | 3 | 2 |
AB=01 | 4 | 5 | 7 | 6 |
AB=11 | 12 | 13 | 15 | 14 |
AB=10 | 8 | 9 | 11 | 10 |Grouping rules
- Groups must contain 1, 2, 4, 8, … cells — a power of two.
- Groups are rectangles, horizontally or vertically, never diagonal.
- The map wraps around: left edge touches right edge, top touches bottom, and the four corners form one group.
- Make every group as large as possible, then use as few groups as possible.
- Every 1 must be covered at least once; overlapping is allowed and often necessary.
- A group of 2^k cells eliminates k variables.
| Group size (4-variable map) | Variables in the term |
|---|---|
| 1 cell | 4 |
| 2 cells | 3 |
| 4 cells | 2 |
| 8 cells | 1 |
| 16 cells | 0 (F = 1) |
Worked minimisation. F(A,B,C,D) = Σm(0,1,2,5,8,9,10)
CD=00 01 11 10
AB=00 | 1 | 1 | 0 | 1 |
AB=01 | 0 | 1 | 0 | 0 |
AB=11 | 0 | 0 | 0 | 0 |
AB=10 | 1 | 1 | 0 | 1 |- Cells 0, 1, 8, 9 (corners of the top and bottom rows, columns 00 and 01) → B’C’
- Cells 0, 2, 8, 10 (columns 00 and 10, rows 00 and 10) → B’D’
- Cells 1, 5, 9, 13? 13 is 0, so instead cells 1, 5 → A’C’D
F = B’C’ + B’D’ + A’C’D
समूह बनाउँदा सधैँ सबैभन्दा ठूलो समूहबाट सुरु गर्नुहोस्, अनि कुनै १ छुटेको छ कि हेर्नुहोस्। कुनाका चार सेल एउटै समूह बन्छन् भन्ने कुरा नबिर्सनुहोस्।
Don’t-care conditions are input combinations that can never occur, or whose output nobody uses — written d or X and listed as Σd(…). Treat each X as 1 if it enlarges a group, otherwise as 0. They are free simplification.
Prime implicant — a product term that cannot be combined further. Essential prime implicant — a prime implicant that covers at least one 1 covered by no other prime implicant. Every essential prime implicant must appear in the minimal expression.
For five or more variables, or for machine solution, use the Quine–McCluskey tabular method: list minterms by number of 1s, combine terms differing in one bit, mark combined terms, collect unmarked terms as prime implicants, then pick a minimum cover with a prime-implicant chart. It is systematic and programmable where the K-map is visual and tops out at about six variables.
2.4 Data processing circuits
Half adder and full adder
| Circuit | Inputs | Outputs | Equations |
|---|---|---|---|
| Half adder | A, B | Sum, Carry | S = A ⊕ B, C = A·B |
| Full adder | A, B, C_in | Sum, C_out | S = A ⊕ B ⊕ C_in, C_out = AB + C_in(A ⊕ B) |
C_out can also be written AB + BC_in + AC_in — the majority function. Both forms are accepted; the first is cheaper because it reuses the A ⊕ B already computed for the sum.
Full adder from two half adders
A ---|HA1|--- S1 ---|HA2|--- SUM
B ---| |--- C1 | |--- C2
Cin ----------------| |
CARRY = C1 + C2एउटा full adder लाई दुई half adder र एउटा OR गेटले बनाउन सकिन्छ। NAND मात्र प्रयोग गर्दा ९ वटा NAND चाहिन्छ।
Ripple-carry and carry-look-ahead adders
An n-bit ripple-carry adder is n full adders chained carry-out to carry-in. Simple, but the carry has to propagate through every stage, so worst-case delay is n x (delay of one full adder) — the circuit is slow and the delay grows linearly.
A carry-look-ahead adder computes all carries directly from the inputs:
Generate : G_i = A_i . B_i
Propagate: P_i = A_i ^ B_i
Carry : C_{i+1} = G_i + P_i . C_i
Expanded:
C1 = G0 + P0.C0
C2 = G1 + P1.G0 + P1.P0.C0
C3 = G2 + P2.G1 + P2.P1.G0 + P2.P1.P0.C0
C4 = G3 + P3.G2 + P3.P2.G1 + P3.P2.P1.G0 + P3.P2.P1.P0.C0Exam line — A carry-look-ahead adder reduces addition time from O(n) to a constant two gate delays for the carry network by generating every carry in parallel from the generate and propagate signals, at the cost of substantially more gates and higher fan-in.
Subtractors
| Circuit | Equations |
|---|---|
| Half subtractor (A − B) | Difference = A ⊕ B, Borrow = A’·B |
| Full subtractor (A − B − B_in) | D = A ⊕ B ⊕ B_in, B_out = A’B + B_in(A ⊕ B)’ |
In practice nobody builds subtractors. Adder–subtractor: feed B through XOR gates controlled by a mode line M, and connect M to the first carry-in. M = 0 gives A + B; M = 1 gives A + B’ + 1 = A − B in 2’s complement. One circuit, both operations.
व्यवहारमा छुट्टै subtractor बनाइँदैन — XOR गेट र mode line M प्रयोग गरेर एउटै adder लाई adder/subtractor बनाइन्छ।
Multiplexer
A multiplexer (data selector) routes one of 2^n inputs to a single output, chosen by n select lines.
| MUX | Data inputs | Select lines |
|---|---|---|
| 2:1 | 2 | 1 |
| 4:1 | 4 | 2 |
| 8:1 | 8 | 3 |
| 16:1 | 16 | 4 |
4:1 MUX output equation
Y = S1'S0'I0 + S1'S0 I1 + S1 S0' I2 + S1 S0 I3Function implementation with a MUX is a standard 5-mark question. A 2^n:1 MUX implements any n-variable function directly by tying each data input to 0 or 1. Better, a 2^(n−1):1 MUX implements any n-variable function by using n−1 variables as selects and feeding each data input with 0, 1, the last variable, or its complement.
Implement F(A,B,C) = Sm(1,2,6,7) with a 4:1 MUX, selects A and B
A B | C=0 C=1 | minterms | data input
0 0 | 0 1 | m0=0 m1=1| I0 = C
0 1 | 1 0 | m2=1 m3=0| I1 = C'
1 0 | 0 0 | m4=0 m5=0| I2 = 0
1 1 | 1 1 | m6=1 m7=1| I3 = 1Other uses of a MUX: parallel-to-serial conversion, data routing, logic function generation, and as a building block inside FPGAs.
Demultiplexer and decoder
A demultiplexer is the reverse of a MUX: one input, n select lines, 2^n outputs; the input is steered to the selected output while the others stay inactive.
A decoder converts an n-bit code into one active line out of 2^n. An n-to-2^n decoder with an enable input is a 1-to-2^n demultiplexer — the enable line acts as the data input. That equivalence is examinable.
Exam line — A decoder with an enable input and a demultiplexer are the same circuit; when the enable pin is used as the data line, the decoder’s address inputs become the demultiplexer’s select lines.
Since a decoder output is a minterm, any SOP function can be built from one decoder plus an OR gate — and with an active-low decoder, plus a NAND gate.
F(A,B,C) = Sm(1,3,5) using a 3-to-8 decoder
D1, D3, D5 -> OR gate -> FEncoder and priority encoder
An encoder does the opposite of a decoder: 2^n input lines, n output bits. An 8-to-3 encoder outputs the binary index of whichever input is high.
Plain encoders have two defects: the output is ambiguous if two inputs are high at once, and an all-zero input looks identical to input 0 being active. A priority encoder fixes the first by responding to the highest-numbered active input, and adds a valid output to fix the second.
साधारण encoder मा दुईवटा इनपुट एकैपटक उच्च भए आउटपुट गलत हुन्छ। Priority encoder ले सबैभन्दा उच्च प्राथमिकताको इनपुट मात्र लिन्छ र valid आउटपुट पनि दिन्छ।
Parity generators and checkers
Parity adds one redundant bit so that the total number of 1s is even (even parity) or odd (odd parity).
- Generator at the transmitter: for even parity, P = XOR of all data bits. For odd parity, P = XNOR of all data bits (that is, the complement).
- Checker at the receiver: XOR all received bits including the parity bit. For even parity a result of 0 means no error was detected; 1 means an error.
Exam line — A single parity bit detects any odd number of bit errors but cannot detect an even number of errors and cannot correct any error; error correction requires multiple check bits, as in a Hamming code.
Magnitude comparator
A comparator produces A > B, A = B and A < B.
1-bit comparator
A = B : A XNOR B = A.B + A'.B'
A > B : A . B'
A < B : A'. B
4-bit equality
(A3 XNOR B3).(A2 XNOR B2).(A1 XNOR B1).(A0 XNOR B0)For “greater than”, compare from the most significant bit downwards: A > B if A3B3′ is true, or if A3 equals B3 and A2B2′ is true, and so on. The standard MSI part is the 7485 4-bit magnitude comparator, which has cascading inputs so several chips can be chained for wider words.
ROM and programmable logic devices
A ROM is a decoder followed by a programmable OR array: an n-input, m-output ROM stores 2^n words of m bits and can realise any set of m functions of n variables.
| Device | AND array | OR array | Comment |
|---|---|---|---|
| PROM | Fixed (full decoder) | Programmable | Every minterm is generated whether needed or not |
| PLA | Programmable | Programmable | Most flexible, slowest, hardest to program |
| PAL | Programmable | Fixed | Cheaper and faster than PLA; the usual choice |
तीनवटा सम्झने सजिलो तरिका — PROM: AND fixed, OR programmable। PAL: AND programmable, OR fixed। PLA: दुवै programmable।
| ROM type | Written by | Erased by |
|---|---|---|
| Mask ROM | Manufacturer | Not erasable |
| PROM | User, once, by blowing fuses | Not erasable |
| EPROM | User, electrically | Ultraviolet light, whole chip |
| EEPROM | User, electrically | Electrically, byte by byte |
| Flash | User, electrically | Electrically, block by block |
Exam line — A ROM of n address lines and m data lines realises m Boolean functions of n variables with no minimisation required, because the decoder generates all 2^n minterms and the programmable OR plane selects those needed for each output.
2.5 Arithmetic circuits
Unsigned binary arithmetic
Addition rules Subtraction rules
0 + 0 = 0 0 - 0 = 0
0 + 1 = 1 1 - 0 = 1
1 + 0 = 1 1 - 1 = 0
1 + 1 = 0 carry 1 0 - 1 = 1 borrow 1 1 0 1 1 0 1 (45)
+ 0 1 1 0 1 1 (27)
-------------
1 0 0 1 0 0 0 (72)An n-bit unsigned number spans 0 to 2^n − 1. An 8-bit unsigned byte holds 0 to 255.
Signed representations
| Method | +5 in 4 bits | −5 in 4 bits | Range (n bits) | Zeros |
|---|---|---|---|---|
| Signed magnitude | 0101 | 1101 | −(2^(n−1) − 1) to +(2^(n−1) − 1) | Two (+0, −0) |
| 1’s complement | 0101 | 1010 | −(2^(n−1) − 1) to +(2^(n−1) − 1) | Two |
| 2’s complement | 0101 | 1011 | −2^(n−1) to +(2^(n−1) − 1) | One |
Exam line — Two’s complement is universally used because it has a single representation of zero, the same hardware adds signed and unsigned numbers, and subtraction is performed by adding the two’s complement of the subtrahend, so no separate subtractor is required.
2’s complement नै सबै कम्प्युटरले प्रयोग गर्ने कारण — शून्यको एउटै रूप हुन्छ, र जोड्ने उही सर्किटले घटाउ पनि गर्छ।
Finding the 2’s complement. Invert every bit and add 1; or, scanning from the LSB, copy bits up to and including the first 1 and invert everything above it.
0110100 (52)
1001011 invert
+ 1
1001100 = -52 in 2's complement
Shortcut: 0110100 -> copy "100", invert "0110" -> 1001 100Subtraction by complement
Compute 45 - 27 in 8-bit 2's complement
45 = 0010 1101
27 = 0001 1011
-27 = 1110 0101 (invert 0001 1011 -> 1110 0100, +1)
0010 1101
+ 1110 0101
-----------
1 0001 0010 discard the final carry
0001 0010 = 18 correctIn 2’s complement, a carry out of the sign position is simply discarded. In 1’s complement, that carry must be added back into the LSB — the end-around carry. This difference is a favourite one-mark question.
Overflow
Overflow means the true result does not fit in the available bits. For unsigned addition, overflow is signalled by the carry out. For signed 2’s-complement addition, the carry out means nothing; overflow has occurred when:
- two positives give a negative, or two negatives give a positive; equivalently
- carry into the sign bit differs from carry out of the sign bit (V = C_n ⊕ C_(n−1)).
4-bit signed: 0101 (+5) + 0100 (+4) = 1001 (-7)
Cin to sign = 1, Cout of sign = 0 -> V = 1, overflowSigned arithmetic मा carry out ले overflow जनाउँदैन। Sign bit भित्र जाने र बाहिर आउने carry फरक भए मात्र overflow हुन्छ।
BCD addition
Add as binary. If any 4-bit group exceeds 1001 (9) or produces a carry out of the group, add 0110 (6) to that group and propagate the carry.
0101 (5)
+ 1000 (8)
------
1101 = 13, invalid BCD
+ 0110 add 6
------
1 0011 = 1 3 correct BCDBinary multiplication and division
Multiplication is shift and add: for each 1 in the multiplier, add the multiplicand shifted left by that bit position. An n-bit by n-bit product needs 2n bits. Signed multiplication uses Booth’s algorithm (covered in Unit 1 notes). Division is repeated shift and subtract, by restoring or non-restoring algorithms.
2.6 Flip-flops
A sequential circuit has outputs that depend on the present inputs and on the stored past — it contains memory and feedback. Everything from here to 2.9 is sequential.
Latch versus flip-flop
| Latch | Flip-flop | |
|---|---|---|
| Control | Level-triggered (transparent while enable is active) | Edge-triggered (changes only on a clock edge) |
| Output follows input | Continuously while enabled | Only at the rising or falling edge |
| Built from | Cross-coupled gates | Two latches, or edge-detection logic |
| Use | Simple storage, buses | Synchronous design, counters, registers |
Exam line — A latch is level-sensitive and is transparent for the whole duration of the active enable level, whereas a flip-flop is edge-sensitive and samples its input only at the clock transition, which is what makes reliable synchronous design possible.
Latch ले enable उच्च भएसम्म इनपुट पास गरिरहन्छ; flip-flop ले क्लकको किनारा (edge) मा मात्र मान लिन्छ। त्यसैले synchronous design मा flip-flop नै प्रयोग गरिन्छ।
SR latch and SR flip-flop
NOR SR latch NAND SR latch (active low)
S=0,R=0 -> no change S'=1,R'=1 -> no change
S=0,R=1 -> Q=0 (reset) S'=1,R'=0 -> Q=0
S=1,R=0 -> Q=1 (set) S'=0,R'=1 -> Q=1
S=1,R=1 -> invalid S'=0,R'=0 -> invalid| S | R | Q(next) | Comment |
|---|---|---|---|
| 0 | 0 | Q | Hold |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | ? | Forbidden — both outputs go to the same level and the next state is unpredictable |
Characteristic equation: Q(next) = S + R’Q, with the constraint S·R = 0.
D flip-flop
The D (data or delay) flip-flop removes the forbidden state by tying R to S’. Whatever is on D at the clock edge appears at Q.
| D | Q(next) |
|---|---|
| 0 | 0 |
| 1 | 1 |
Characteristic equation: Q(next) = D.
JK flip-flop
The JK flip-flop makes the forbidden combination useful: J = K = 1 toggles the output.
| J | K | Q(next) | Operation |
|---|---|---|---|
| 0 | 0 | Q | Hold |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Q’ | Toggle |
Characteristic equation: Q(next) = J·Q’ + K’·Q.
T flip-flop
A JK with J and K tied together. T = 0 holds, T = 1 toggles.
Characteristic equation: Q(next) = T ⊕ Q = T·Q’ + T’·Q.
Characteristic equations — summary table
| Flip-flop | Characteristic equation |
|---|---|
| SR | Q(next) = S + R’Q, SR = 0 |
| D | Q(next) = D |
| JK | Q(next) = JQ’ + K’Q |
| T | Q(next) = T ⊕ Q |
यी चार समीकरण कण्ठ हुनुपर्छ। Sequential circuit को analysis मा यिनै प्रयोग हुन्छन्।
Excitation tables
The characteristic table answers “given the inputs, what is the next state?” The excitation table answers the design question: “given the state change I want, what inputs must I apply?” Every counter and state-machine design in 2.8 and 2.9 starts from this table.
| Q | Q(next) | S R | J K | D | T |
|---|---|---|---|---|---|
| 0 | 0 | 0 X | 0 X | 0 | 0 |
| 0 | 1 | 1 0 | 1 X | 1 | 1 |
| 1 | 0 | 0 1 | X 1 | 0 | 1 |
| 1 | 1 | X 0 | X 0 | 1 | 0 |
X is a don’t-care and is pure profit in the K-map. Note that JK has the most don’t-cares — two per row — which is exactly why JK designs usually give the simplest input equations.
Exam line — The excitation table lists the flip-flop input values required to produce each present-state to next-state transition; it is the inverse of the characteristic table and is the starting point for sequential circuit design.
Flip-flop conversion
The method is always the same, four steps:
- Write the truth table of the required flip-flop (present state Q, its inputs, next state).
- From the excitation table of the available flip-flop, write the inputs needed for each transition.
- K-map those inputs against Q and the required flip-flop’s inputs.
- Draw the circuit.
JK to D. Required: Q(next) = D.
| D | Q | Q(next) | J | K |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | X |
| 0 | 1 | 0 | X | 1 |
| 1 | 0 | 1 | 1 | X |
| 1 | 1 | 1 | X | 0 |
From the maps: J = D, K = D’.
JK to T. J = T, K = T. D to T. D = T ⊕ Q. D to JK. D = JQ’ + K’Q. SR to D. S = D, R = D’. T to D. T = D ⊕ Q.
रूपान्तरणका यी छवटा नतिजा सिधै सम्झे पनि हुन्छ, तर परीक्षामा तालिका र K-map देखाएर निकाल्नु राम्रो — त्यसैमा अंक छ।
Race around and master–slave
In a level-triggered JK latch with J = K = 1, if the clock pulse width is longer than the propagation delay, the output toggles repeatedly for as long as the clock is high and its final value is unpredictable. That is the race-around condition. Formally it occurs when t_pulse > t_pd.
Three fixes:
- Make the clock pulse narrower than the propagation delay — impractical.
- Use a master–slave flip-flop.
- Use genuine edge triggering.
A master–slave flip-flop is two latches in series driven by complementary clocks. While the clock is high the master follows the inputs and the slave is isolated; when the clock falls the master is frozen and the slave copies it. The output therefore changes only once per clock cycle, at the falling edge.
Exam line — A master–slave flip-flop eliminates the race-around condition because the master and the slave are never enabled at the same time, so the output can change at most once per clock period.
Master ले क्लक उच्च हुँदा इनपुट लिन्छ, slave ले क्लक घट्दा त्यो मान बाहिर निकाल्छ — त्यसैले एक क्लकमा एकपटक मात्र आउटपुट बदलिन्छ, race-around हट्छ।
Timing parameters
| Term | Meaning |
|---|---|
| Setup time (t_su) | Input must be stable before the clock edge |
| Hold time (t_h) | Input must stay stable after the clock edge |
| Propagation delay (t_pd) | Clock edge to output change |
| Maximum frequency | f_max = 1 / (t_pd + t_su + combinational delay) |
Violating setup or hold pushes the flip-flop into metastability, where the output hovers between levels for an unbounded time before settling arbitrarily. Synchronisers — two flip-flops in series — reduce, but never eliminate, the probability.
Asynchronous inputs
PRESET and CLEAR (also called direct set and direct reset) override the clock entirely. They are used to initialise a circuit at power-on and must not be used as part of normal synchronous operation.
2.7 Registers
A register is a group of flip-flops sharing a clock, holding one n-bit word. A shift register also moves data one position per clock.
The four shift register types
| Type | Full name | Input | Output | Clocks to load | Clocks to read |
|---|---|---|---|---|---|
| SISO | Serial-In Serial-Out | 1 line, serial | 1 line, serial | n | n |
| SIPO | Serial-In Parallel-Out | 1 line, serial | n lines at once | n | 1 |
| PISO | Parallel-In Serial-Out | n lines at once | 1 line, serial | 1 | n |
| PIPO | Parallel-In Parallel-Out | n lines at once | n lines at once | 1 | 1 |
SIPO = serial लाई parallel बनाउने, PISO = parallel लाई serial बनाउने। UART मा ठ्याक्कै यिनै दुई प्रयोग हुन्छन् — पठाउँदा PISO, पाउँदा SIPO।
Exam line — A SIPO register performs serial-to-parallel conversion and a PISO register performs parallel-to-serial conversion; together they form the core of every serial communication interface, such as a UART or an SPI port.
A 4-bit SISO built from D flip-flops is simply D1 ← Serial_in, D2 ← Q1, D3 ← Q2, D4 ← Q3. Data entered first emerges after 4 clock pulses — the register is also a digital delay line of n clock periods.
Universal shift register
A universal shift register can shift left, shift right, load in parallel, and hold, selected by two mode bits — built by putting a 4:1 MUX in front of every flip-flop.
| S1 | S0 | Operation |
|---|---|---|
| 0 | 0 | Hold |
| 0 | 1 | Shift right |
| 1 | 0 | Shift left |
| 1 | 1 | Parallel load |
The standard part is the 74194 4-bit bidirectional universal shift register.
Ring and Johnson counters
| Counter | Connection | States for n flip-flops | Initialisation |
|---|---|---|---|
| Ring | Q_last → D_first | n | Needs one 1 preset |
| Johnson (twisted ring) | Q’_last → D_first | 2n | Starts from all zeros |
4-bit ring counter : 1000 -> 0100 -> 0010 -> 0001 -> 1000 (4 states)
4-bit Johnson : 0000 -> 1000 -> 1100 -> 1110 -> 1111
-> 0111 -> 0011 -> 0001 -> 0000 (8 states)A ring counter needs no output decoding at all — each state is already a one-hot output. A Johnson counter gives twice the states and each state can be decoded with a single 2-input gate.
Other register uses
Shifting left by one position multiplies by 2; shifting right by one divides by 2. An arithmetic right shift copies the sign bit to preserve the sign; a logical right shift brings in 0. Shift registers also build serial adders, sequence generators, pseudo-random generators (LFSRs) and time delays.
2.8 Counters
A counter is a register that passes through a prescribed sequence of states on successive clock pulses.
Asynchronous (ripple) counters
Only the first flip-flop sees the system clock; every other flip-flop is clocked by the previous stage’s output. All flip-flops are wired to toggle (JK with J = K = 1, or T with T = 1).
3-bit ripple up-counter, negative edge triggered
CLK ->|FF0|-- Q0 ->|FF1|-- Q1 ->|FF2|-- Q2
T=1 T=1 T=1
Sequence: 000 001 010 011 100 101 110 111 000 ...For a down counter, clock each stage from Q’ instead of Q (for negative-edge devices).
Exam line — In an asynchronous counter the flip-flops do not change state simultaneously; the clock ripples through the chain, so the worst-case settling time is n x t_pd and transient false counts appear at the outputs, which limits the maximum usable frequency and makes direct output decoding unsafe.
Ripple counter सस्तो र सजिलो छ तर ढिलो छ — हरेक stage ले अघिल्लोलाई कुर्नुपर्छ, त्यसैले n वटा flip-flop भए n गुणा ढिलाइ हुन्छ र बीचमा क्षणिक गलत मान देखिन्छ।
Synchronous counters
Every flip-flop receives the same clock simultaneously; the inputs decide which ones toggle. Settling time is one t_pd regardless of width, and no false states appear.
The toggle condition for an up-counter is: a stage toggles when all lower stages are 1.
4-bit synchronous binary up counter
T0 = 1
T1 = Q0
T2 = Q0.Q1
T3 = Q0.Q1.Q2| Asynchronous | Synchronous | |
|---|---|---|
| Clock | Rippled through stages | Common to all |
| Speed | Slow, n x t_pd | Fast, one t_pd |
| Glitches | Yes, transient false states | No |
| Gates needed | Almost none | Extra AND gates |
| Design | Trivial | Systematic, from excitation tables |
Designing a synchronous counter — the six steps
- Draw the state diagram of the required sequence.
- Write the state table: present state → next state.
- Choose a flip-flop and fill in its excitation values for every transition.
- K-map each flip-flop input against the present-state variables.
- Write the simplified input equations.
- Draw the circuit, and check that unused states recover into the sequence (self-starting).
Worked design — mod-5 synchronous up-counter with JK flip-flops (000 → 100, then back to 000).
| 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 | 0 0 0 | X 1 | 0 X | 0 X |
States 101, 110, 111 are unused — enter them as don’t-cares.
J0 = Q2' K0 = 1
J1 = Q0 K1 = Q0
J2 = Q1.Q0 K2 = 1Modulus counters
The modulus is the number of distinct states. An n-flip-flop binary counter has modulus 2^n, so a mod-N counter needs n = ceil(log2 N) flip-flops.
Two ways to build mod-N from a binary counter:
- Asynchronous reset. Feed the state N (the first unwanted state) into a NAND gate whose output drives CLEAR. The counter enters N for a few nanoseconds and is wiped — simple, but it produces a glitch and depends on the reset path’s timing.
- Synchronous design. Design the sequence properly from the excitation table, as above. No glitch.
Mod-10 (decade) counter by reset:
reset when the count reaches 1010 -> NAND(Q3, Q1) -> CLEARMod-N काउन्टर बनाउन सबैभन्दा सजिलो तरिका — N आउनेबित्तिकै CLEAR हान्ने। तर यसले क्षणिक glitch दिन्छ; परीक्षामा यो सीमितता लेख्न नबिर्सनुहोस्।
Decade counters and the digital clock
A decade counter counts 0000 to 1001 and returns to 0000 — modulus 10, four flip-flops, six unused states. The classic part is the 7490, internally a divide-by-2 and a divide-by-5 that can be cascaded.
A digital clock is the standard long-answer question on this topic. The chain is:
Crystal oscillator 32,768 Hz
-> divide by 2^15 (15 flip-flops) -> 1 Hz
-> mod-10 + mod-6 counters -> SECONDS (00-59)
-> carry at 59 -> mod-10 + mod-6 -> MINUTES (00-59)
-> carry at 59 -> mod-10 + mod-3 (with reset logic) -> HOURS (00-23 or 01-12)
-> each decade -> BCD-to-7-segment decoder (7447) -> displaySeconds and minutes each need a mod-60 stage, built as a mod-10 units counter cascaded with a mod-6 tens counter. Hours need mod-24 — a mod-10 units counter and a mod-3 tens counter with extra logic that resets both when 24 is reached.
Exam line — A digital clock divides a crystal reference down to one pulse per second and then cascades modulus counters — two mod-60 chains for seconds and minutes and one mod-24 chain for hours — each decade driving a BCD-to-seven-segment decoder.
Up/down counters
A single mode line M selects direction. For a synchronous up/down counter the toggle input of each stage becomes:
T_i = M . (AND of all lower Q) + M' . (AND of all lower Q')so with M = 1 the stage toggles when all lower bits are 1 (counting up) and with M = 0 when all lower bits are 0 (counting down).
2.9 Sequential machines
Mealy and Moore
| Moore machine | Mealy machine | |
|---|---|---|
| Output depends on | Present state only | Present state and present input |
| Output appears | Synchronised to the clock, one cycle later | Immediately when the input changes |
| States needed | Usually more | Usually fewer |
| Output glitches | No | Possible, since inputs are asynchronous |
| Drawn on the diagram | Inside the state bubble | On the transition arrow |
Exam line — In a Moore machine the output is a function of the present state alone and is therefore synchronous and glitch-free, whereas in a Mealy machine the output is a function of both the present state and the present input, which gives a faster response and fewer states but can produce transient outputs.
Moore मा आउटपुट state भित्र लेखिन्छ, Mealy मा तीरमाथि input/output रूपमा। Mealy छिटो हुन्छ तर glitch आउन सक्छ; Moore ढिलो तर स्थिर।
The general model
+------------------+
inputs ->| next-state logic |-> D/JK inputs -> | state |
+------------------+ | register |
^ +-----------+
| |
+------------- present state ------+
|
+---------------+
| output logic |-> outputs
+---------------+A Mealy machine has the inputs feeding the output logic too; a Moore machine does not.
Design procedure for a synchronous machine
- Read the word problem and draw the state diagram, naming states by what has been seen so far.
- Write the state table.
- Reduce equivalent states if asked (two states are equivalent when, for every input, they give the same output and go to equivalent states).
- Assign binary codes to states — n states need ceil(log2 n) flip-flops.
- Build the transition and excitation table for the chosen flip-flop.
- K-map and simplify every flip-flop input and every output.
- Draw the circuit and verify that unused states return to a valid state.
Worked example — 101 sequence detector, overlapping, Mealy, D flip-flops
States: S0 = nothing yet, S1 = seen “1”, S2 = seen “10”.
| Present | x = 0 | x = 1 |
|---|---|---|
| S0 | S0 / 0 | S1 / 0 |
| S1 | S2 / 0 | S1 / 0 |
| S2 | S0 / 0 | S1 / 1 |
Assign S0 = 00, S1 = 01, S2 = 10.
| Q1 Q0 | x | Q1+ Q0+ | Z | D1 | D0 |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 0 | 1 |
| 0 1 | 0 | 1 0 | 0 | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | 0 | 1 |
| 1 0 | 0 | 0 0 | 0 | 0 | 0 |
| 1 0 | 1 | 0 1 | 1 | 0 | 1 |
D1 = Q1'.Q0.x'
D0 = x
Z = Q1.Q0'.xBecause this is an overlapping detector, after recognising 101 the machine returns to S1, not S0 — the final 1 is reused as the first 1 of the next pattern. A non-overlapping detector would return to S0 and needs one more state.
Overlapping detector मा ढाँचा भेटिएपछि अन्तिम बिटलाई अर्को ढाँचाको सुरुवात मानिन्छ। यही कुराले state diagram फरक पार्छ — परीक्षामा प्रश्नले overlapping भनेको छ कि छैन ध्यान दिनुहोस्।
Multiple serial inputs
With two serial inputs x1 and x2 the only change is that each state now has four outgoing arrows, one per input combination 00, 01, 10, 11, and the state table has four next-state columns. The design steps are unchanged. A serial adder is the standard example: two serial data streams, one state bit holding the carry, Moore or Mealy output giving the sum bit.
Serial adder as a 2-state Mealy machine
State C=0 : x1x2 = 00 -> C=0, S=0 | 01 -> C=0, S=1 | 10 -> C=0, S=1 | 11 -> C=1, S=0
State C=1 : x1x2 = 00 -> C=0, S=1 | 01 -> C=1, S=0 | 10 -> C=1, S=0 | 11 -> C=1, S=1Design using different flip-flop types
The same state table can be implemented with any flip-flop; only step 5 changes.
| Flip-flop | What to write in the excitation columns | Typical result |
|---|---|---|
| D | D = next state, directly | No simplification needed, more gates in next-state logic |
| T | T = Q ⊕ Q(next) | Good for counters |
| JK | Two columns with many don’t-cares | Usually the fewest gates |
| SR | Two columns, constraint SR = 0 | Rare in modern design |
Asynchronous sequential machines
An asynchronous machine has no clock. The state is held in feedback loops whose delay is the only memory, so the circuit responds as soon as an input changes.
Key vocabulary:
| Term | Meaning |
|---|---|
| Fundamental mode | Only one input may change at a time, and only after the circuit has settled |
| Primitive flow table | One stable state per row |
| Stable state | Next state equals present state |
| Race | Two or more state variables change at once |
| Non-critical race | The final state is the same whichever variable wins |
| Critical race | The final state depends on which wins — a design error |
| Cycle | A deliberate sequence of unstable states leading to one stable state |
Design steps: primitive flow table → merge compatible rows → reduced flow table → race-free state assignment (adjacent codes differing in one bit, adding extra states or variables if needed) → excitation and output maps → circuit with hazard cover.
Hazards are transient wrong outputs caused by unequal path delays:
| Hazard | Cause | Cure |
|---|---|---|
| Static-1 | Output should stay 1 but dips to 0 | Add the redundant consensus term to the SOP |
| Static-0 | Output should stay 0 but pulses to 1 | Add the redundant sum term to the POS |
| Dynamic | Output changes three or more times during one transition | Remove multiple paths; usually cured with the static fix |
| Essential | Input change races the state feedback | Add delay in the feedback path |
F = A.B + A'.C has a static-1 hazard when B = C = 1 and A falls
Cure: F = A.B + A'.C + B.C (the consensus term holds the output at 1)Static-1 hazard हटाउन K-map मा ओभरल्याप गर्ने अतिरिक्त समूह थप्नुपर्छ — त्यो term तार्किक रूपमा बढी भए पनि भौतिक रूपमा आवश्यक हुन्छ।
Exam line — Asynchronous sequential circuits operate without a clock and are faster and cheaper in flip-flops, but they must be designed in fundamental mode with a race-free state assignment and hazard-free output logic, which makes them considerably harder to design and verify than synchronous circuits.
2.10 Digital integrated circuits
Transistors as switches
A BJT used as a switch has two working regions: cut-off (base current zero, collector open, output high) and saturation (base driven hard, V_CE about 0.2 V, output low). The active region in between is avoided because it dissipates power and gives an undefined logic level.
A MOSFET switch is controlled by gate voltage, not current, so its steady-state gate current is essentially zero. An NMOS transistor conducts when V_GS exceeds the threshold; a PMOS conducts when the gate is low. MOSFETs have no saturation charge storage, so they switch out of conduction faster than BJTs.
Exam line — In digital circuits a transistor is operated only in cut-off and saturation, never in the active region, because the two extreme regions correspond to the two logic levels and dissipate the least power.
डिजिटल सर्किटमा ट्रान्जिस्टरलाई स्विचको रूपमा मात्र चलाइन्छ — या पूरै बन्द (cut-off), या पूरै खुला (saturation)। बीचको active region मा चलाए बढी पावर खपत हुन्छ र लेभल अस्पष्ट हुन्छ।
The logic families in order of history
| Family | Full name | Switching device | Notes |
|---|---|---|---|
| RTL | Resistor–Transistor Logic | BJT | Oldest, poor fan-out (about 5), low noise margin |
| DTL | Diode–Transistor Logic | Diodes + BJT | Better fan-out (about 8), slow because of charge storage |
| TTL | Transistor–Transistor Logic | Multi-emitter BJT | The 74 series; the workhorse of SSI/MSI |
| I2L | Integrated Injection Logic | BJT, injector | Very high density, very low power, used inside LSI |
| ECL | Emitter-Coupled Logic | BJT, non-saturating | Fastest bipolar family, very high power |
| NMOS / PMOS | Metal-Oxide-Semiconductor | MOSFET | High density, used for early microprocessors and memory |
| CMOS | Complementary MOS | NMOS + PMOS pair | Near-zero static power; today’s default |
| BiCMOS | Bipolar + CMOS | Both | CMOS input stage, bipolar output drive |
TTL in detail
Standard TTL uses a multi-emitter input transistor, a phase splitter and a totem-pole output stage (one transistor pulling up, one pulling down). The totem pole gives a low output impedance in both states, hence fast switching and good drive.
Three output types, and the distinction is examinable:
| Output stage | Can outputs be tied together? | Use |
|---|---|---|
| Totem pole | No — a high and a low output would short the supply | Normal logic |
| Open collector | Yes, with an external pull-up (wired-AND) | Buses, level shifting, driving lamps |
| Tri-state | Yes, only one enabled at a time | Shared data buses |
TTL sub-families worth knowing:
| Series | Propagation delay | Power per gate |
|---|---|---|
| 74 (standard) | ~10 ns | ~10 mW |
| 74L (low power) | ~33 ns | ~1 mW |
| 74S (Schottky) | ~3 ns | ~20 mW |
| 74LS (low-power Schottky) | ~9.5 ns | ~2 mW |
| 74AS / 74ALS | ~1.5–4 ns | ~1–8 mW |
Schottky versions clamp the transistor out of deep saturation, which removes the stored-charge delay — the single biggest speed win in the TTL family.
ECL
ECL keeps its transistors out of saturation by using a differential pair with a small logic swing (about 0.8 V). No saturation means no stored charge and therefore the shortest propagation delay of any bipolar family — roughly 1–2 ns — but the differential pair draws current continuously, so power is high (around 25 mW per gate) and the small swing gives poor noise margin. ECL also produces complementary outputs naturally, and is the only common family that is normally used with a negative supply (−5.2 V).
I2L
Integrated injection logic removes the resistors entirely, replacing them with a current injector, and shares a common substrate region between gates. The result is extremely small gate area and very low power, with speed traded against current — the speed-power product is nearly constant and the designer chooses the operating point. It was used for logic on chips that also carry analog circuitry, not as a discrete family.
CMOS
A CMOS gate uses a PMOS pull-up network and a complementary NMOS pull-down network, so in either steady state exactly one network conducts and no direct current path exists from supply to ground.
CMOS inverter
VDD -- PMOS --+-- OUT
|
IN -----------+
|
GND -- NMOS --+
IN = 0 : PMOS on, NMOS off -> OUT = 1
IN = 1 : PMOS off, NMOS on -> OUT = 0Exam line — CMOS dissipates almost no static power because its complementary networks are never both conducting in a stable state; its power consumption is dynamic and is given approximately by P = C·V²·f, so it rises linearly with clock frequency and with the square of the supply voltage.
CMOS को स्थिर अवस्थामा पावर खपत लगभग शून्य हुन्छ। खपत स्विच हुँदा मात्र हुन्छ, र P = C·V²·f अनुसार फ्रिक्वेन्सी बढ्दा बढ्छ। त्यसैले मोबाइल र ल्यापटपमा CMOS नै प्रयोग हुन्छ।
Other CMOS properties: very high input impedance (fan-out of about 50 at DC), wide supply range (3–18 V for the 4000 series), noise margin of roughly 45 % of V_DD, and sensitivity to static electricity, which is why CMOS chips carry input protection diodes and handling warnings. Unused CMOS inputs must never be left floating.
BiCMOS
BiCMOS puts a CMOS logic core in front of a bipolar output stage, so it gets CMOS’s low power and high input impedance together with the bipolar transistor’s current drive for charging large capacitive loads. It costs more process steps and is used where both density and drive matter, such as in bus interfaces and mixed-signal chips.
Comparison table — memorise this
| Family | Propagation delay | Power/gate | Fan-out | Noise margin | Status |
|---|---|---|---|---|---|
| RTL | ~12 ns | ~12 mW | 5 | Poor | Obsolete |
| DTL | ~30 ns | ~8 mW | 8 | Fair | Obsolete |
| TTL (74) | ~10 ns | ~10 mW | 10 | 0.4 V | Legacy |
| 74LS | ~9.5 ns | ~2 mW | 20 | 0.4 V | Legacy |
| ECL | ~1–2 ns | ~25 mW | 25 | Poor (~0.2 V) | Niche, very high speed |
| I2L | ~25 ns | very low | — | Fair | Inside LSI |
| CMOS (74HC) | ~8 ns | ~0.001 mW static | 50 | ~0.45 V_DD | Universal |
| BiCMOS | ~3 ns | Medium | High | Good | Interfaces |
Two figures of merit to quote: the speed–power product (delay x power, in picojoules — lower is better) and fan-out, the number of same-family inputs one output can drive.
Scale of integration
| Term | Gates per chip | Example |
|---|---|---|
| SSI | fewer than 12 | 7400 quad NAND |
| MSI | 12 to 99 | 7485 comparator, 7490 counter |
| LSI | 100 to 9,999 | Early microprocessors |
| VLSI | 10,000 to 99,999 | 8086 and later |
| ULSI | 100,000 and above | Modern CPUs and GPUs |
Solved numericals
These are the shapes NRB actually sets. Work them with a pen before reading the solution — remember there is no calculator in the MCQ section.
N1. Simplify with a K-map and realise with NAND gates
Q. F(A,B,C,D) = Σm(0,2,5,7,8,10,13,15). Minimise and implement using NAND gates only.
CD=00 01 11 10
AB=00 | 1 | 0 | 0 | 1 |
AB=01 | 0 | 1 | 1 | 0 |
AB=11 | 0 | 1 | 1 | 0 |
AB=10 | 1 | 0 | 0 | 1 |Group 1: cells 0, 2, 8, 10 — the four corners → B’D’ Group 2: cells 5, 7, 13, 15 — the middle block of the CD = 01 and 11 columns → BD
F = B’D’ + BD = (B ⊕ D)’ — an XNOR gate.
For NAND-only realisation, double-negate the SOP: F = ((B’D’)’ · (BD)’)’. Three NAND gates plus two inverters, and each inverter is itself a 1-input NAND, giving five NAND gates in total.
N2. Don’t-care simplification
Q. F(A,B,C,D) = Σm(1,3,7,11,15) + Σd(0,2,5). Minimise.
Treating d0 and d2 as 1 lets cells 0,1,2,3 form a quad → A’B’. Cells 3,7,11,15 form the whole CD = 11 column → CD.
F = A’B’ + CD (d5 is left as 0; forcing it in gains nothing.)
Without the don’t-cares the answer would have been A’B’C’ + A’B’D? — longer. Always check whether a don’t-care enlarges a group before discarding it.
N3. Two’s complement arithmetic with overflow
Q. Using 8-bit two’s complement, compute (a) 97 + 45, (b) −97 − 45. State whether overflow occurs.
(a) 97 = 0110 0001
45 = 0010 1101
-----------
1000 1110 = -114 as a signed byte
Carry into sign = 1, carry out of sign = 0 -> V = 1, OVERFLOW
(142 does not fit in the range -128..+127)
(b) -97 = 1001 1111
-45 = 1101 0011
-----------
1 0111 0010 discard carry -> 0111 0010 = +114
Carry into sign = 0, carry out = 1 -> V = 1, OVERFLOWBoth overflow, and in both cases the carry-out alone would have given the wrong verdict. That is the point of the question.
N4. Flip-flop conversion
Q. Convert a JK flip-flop into a D flip-flop; show the table, the maps and the circuit.
| D | Q | Q(next) | J | K |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | X |
| 0 | 1 | 0 | X | 1 |
| 1 | 0 | 1 | 1 | X |
| 1 | 1 | 1 | X | 0 |
J-map: 1 at (D=1, Q=0), X at the two Q=1 cells → J = D. K-map: 1 at (D=0, Q=1), X at the two Q=0 cells → K = D’.
Circuit: D goes straight to J and through an inverter to K.
N5. Counter frequency limit
Q. A 4-bit ripple counter uses flip-flops with t_pd = 12 ns. What is the maximum clock frequency? What if the same flip-flops are used in a synchronous counter with an AND gate delay of 6 ns?
Ripple: total delay = 4 x 12 = 48 ns -> f_max = 1/48 ns = 20.83 MHz
Synchronous: delay = t_pd + t_gate = 12 + 6 = 18 ns -> f_max = 55.56 MHzThe ripple counter is slower and gets worse as bits are added; the synchronous counter’s limit does not depend on the number of bits.
N6. Modulus and flip-flop count
Q. How many flip-flops are needed for (a) a mod-12 counter, (b) a mod-100 counter, (c) a counter that counts from 0 to 999 in BCD?
(a) 2^3 = 8 < 12 <= 16 = 2^4 -> 4 flip-flops
(b) 2^6 = 64 < 100 <= 128 -> 7 flip-flops
(c) BCD: 3 decades x 4 bits -> 12 flip-flopsPart (c) is the trap: in BCD each decade keeps its own four bits, so you do not take log2 of 1000 (which would give 10).
N7. MUX function implementation
Q. Implement F(A,B,C,D) = Σm(0,1,3,4,8,9,15) using an 8:1 multiplexer.
Use A, B, C as select lines and D as the data variable.
| A B C | minterms | F for D=0 / D=1 | Data input |
|---|---|---|---|
| 0 0 0 | 0, 1 | 1 / 1 | 1 |
| 0 0 1 | 2, 3 | 0 / 1 | D |
| 0 1 0 | 4, 5 | 1 / 0 | D’ |
| 0 1 1 | 6, 7 | 0 / 0 | 0 |
| 1 0 0 | 8, 9 | 1 / 1 | 1 |
| 1 0 1 | 10, 11 | 0 / 0 | 0 |
| 1 1 0 | 12, 13 | 0 / 0 | 0 |
| 1 1 1 | 14, 15 | 0 / 1 | D |
So I0 = 1, I1 = D, I2 = D’, I3 = 0, I4 = 1, I5 = 0, I6 = 0, I7 = D.
N8. Hazard removal
Q. F = A’B + AC. Show that it has a static-1 hazard and remove it.
With B = C = 1, F should stay at 1 as A changes. But when A falls, the AC term switches off through the AND gate while the A’B term switches on through an extra inverter delay — for that moment both are 0 and the output dips.
Consensus term: BC. F = A’B + AC + BC is hazard-free; BC holds the output high during the transition.
N9. Sequential circuit analysis
Q. A circuit has D1 = Q1 ⊕ Q0 and D0 = Q1′. Tabulate the state sequence starting from 00.
| Q1 Q0 | D1 = Q1⊕Q0 | D0 = Q1′ | Next |
|---|---|---|---|
| 0 0 | 0 | 1 | 0 1 |
| 0 1 | 1 | 1 | 1 1 |
| 1 1 | 0 | 0 | 0 0 |
| 1 0 | 1 | 0 | 1 0 |
From 00 the sequence is 00 → 01 → 11 → 00, a mod-3 counter. State 10 is isolated: it loops to itself, so the circuit is not self-starting and needs a reset.
N10. Parity
Q. A 7-bit ASCII character 1001101 is sent with even parity. What is the transmitted 8-bit word, and what does the receiver conclude if it receives 10011011?
The data has four 1s — already even — so the parity bit is 0 and the transmitted word is 10011010. The received word 10011011 has five 1s, which is odd, so the checker outputs 1: an error is detected, though its position is unknown and it cannot be corrected.
Short-answer question bank (5 marks each)
Nine of these appear in the paper. Each answer wants a definition, a table or diagram, and one line of consequence — about 120–150 words.
- Distinguish between analog and digital signals and state three advantages of digital systems.
- Why are NAND and NOR called universal gates? Realise NOT, AND and OR using NAND only.
- State and prove De Morgan’s theorems, and show how they convert an AND-OR circuit to NAND-only.
- Explain positive and negative logic with an example showing that one circuit implements two different functions.
- Define minterm and maxterm. Convert F = Σm(0,2,5,7) into canonical POS form.
- State the rules of K-map grouping and minimise F(A,B,C,D) = Σm(0,1,2,8,9,10).
- What are don’t-care conditions? Show with an example how they reduce hardware.
- Define prime implicant and essential prime implicant.
- Design a full adder from two half adders and write its equations.
- Explain carry propagation delay and how a carry-look-ahead adder removes it.
- Differentiate between a multiplexer and a demultiplexer, with block diagrams.
- Implement F(A,B,C) = Σm(1,2,4,7) using a 4:1 multiplexer.
- Show that a decoder with enable is equivalent to a demultiplexer.
- What is a priority encoder and which two problems of a simple encoder does it solve?
- Explain even and odd parity generation and checking, with the limitation of a single parity bit.
- Compare PROM, PLA and PAL in terms of their AND and OR arrays.
- Explain how a ROM implements a combinational function without minimisation.
- Distinguish between signed magnitude, 1’s complement and 2’s complement, with the range of each.
- How is overflow detected in signed binary addition? Give an example.
- Explain BCD addition and why the correction factor 0110 is required.
- Differentiate between a latch and a flip-flop.
- Write the characteristic equations of SR, D, JK and T flip-flops.
- What is an excitation table? Write it for the JK flip-flop and explain its role in design.
- Convert a JK flip-flop to a T flip-flop and to a D flip-flop.
- What is the race-around condition and how does a master–slave flip-flop eliminate it?
- Define setup time, hold time and propagation delay, and derive the maximum clock frequency.
- Compare SISO, SIPO, PISO and PIPO registers and name one application of each.
- Compare a ring counter and a Johnson counter for n flip-flops.
- Distinguish between synchronous and asynchronous counters.
- Design a mod-5 synchronous counter using JK flip-flops.
- How many flip-flops are required for a mod-N counter? Design a decade counter by the reset method and state its drawback.
- Differentiate between Mealy and Moore machines with state diagrams.
- What is a critical race in an asynchronous circuit and how is it avoided?
- Define static-1, static-0 and dynamic hazards and give the cure for each.
- Compare TTL, ECL and CMOS on speed, power, fan-out and noise margin.
- Explain the totem-pole, open-collector and tri-state TTL outputs and when each is used.
- Why does CMOS consume almost no static power? Write its dynamic power equation.
- Explain why ECL is the fastest bipolar logic family.
- What is fan-out and why does it differ so much between TTL and CMOS?
- Define SSI, MSI, LSI, VLSI and ULSI with an example of each.
Long-answer question bank (10 marks each)
Three appear in the paper. Each wants 400–500 words with at least one diagram or full table, and a closing paragraph of comparison or limitation.
- State Boolean algebra laws, prove De Morgan’s theorems, and minimise a given four-variable function by K-map, then implement with NAND gates only.
- Explain the K-map method in full — adjacency, Gray-code ordering, grouping rules, don’t-cares, prime and essential prime implicants — and compare it with the Quine–McCluskey method.
- Design and explain a 4-bit adder–subtractor using full adders and XOR gates, covering 2’s-complement subtraction and overflow detection.
- Describe multiplexers, demultiplexers, encoders, decoders and comparators, and show how a function can be implemented with each of a MUX, a decoder and a ROM.
- Compare PROM, PLA and PAL, draw their array structures and implement a given pair of functions on a PLA.
- Explain all four flip-flops with truth tables, characteristic equations and excitation tables, and perform two conversions.
- Explain the race-around condition and the master–slave flip-flop in detail, with timing diagrams and the role of setup and hold time.
- Design a synchronous mod-6 (or mod-10) counter using JK flip-flops, with state diagram, excitation table, K-maps, equations and a self-starting check.
- Design a digital clock, from the crystal oscillator to the seven-segment display, naming every counter stage and its modulus.
- Design a 101 (or 1011) sequence detector as both a Mealy and a Moore machine, with state diagram, state table, assignment, flip-flop equations and a comparison.
- Explain asynchronous sequential circuit design — fundamental mode, primitive flow table, merging, race-free assignment, hazards — with an example.
- Compare the digital logic families RTL, DTL, TTL, I2L, ECL, MOS, CMOS and BiCMOS on structure, speed, power, fan-out, noise margin and present-day use.
70 practice MCQs
Remember the marking: +1 for a correct answer, −0.2 for a wrong one, 0 for blank. Guessing pays only if you can eliminate at least two options.
- The number of minterms for a 5-variable function is — (a) 10 (b) 25 (c) 32 (d) 64
- 1101.101 in binary equals — (a) 13.625 (b) 13.5 (c) 11.625 (d) 13.75
- The hexadecimal equivalent of 101111011 is — (a) 17B (b) 1FB (c) 2FB (d) 17D
- Gray code is used mainly because — (a) it is weighted (b) only one bit changes between successive values (c) it is self-complementing (d) it detects errors
- The Gray code for binary 1100 is — (a) 1010 (b) 1000 (c) 0110 (d) 1110
- Excess-3 code is — (a) weighted (b) self-complementing (c) cyclic (d) error-correcting
- A gate whose output is 1 only when inputs are unequal is — (a) AND (b) NOR (c) XOR (d) XNOR
- The minimum number of NAND gates required to implement XOR is — (a) 3 (b) 4 (c) 5 (d) 6
- The minimum number of NAND gates to implement XNOR is — (a) 3 (b) 4 (c) 5 (d) 6
- A positive-logic NAND gate behaves in negative logic as — (a) AND (b) OR (c) NOR (d) XOR
- A + A’B simplifies to — (a) A (b) B (c) A + B (d) AB
- A + AB simplifies to — (a) A (b) B (c) AB (d) A + B
- In AB + A’C + BC, the redundant term is — (a) AB (b) A’C (c) BC (d) none
- (A + B)’ equals — (a) A’ + B’ (b) A’B’ (c) AB (d) A’B
- The dual of A + 1 = 1 is — (a) A·0 = 0 (b) A + 0 = A (c) A·1 = A (d) A·A = A
- For 3 variables, the maxterm M5 is — (a) A’BC’ (b) A’ + B + C’ (c) AB’C (d) A + B’ + C
- If F = Σm(0,2,4,6), then F in POS form is — (a) ΠM(0,2,4,6) (b) ΠM(1,3,5,7) (c) ΠM(0,1,2,3) (d) ΠM(4,5,6,7)
- K-map rows and columns are arranged in — (a) binary order (b) Gray code order (c) BCD order (d) random order
- A group of 8 cells in a 4-variable K-map yields a term with — (a) 0 variables (b) 1 variable (c) 2 variables (d) 3 variables
- Don’t-care conditions in a K-map — (a) must be treated as 1 (b) must be treated as 0 (c) may be treated as either, whichever simplifies (d) are errors
- A prime implicant that covers a minterm covered by no other prime implicant is called — (a) redundant (b) essential (c) selective (d) dominant
- The Quine–McCluskey method is preferred over the K-map because it is — (a) faster by hand (b) visual (c) systematic and programmable (d) exact only for 4 variables
- The sum output of a half adder is — (a) AB (b) A + B (c) A ⊕ B (d) (A ⊕ B)’
- The carry output of a full adder is — (a) ABC (b) AB + C(A ⊕ B) (c) A ⊕ B ⊕ C (d) A + B + C
- The number of NAND gates required for a full adder is — (a) 5 (b) 7 (c) 9 (d) 12
- In a carry-look-ahead adder, the generate function is — (a) A ⊕ B (b) A·B (c) A + B (d) A’B
- An n-bit ripple-carry adder has worst-case delay proportional to — (a) 1 (b) log n (c) n (d) n²
- A 16:1 multiplexer requires how many select lines — (a) 2 (b) 3 (c) 4 (d) 16
- An n-variable function can always be implemented with a MUX of size — (a) 2^n:1 or 2^(n−1):1 (b) n:1 (c) 2n:1 (d) n²:1
- A decoder with an enable input functions as a — (a) multiplexer (b) demultiplexer (c) encoder (d) comparator
- A 3-to-8 decoder output line represents a — (a) maxterm (b) minterm (c) prime implicant (d) parity bit
- A priority encoder resolves — (a) fan-out limits (b) simultaneous active inputs (c) race conditions (d) hazards
- For even parity, the parity bit is generated by — (a) ANDing the data bits (b) ORing the data bits (c) XORing the data bits (d) XNORing the data bits
- A single parity bit can — (a) detect and correct one error (b) detect any odd number of errors (c) detect any even number of errors (d) correct two errors
- In a PAL — (a) both arrays are programmable (b) AND is programmable, OR is fixed (c) AND is fixed, OR is programmable (d) neither is programmable
- In a PROM — (a) both arrays are programmable (b) AND programmable, OR fixed (c) AND fixed, OR programmable (d) neither
- An EPROM is erased by — (a) electrical pulses (b) ultraviolet light (c) magnetic field (d) heat
- The range of an 8-bit two’s-complement number is — (a) −127 to +127 (b) −128 to +127 (c) 0 to 255 (d) −128 to +128
- The 2’s complement of 10110100 is — (a) 01001011 (b) 01001100 (c) 01001101 (d) 10110101
- In 1’s complement addition, the carry out must be — (a) discarded (b) added to the LSB (c) added to the MSB (d) stored in a flag
- Signed overflow in addition occurs when — (a) there is a carry out (b) carry in to the sign bit differs from carry out (c) the result is zero (d) both operands are negative
- In BCD addition, 0110 is added when the group exceeds — (a) 0111 (b) 1000 (c) 1001 (d) 1111
- The product of two n-bit numbers requires at most — (a) n bits (b) n + 1 bits (c) 2n bits (d) n² bits
- A latch is — (a) edge-triggered (b) level-triggered (c) clockless always (d) always synchronous
- The forbidden input combination of an SR flip-flop is — (a) S=0,R=0 (b) S=0,R=1 (c) S=1,R=0 (d) S=1,R=1
- The characteristic equation of a JK flip-flop is — (a) Q+ = J + K’Q (b) Q+ = JQ’ + K’Q (c) Q+ = J’Q + KQ’ (d) Q+ = J ⊕ K
- The characteristic equation of a T flip-flop is — (a) Q+ = T (b) Q+ = TQ (c) Q+ = T ⊕ Q (d) Q+ = T’ Q’
- In the JK excitation table, the transition 1 → 0 requires — (a) J=0, K=1 (b) J=X, K=1 (c) J=1, K=X (d) J=X, K=0
- The flip-flop whose excitation table contains the most don’t-cares is — (a) SR (b) D (c) T (d) JK
- To convert a JK flip-flop to a D flip-flop — (a) J=D, K=D (b) J=D, K=D’ (c) J=D’, K=D (d) tie J and K together
- The race-around condition occurs in a JK latch when — (a) J=K=0 (b) J=K=1 and the clock pulse is wider than t_pd (c) the clock is too fast (d) PRESET is active
- A master–slave flip-flop changes its output — (a) twice per clock (b) once per clock (c) on both edges (d) asynchronously
- Metastability is caused by violating — (a) fan-out (b) setup or hold time (c) noise margin (d) the modulus
- A SIPO register performs — (a) parallel-to-serial conversion (b) serial-to-parallel conversion (c) parallel-to-parallel transfer (d) delay only
- A 4-bit SISO register delays data by — (a) 1 clock (b) 2 clocks (c) 4 clocks (d) 8 clocks
- A ring counter with n flip-flops has how many states — (a) n (b) 2n (c) 2^n (d) n²
- A Johnson counter with 4 flip-flops has — (a) 4 states (b) 8 states (c) 15 states (d) 16 states
- A mod-12 counter requires at least — (a) 3 flip-flops (b) 4 flip-flops (c) 5 flip-flops (d) 12 flip-flops
- A decade counter counts — (a) 0 to 9 (b) 0 to 10 (c) 1 to 10 (d) 0 to 15
- In an asynchronous counter, total propagation delay for n stages is — (a) t_pd (b) n·t_pd (c) t_pd / n (d) independent of n
- Seconds in a digital clock are produced by a — (a) mod-10 counter (b) mod-24 counter (c) mod-60 counter (d) mod-12 counter
- In a Moore machine, the output depends on — (a) inputs only (b) present state only (c) state and input (d) the clock only
- A Mealy machine generally requires — (a) more states than Moore (b) fewer states than Moore (c) the same number (d) no states
- In an asynchronous circuit, a race in which the final state depends on which variable changes first is called — (a) non-critical (b) critical (c) cycle (d) hazard
- A static-1 hazard is removed by adding — (a) a delay element (b) the consensus term (c) a flip-flop (d) an inverter
- In digital circuits, a BJT is operated in — (a) active region (b) cut-off and saturation (c) breakdown (d) the linear region
- TTL outputs that may be wire-ANDed together are — (a) totem pole (b) open collector (c) tri-state only (d) none
- The fastest bipolar logic family is — (a) TTL (b) DTL (c) ECL (d) RTL
- CMOS static power dissipation is nearly zero because — (a) it uses no transistors (b) PMOS and NMOS never conduct simultaneously in a stable state (c) the supply is negative (d) it saturates
- The dynamic power of a CMOS gate is proportional to — (a) V (b) V² f (c) 1/f (d) V/f
Answer key
| 1 c | 2 a | 3 a | 4 b | 5 a | 6 b | 7 c | 8 b | 9 c | 10 c |
| 11 c | 12 a | 13 c | 14 b | 15 c | 16 b | 17 b | 18 b | 19 b | 20 c |
| 21 b | 22 c | 23 c | 24 b | 25 c | 26 b | 27 c | 28 c | 29 a | 30 b |
| 31 b | 32 b | 33 c | 34 b | 35 b | 36 c | 37 b | 38 b | 39 b | 40 b |
| 41 b | 42 c | 43 c | 44 b | 45 d | 46 b | 47 c | 48 b | 49 d | 50 b |
| 51 b | 52 b | 53 b | 54 b | 55 c | 56 a | 57 b | 58 b | 59 a | 60 b |
| 61 c | 62 b | 63 b | 64 b | 65 b | 66 b | 67 b | 68 c | 69 b | 70 b |
Worth re-reading if you missed them: 9 (XNOR needs five NAND, XOR needs four), 29 (a 2^(n−1):1 MUX is enough), 41 (carry out is not the overflow flag), 48 (JK 1→0 is J=X, K=1), 57 (a Johnson counter gives 2n states).
Nepali–English glossary
| English | नेपाली | One-line meaning |
|---|---|---|
| Gate | गेट | Basic logic building block |
| Universal gate | युनिभर्सल गेट | NAND or NOR; can build any function |
| Truth table | सत्य तालिका | All input combinations and their outputs |
| Minterm | मिनटर्म | AND term true for exactly one combination |
| Maxterm | म्याक्सटर्म | OR term false for exactly one combination |
| Sum of products | गुणनहरूको योग | OR of AND terms |
| Product of sums | योगहरूको गुणन | AND of OR terms |
| Karnaugh map | के-म्याप | Grid for visual minimisation |
| Don’t care | डोन्ट-केयर | Combination that never occurs or is unused |
| Prime implicant | प्राइम इम्प्लिकेन्ट | Term that cannot be combined further |
| Combinational circuit | कम्बिनेसनल सर्किट | Output depends only on present input |
| Sequential circuit | सिक्वेन्सियल सर्किट | Output depends on input and stored state |
| Half adder | हाफ एडर | Adds two bits, no carry in |
| Full adder | फुल एडर | Adds two bits plus a carry in |
| Carry look-ahead | क्यारी लुक-अहेड | Computes all carries in parallel |
| Multiplexer | मल्टिप्लेक्सर | Many inputs, one output, selected |
| Demultiplexer | डिमल्टिप्लेक्सर | One input, many outputs, selected |
| Encoder | एन्कोडर | 2^n lines to n-bit code |
| Decoder | डिकोडर | n-bit code to one of 2^n lines |
| Parity | प्यारिटी | Extra bit making the count of 1s even or odd |
| Comparator | कम्प्यारेटर | Produces A>B, A=B, A<B |
| Latch | ल्याच | Level-triggered storage element |
| Flip-flop | फ्लिप-फ्लप | Edge-triggered storage element |
| Characteristic equation | क्यारेक्टरिस्टिक समीकरण | Next state as a function of inputs and state |
| Excitation table | एक्साइटेसन तालिका | Inputs needed for a required state change |
| Master–slave | मास्टर-स्लेभ | Two latches on opposite clock phases |
| Race-around | रेस-अराउन्ड | Repeated toggling within one clock pulse |
| Setup time | सेटअप टाइम | Input stable before the clock edge |
| Hold time | होल्ड टाइम | Input stable after the clock edge |
| Shift register | सिफ्ट रजिस्टर | Register that moves data one position per clock |
| Ring counter | रिङ काउन्टर | n states, one-hot |
| Johnson counter | जोन्सन काउन्टर | 2n states, twisted ring |
| Modulus | मोड्युलस | Number of states in a counter |
| Mealy machine | मिली मेसिन | Output from state and input |
| Moore machine | मुर मेसिन | Output from state only |
| Critical race | क्रिटिकल रेस | Final state depends on which variable wins |
| Hazard | ह्याजार्ड | Transient wrong output from unequal delays |
| Fan-out | फ्यान-आउट | Number of inputs one output can drive |
| Noise margin | नोइज मार्जिन | Tolerable noise before a level is misread |
| Propagation delay | प्रोपगेसन डिले | Input change to output change time |
Revision checklist
Tick each only when you can do it on blank paper, in English, without notes.
Number systems and codes
- ☐ Convert between binary, octal, decimal and hexadecimal, including fractions
- ☐ Convert binary to Gray and Gray to binary
- ☐ State the properties of BCD, Excess-3, Gray and ASCII
Gates and algebra
- ☐ Draw truth tables for all seven gates from memory
- ☐ Build NOT, AND, OR, XOR from NAND only and from NOR only
- ☐ State the gate counts: XOR = 4 NAND, XNOR = 5 NAND, full adder = 9 NAND
- ☐ Explain positive versus negative logic with the AND/OR interchange
- ☐ State and apply absorption, redundancy, consensus and De Morgan
Minimisation
- ☐ Write canonical SOP and POS from a truth table and convert between them
- ☐ Minimise any 4-variable function by K-map, including corner groups and don’t-cares
- ☐ Identify prime and essential prime implicants
- ☐ Outline the Quine–McCluskey steps
Combinational blocks
- ☐ Derive half adder, full adder, half subtractor, full subtractor equations
- ☐ Explain and write the carry-look-ahead generate/propagate equations
- ☐ Design a 4-bit adder–subtractor with the mode line
- ☐ Implement a function with a MUX, with a decoder and with a ROM
- ☐ Explain priority encoders, parity generators and the 4-bit comparator
- ☐ Draw the array structures of PROM, PLA and PAL
Arithmetic
- ☐ Give the range and the zero count for signed magnitude, 1’s and 2’s complement
- ☐ Subtract by 2’s complement and handle the end-around carry in 1’s complement
- ☐ Detect signed overflow by the two-carry rule
- ☐ Perform BCD addition with the +6 correction
Flip-flops
- ☐ Write all four characteristic equations
- ☐ Write the full excitation table from memory
- ☐ Perform JK→D, JK→T, D→T and SR→D conversions with tables and maps
- ☐ Explain race-around and the master–slave cure
- ☐ Define setup, hold, propagation delay and f_max
Registers and counters
- ☐ Compare SISO, SIPO, PISO, PIPO with one application each
- ☐ Compare ring and Johnson counters by state count
- ☐ Compare synchronous and asynchronous counters on speed and glitches
- ☐ Design a mod-5 or mod-6 synchronous counter end to end
- ☐ Compute flip-flop count for any modulus, including the BCD trap
- ☐ Draw the full digital clock chain with every modulus named
Sequential machines
- ☐ Distinguish Mealy and Moore and draw both for the same detector
- ☐ Design a 101 or 1011 sequence detector, overlapping and non-overlapping
- ☐ Define fundamental mode, critical race, cycle
- ☐ Name the four hazard types and their cures
Logic families
- ☐ Explain the BJT and MOSFET as switches and why the active region is avoided
- ☐ Describe RTL, DTL, TTL, I2L, ECL, NMOS, CMOS, BiCMOS in one line each
- ☐ Explain totem-pole, open-collector and tri-state outputs
- ☐ Reproduce the comparison table of delay, power, fan-out and noise margin
- ☐ Write the CMOS dynamic power equation and explain why static power is near zero
- ☐ List SSI to ULSI with gate counts
Frequently asked questions
Which units make up Paper I of the NRB Assistant Director (IT) syllabus?
Section (A) of Paper I has four units: Computer Architecture and Organization and Microprocessors, Digital Logic Design, Operating Systems, and Database Management System and Design. Section (B) begins with Computer Networks. This article covers Unit 2 in full.
Is a calculator allowed in the NRB IT examination?
No. The objective section of 25 questions is written in 30 minutes without a calculator, which is why the number-system conversions, two’s-complement arithmetic and modulus calculations in these notes should be practised by hand until they are automatic.
How is negative marking applied?
Each correct multiple-choice answer earns 1 mark and each wrong answer costs 0.2 marks. A blank answer costs nothing. Statistically, guessing is worth it only once you can rule out two of the four options.
Why are NAND and NOR called universal gates?
Because every Boolean function can be built from NAND gates alone or from NOR gates alone. Each of them can produce NOT, AND and OR by itself, so any AND-OR network can be redrawn using a single gate type — which is cheaper to manufacture and gives uniform propagation delay.
What is the difference between a latch and a flip-flop?
A latch is level-triggered and stays transparent for as long as its enable input is active, so its output can change many times within one enable pulse. A flip-flop is edge-triggered and samples its input only at the clock transition. That single difference is what makes predictable synchronous design possible.
What is the race-around condition and how is it removed?
In a level-triggered JK latch with J = K = 1, the output toggles repeatedly for as long as the clock pulse is wider than the propagation delay, so the final state is unpredictable. The standard cure is a master–slave flip-flop, in which two latches driven by complementary clocks are never enabled at the same time, so the output changes at most once per clock period.
How many flip-flops does a mod-N counter need?
The ceiling of log base 2 of N. A mod-12 counter needs 4 flip-flops and a mod-100 counter needs 7. The exception is a BCD counter, where each decade keeps its own 4 bits — a 0 to 999 BCD counter needs 12 flip-flops, not 10.
What is the difference between a Mealy and a Moore machine?
In a Moore machine the output is a function of the present state alone, so it is synchronised to the clock and free of glitches. In a Mealy machine the output depends on the present state and the present input, which responds faster and usually needs fewer states, but can produce transient outputs when an input changes between clock edges.
Why does CMOS consume almost no static power?
A CMOS gate has complementary PMOS and NMOS networks, and in either stable state exactly one of them conducts, so no direct current path exists between supply and ground. Power is consumed only while switching, approximately as P = C x V squared x f, which is why consumption rises with clock frequency and with the square of the supply voltage.
Which logic family is the fastest, and what does it cost?
Emitter-coupled logic. It keeps its transistors out of saturation using a differential pair with a small logic swing, so there is no stored-charge delay and propagation delay falls to roughly 1 to 2 nanoseconds. The price is continuous current draw of about 25 milliwatts per gate and a poor noise margin.
Where can I find the official syllabus?
On the Nepal Rastra Bank website, as the Assistant Director (Information Technology) Open 2080 syllabus PDF. Always check the current vacancy notice, because unit numbering is occasionally revised between advertisements.
What to study next
Unit 3, Operating Systems, is now published in full — processes and threads, synchronisation, CPU scheduling, deadlock, virtual memory, disk scheduling, file systems and distributed systems, with fifteen diagrams, twelve solved numericals and 70 practice MCQs. Unit 4 is Database Management System and Design, which completes Paper I Section (A), and is in preparation. Unit 1, Computer Architecture and Organization and Microprocessors, is published in full, with solved Booth, IEEE-754 and cache numericals and 70 practice MCQs of its own.
