Computer Science

NRB Assistant Director (IT) Notes: Digital Logic Design

Complete Unit 2 notes for Paper I, Section (A) of the Nepal Rastra Bank Assistant Director (IT) exam: all ten sub-topics from logic gates to CMOS, with solved numericals and 70 practice MCQs.

By Updated 64 min read

NRB Assistant Director IT Paper I Unit 2 Digital Logic Design notes cover card
On this page

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.1Introduction
2.2Digital Logic: Basic, Exclusive and Universal Gates, Positive and Negative Logics
2.3Combinational Logic Circuits: Boolean Algebra, K-Map, Minterms and Maxterms, SOP and POS
2.4Data Processing Circuits: Adders and Subtractors, Multiplexer and Demultiplexer, Encoders and Decoders, Parity Generators and Checkers, Comparators, ROM and PLDs
2.5Arithmetic Circuits: Binary Addition, Subtraction, Signed- and Unsigned Numbers
2.6Flip-flops: Latches and Flip-flops, SR, D, T and JK Flip-flops, Flip-flop Conversion, Characteristic Equations, Excitation Tables, Master-slave Flip-flops
2.7Registers: Different Types of Flip-flops, SISO, SIPO, PISO, PIPO
2.8Counters: Synchronous Counters, Asynchronous Counters, Up/Down Counters, Modulus Counters, Decade Counters, Digital Clock
2.9Sequential Machines: Synchronous Machines with Single and Multiple Serial Inputs, Synchronous Machines Design using Different types of Flip-flops, Asynchronous Machine Design Examples
2.10Digital 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

PropertyDigitalAnalog
Noise immunityHigh — noise smaller than the margin is removed at every gateLow — noise accumulates and cannot be separated from signal
StorageExact, unlimited duplication without lossDegrades on copying and with time
DesignSystematic, from Boolean algebraComponent-by-component, device dependent
AccuracySet by number of bits, extendableSet by component tolerance
ProgrammabilityYes, same hardware runs different functionsRarely
Power at high speedHigher switching lossOften lower

डिजिटल प्रणालीको सबैभन्दा ठूलो फाइदा noise immunity हो — हरेक गेटले सिग्नललाई पुनः ०/१ मा पुनर्स्थापित गरिदिन्छ, त्यसैले हल्का नोइज आफैँ हराउँछ।

Number systems you must convert fluently

SystemBaseDigitsUse
Binary20, 1Internal representation
Octal80–7Shorthand, 3 bits per digit
Decimal100–9Human interface
Hexadecimal160–9, A–FShorthand, 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.1011

Shortcut 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

CodeRuleWhere it is used
BCD (8421)Each decimal digit as 4 bits, 1010–1111 unusedDisplays, calculators, financial arithmetic
Excess-3BCD value + 3Self-complementing, older arithmetic units
Gray codeOnly one bit changes between consecutive valuesShaft encoders, K-map ordering, avoiding glitches
ASCII7 bits, 128 charactersText
Parity-extendedOne extra bit forcing an even or odd count of 1sError 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

GateSymbol in algebraTruth table (A, B)Statement
ANDA·B or AB00→0, 01→0, 10→0, 11→1Output 1 only when all inputs are 1
ORA + B00→0, 01→1, 10→1, 11→1Output 1 when any input is 1
NOTA’ or Ā0→1, 1→0Inverts

Derived and exclusive gates

GateExpressionOutput is 1 when
NAND(A·B)’Not all inputs are 1
NOR(A + B)’All inputs are 0
XORA ⊕ 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' ^ B

XOR लाई “असमान पत्ता लगाउने गेट” भनेर सम्झनुहोस् — दुवै इनपुट फरक भए मात्र १ दिन्छ। 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.

FunctionUsing NAND onlyUsing NOR only
NOT ANAND(A, A)NOR(A, A)
A·BNAND( NAND(A,B), NAND(A,B) )NOR( NOR(A,A), NOR(B,B) )
A + BNAND( 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.

ConventionHigh voltage meansLow voltage means
Positive logic10
Negative logic01

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 hardwarePositive logicNegative logic
Circuit 1ANDOR
Circuit 2ORAND
Circuit 3NANDNOR
Circuit 4NORNAND

Logic level parameters

ParameterMeaning
V_OHMinimum voltage the output guarantees for logic 1
V_OLMaximum voltage the output guarantees for logic 0
V_IHMinimum voltage the input will accept as logic 1
V_ILMaximum voltage the input will accept as logic 0
Noise margin highNM_H = V_OH − V_IH
Noise margin lowNM_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

LawOR formAND form
IdentityA + 0 = AA · 1 = A
Null / dominanceA + 1 = 1A · 0 = 0
IdempotentA + A = AA · A = A
ComplementA + A’ = 1A · A’ = 0
Involution(A’)’ = A—
CommutativeA + B = B + AAB = BA
AssociativeA + (B + C) = (A + B) + CA(BC) = (AB)C
DistributiveA + BC = (A + B)(A + C)A(B + C) = AB + AC
AbsorptionA + AB = AA(A + B) = A
RedundancyA + A’B = A + BA(A’ + B) = AB
De Morgan(A + B)’ = A’B’(AB)’ = A’ + B’
ConsensusAB + 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 CMintermExpressionMaxtermExpression
0 0 0m0A’B’C’M0A + B + C
0 0 1m1A’B’CM1A + B + C’
0 1 0m2A’BC’M2A + B’ + C
0 1 1m3A’BCM3A + B’ + C’
1 0 0m4AB’C’M4A’ + B + C
1 0 1m5AB’CM5A’ + B + C’
1 1 0m6ABC’M6A’ + B’ + C
1 1 1m7ABCM7A’ + 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

  1. Groups must contain 1, 2, 4, 8, … cells — a power of two.
  2. Groups are rectangles, horizontally or vertically, never diagonal.
  3. The map wraps around: left edge touches right edge, top touches bottom, and the four corners form one group.
  4. Make every group as large as possible, then use as few groups as possible.
  5. Every 1 must be covered at least once; overlapping is allowed and often necessary.
  6. A group of 2^k cells eliminates k variables.
Group size (4-variable map)Variables in the term
1 cell4
2 cells3
4 cells2
8 cells1
16 cells0 (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

CircuitInputsOutputsEquations
Half adderA, BSum, CarryS = A ⊕ B, C = A·B
Full adderA, B, C_inSum, C_outS = 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.C0

Exam 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

CircuitEquations
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.

MUXData inputsSelect lines
2:121
4:142
8:183
16:1164
4:1 MUX output equation
Y = S1'S0'I0 + S1'S0 I1 + S1 S0' I2 + S1 S0 I3

Function 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 = 1

Other 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 -> F

Encoder 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.

DeviceAND arrayOR arrayComment
PROMFixed (full decoder)ProgrammableEvery minterm is generated whether needed or not
PLAProgrammableProgrammableMost flexible, slowest, hardest to program
PALProgrammableFixedCheaper and faster than PLA; the usual choice

तीनवटा सम्झने सजिलो तरिका — PROM: AND fixed, OR programmable। PAL: AND programmable, OR fixed। PLA: दुवै programmable।

ROM typeWritten byErased by
Mask ROMManufacturerNot erasable
PROMUser, once, by blowing fusesNot erasable
EPROMUser, electricallyUltraviolet light, whole chip
EEPROMUser, electricallyElectrically, byte by byte
FlashUser, electricallyElectrically, 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 bitsRange (n bits)Zeros
Signed magnitude01011101−(2^(n−1) − 1) to +(2^(n−1) − 1)Two (+0, −0)
1’s complement01011010−(2^(n−1) − 1) to +(2^(n−1) − 1)Two
2’s complement01011011−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 100

Subtraction 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   correct

In 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, overflow

Signed 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 BCD

Binary 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

LatchFlip-flop
ControlLevel-triggered (transparent while enable is active)Edge-triggered (changes only on a clock edge)
Output follows inputContinuously while enabledOnly at the rising or falling edge
Built fromCross-coupled gatesTwo latches, or edge-detection logic
UseSimple storage, busesSynchronous 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
SRQ(next)Comment
00QHold
010Reset
101Set
11?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.

DQ(next)
00
11

Characteristic equation: Q(next) = D.

JK flip-flop

The JK flip-flop makes the forbidden combination useful: J = K = 1 toggles the output.

JKQ(next)Operation
00QHold
010Reset
101Set
11Q’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-flopCharacteristic equation
SRQ(next) = S + R’Q, SR = 0
DQ(next) = D
JKQ(next) = JQ’ + K’Q
TQ(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.

QQ(next)S RJ KDT
000 X0 X00
011 01 X11
100 1X 101
11X 0X 010

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:

  1. Write the truth table of the required flip-flop (present state Q, its inputs, next state).
  2. From the excitation table of the available flip-flop, write the inputs needed for each transition.
  3. K-map those inputs against Q and the required flip-flop’s inputs.
  4. Draw the circuit.

JK to D. Required: Q(next) = D.

DQQ(next)JK
0000X
010X1
1011X
111X0

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:

  1. Make the clock pulse narrower than the propagation delay — impractical.
  2. Use a master–slave flip-flop.
  3. 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

TermMeaning
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 frequencyf_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

TypeFull nameInputOutputClocks to loadClocks to read
SISOSerial-In Serial-Out1 line, serial1 line, serialnn
SIPOSerial-In Parallel-Out1 line, serialn lines at oncen1
PISOParallel-In Serial-Outn lines at once1 line, serial1n
PIPOParallel-In Parallel-Outn lines at oncen lines at once11

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.

S1S0Operation
00Hold
01Shift right
10Shift left
11Parallel load

The standard part is the 74194 4-bit bidirectional universal shift register.

Ring and Johnson counters

CounterConnectionStates for n flip-flopsInitialisation
RingQ_last → D_firstnNeeds one 1 preset
Johnson (twisted ring)Q’_last → D_first2nStarts 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
AsynchronousSynchronous
ClockRippled through stagesCommon to all
SpeedSlow, n x t_pdFast, one t_pd
GlitchesYes, transient false statesNo
Gates neededAlmost noneExtra AND gates
DesignTrivialSystematic, from excitation tables

Designing a synchronous counter — the six steps

  1. Draw the state diagram of the required sequence.
  2. Write the state table: present state → next state.
  3. Choose a flip-flop and fill in its excitation values for every transition.
  4. K-map each flip-flop input against the present-state variables.
  5. Write the simplified input equations.
  6. 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 Q0Q2+ Q1+ Q0+J2 K2J1 K1J0 K0
0 0 00 0 10 X0 X1 X
0 0 10 1 00 X1 XX 1
0 1 00 1 10 XX 01 X
0 1 11 0 01 XX 1X 1
1 0 00 0 0X 10 X0 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 = 1

Modulus 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:

  1. 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.
  2. 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) -> CLEAR

Mod-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) -> display

Seconds 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 machineMealy machine
Output depends onPresent state onlyPresent state and present input
Output appearsSynchronised to the clock, one cycle laterImmediately when the input changes
States neededUsually moreUsually fewer
Output glitchesNoPossible, since inputs are asynchronous
Drawn on the diagramInside the state bubbleOn 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

  1. Read the word problem and draw the state diagram, naming states by what has been seen so far.
  2. Write the state table.
  3. Reduce equivalent states if asked (two states are equivalent when, for every input, they give the same output and go to equivalent states).
  4. Assign binary codes to states — n states need ceil(log2 n) flip-flops.
  5. Build the transition and excitation table for the chosen flip-flop.
  6. K-map and simplify every flip-flop input and every output.
  7. 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”.

Presentx = 0x = 1
S0S0 / 0S1 / 0
S1S2 / 0S1 / 0
S2S0 / 0S1 / 1

Assign S0 = 00, S1 = 01, S2 = 10.

Q1 Q0xQ1+ Q0+ZD1D0
0 000 0000
0 010 1001
0 101 0010
0 110 1001
1 000 0000
1 010 1101
D1 = Q1'.Q0.x'
D0 = x
Z  = Q1.Q0'.x

Because 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=1

Design using different flip-flop types

The same state table can be implemented with any flip-flop; only step 5 changes.

Flip-flopWhat to write in the excitation columnsTypical result
DD = next state, directlyNo simplification needed, more gates in next-state logic
TT = Q ⊕ Q(next)Good for counters
JKTwo columns with many don’t-caresUsually the fewest gates
SRTwo columns, constraint SR = 0Rare 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:

TermMeaning
Fundamental modeOnly one input may change at a time, and only after the circuit has settled
Primitive flow tableOne stable state per row
Stable stateNext state equals present state
RaceTwo or more state variables change at once
Non-critical raceThe final state is the same whichever variable wins
Critical raceThe final state depends on which wins — a design error
CycleA 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:

HazardCauseCure
Static-1Output should stay 1 but dips to 0Add the redundant consensus term to the SOP
Static-0Output should stay 0 but pulses to 1Add the redundant sum term to the POS
DynamicOutput changes three or more times during one transitionRemove multiple paths; usually cured with the static fix
EssentialInput change races the state feedbackAdd 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

FamilyFull nameSwitching deviceNotes
RTLResistor–Transistor LogicBJTOldest, poor fan-out (about 5), low noise margin
DTLDiode–Transistor LogicDiodes + BJTBetter fan-out (about 8), slow because of charge storage
TTLTransistor–Transistor LogicMulti-emitter BJTThe 74 series; the workhorse of SSI/MSI
I2LIntegrated Injection LogicBJT, injectorVery high density, very low power, used inside LSI
ECLEmitter-Coupled LogicBJT, non-saturatingFastest bipolar family, very high power
NMOS / PMOSMetal-Oxide-SemiconductorMOSFETHigh density, used for early microprocessors and memory
CMOSComplementary MOSNMOS + PMOS pairNear-zero static power; today’s default
BiCMOSBipolar + CMOSBothCMOS 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 stageCan outputs be tied together?Use
Totem poleNo — a high and a low output would short the supplyNormal logic
Open collectorYes, with an external pull-up (wired-AND)Buses, level shifting, driving lamps
Tri-stateYes, only one enabled at a timeShared data buses

TTL sub-families worth knowing:

SeriesPropagation delayPower 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 = 0

Exam 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

FamilyPropagation delayPower/gateFan-outNoise marginStatus
RTL~12 ns~12 mW5PoorObsolete
DTL~30 ns~8 mW8FairObsolete
TTL (74)~10 ns~10 mW100.4 VLegacy
74LS~9.5 ns~2 mW200.4 VLegacy
ECL~1–2 ns~25 mW25Poor (~0.2 V)Niche, very high speed
I2L~25 nsvery low—FairInside LSI
CMOS (74HC)~8 ns~0.001 mW static50~0.45 V_DDUniversal
BiCMOS~3 nsMediumHighGoodInterfaces

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

TermGates per chipExample
SSIfewer than 127400 quad NAND
MSI12 to 997485 comparator, 7490 counter
LSI100 to 9,999Early microprocessors
VLSI10,000 to 99,9998086 and later
ULSI100,000 and aboveModern 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, OVERFLOW

Both 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.

DQQ(next)JK
0000X
010X1
1011X
111X0

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 MHz

The 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-flops

Part (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 CmintermsF for D=0 / D=1Data input
0 0 00, 11 / 11
0 0 12, 30 / 1D
0 1 04, 51 / 0D’
0 1 16, 70 / 00
1 0 08, 91 / 11
1 0 110, 110 / 00
1 1 012, 130 / 00
1 1 114, 150 / 1D

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 Q0D1 = Q1⊕Q0D0 = Q1′Next
0 0010 1
0 1111 1
1 1000 0
1 0101 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.

  1. Distinguish between analog and digital signals and state three advantages of digital systems.
  2. Why are NAND and NOR called universal gates? Realise NOT, AND and OR using NAND only.
  3. State and prove De Morgan’s theorems, and show how they convert an AND-OR circuit to NAND-only.
  4. Explain positive and negative logic with an example showing that one circuit implements two different functions.
  5. Define minterm and maxterm. Convert F = Σm(0,2,5,7) into canonical POS form.
  6. State the rules of K-map grouping and minimise F(A,B,C,D) = Σm(0,1,2,8,9,10).
  7. What are don’t-care conditions? Show with an example how they reduce hardware.
  8. Define prime implicant and essential prime implicant.
  9. Design a full adder from two half adders and write its equations.
  10. Explain carry propagation delay and how a carry-look-ahead adder removes it.
  11. Differentiate between a multiplexer and a demultiplexer, with block diagrams.
  12. Implement F(A,B,C) = Σm(1,2,4,7) using a 4:1 multiplexer.
  13. Show that a decoder with enable is equivalent to a demultiplexer.
  14. What is a priority encoder and which two problems of a simple encoder does it solve?
  15. Explain even and odd parity generation and checking, with the limitation of a single parity bit.
  16. Compare PROM, PLA and PAL in terms of their AND and OR arrays.
  17. Explain how a ROM implements a combinational function without minimisation.
  18. Distinguish between signed magnitude, 1’s complement and 2’s complement, with the range of each.
  19. How is overflow detected in signed binary addition? Give an example.
  20. Explain BCD addition and why the correction factor 0110 is required.
  21. Differentiate between a latch and a flip-flop.
  22. Write the characteristic equations of SR, D, JK and T flip-flops.
  23. What is an excitation table? Write it for the JK flip-flop and explain its role in design.
  24. Convert a JK flip-flop to a T flip-flop and to a D flip-flop.
  25. What is the race-around condition and how does a master–slave flip-flop eliminate it?
  26. Define setup time, hold time and propagation delay, and derive the maximum clock frequency.
  27. Compare SISO, SIPO, PISO and PIPO registers and name one application of each.
  28. Compare a ring counter and a Johnson counter for n flip-flops.
  29. Distinguish between synchronous and asynchronous counters.
  30. Design a mod-5 synchronous counter using JK flip-flops.
  31. How many flip-flops are required for a mod-N counter? Design a decade counter by the reset method and state its drawback.
  32. Differentiate between Mealy and Moore machines with state diagrams.
  33. What is a critical race in an asynchronous circuit and how is it avoided?
  34. Define static-1, static-0 and dynamic hazards and give the cure for each.
  35. Compare TTL, ECL and CMOS on speed, power, fan-out and noise margin.
  36. Explain the totem-pole, open-collector and tri-state TTL outputs and when each is used.
  37. Why does CMOS consume almost no static power? Write its dynamic power equation.
  38. Explain why ECL is the fastest bipolar logic family.
  39. What is fan-out and why does it differ so much between TTL and CMOS?
  40. 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.

  1. 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.
  2. 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.
  3. Design and explain a 4-bit adder–subtractor using full adders and XOR gates, covering 2’s-complement subtraction and overflow detection.
  4. 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.
  5. Compare PROM, PLA and PAL, draw their array structures and implement a given pair of functions on a PLA.
  6. Explain all four flip-flops with truth tables, characteristic equations and excitation tables, and perform two conversions.
  7. Explain the race-around condition and the master–slave flip-flop in detail, with timing diagrams and the role of setup and hold time.
  8. 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.
  9. Design a digital clock, from the crystal oscillator to the seven-segment display, naming every counter stage and its modulus.
  10. 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.
  11. Explain asynchronous sequential circuit design — fundamental mode, primitive flow table, merging, race-free assignment, hazards — with an example.
  12. 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.

  1. The number of minterms for a 5-variable function is — (a) 10 (b) 25 (c) 32 (d) 64
  2. 1101.101 in binary equals — (a) 13.625 (b) 13.5 (c) 11.625 (d) 13.75
  3. The hexadecimal equivalent of 101111011 is — (a) 17B (b) 1FB (c) 2FB (d) 17D
  4. 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
  5. The Gray code for binary 1100 is — (a) 1010 (b) 1000 (c) 0110 (d) 1110
  6. Excess-3 code is — (a) weighted (b) self-complementing (c) cyclic (d) error-correcting
  7. A gate whose output is 1 only when inputs are unequal is — (a) AND (b) NOR (c) XOR (d) XNOR
  8. The minimum number of NAND gates required to implement XOR is — (a) 3 (b) 4 (c) 5 (d) 6
  9. The minimum number of NAND gates to implement XNOR is — (a) 3 (b) 4 (c) 5 (d) 6
  10. A positive-logic NAND gate behaves in negative logic as — (a) AND (b) OR (c) NOR (d) XOR
  11. A + A’B simplifies to — (a) A (b) B (c) A + B (d) AB
  12. A + AB simplifies to — (a) A (b) B (c) AB (d) A + B
  13. In AB + A’C + BC, the redundant term is — (a) AB (b) A’C (c) BC (d) none
  14. (A + B)’ equals — (a) A’ + B’ (b) A’B’ (c) AB (d) A’B
  15. The dual of A + 1 = 1 is — (a) A·0 = 0 (b) A + 0 = A (c) A·1 = A (d) A·A = A
  16. For 3 variables, the maxterm M5 is — (a) A’BC’ (b) A’ + B + C’ (c) AB’C (d) A + B’ + C
  17. 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)
  18. K-map rows and columns are arranged in — (a) binary order (b) Gray code order (c) BCD order (d) random order
  19. 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
  20. 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
  21. A prime implicant that covers a minterm covered by no other prime implicant is called — (a) redundant (b) essential (c) selective (d) dominant
  22. 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
  23. The sum output of a half adder is — (a) AB (b) A + B (c) A ⊕ B (d) (A ⊕ B)’
  24. The carry output of a full adder is — (a) ABC (b) AB + C(A ⊕ B) (c) A ⊕ B ⊕ C (d) A + B + C
  25. The number of NAND gates required for a full adder is — (a) 5 (b) 7 (c) 9 (d) 12
  26. In a carry-look-ahead adder, the generate function is — (a) A ⊕ B (b) A·B (c) A + B (d) A’B
  27. An n-bit ripple-carry adder has worst-case delay proportional to — (a) 1 (b) log n (c) n (d) n²
  28. A 16:1 multiplexer requires how many select lines — (a) 2 (b) 3 (c) 4 (d) 16
  29. 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
  30. A decoder with an enable input functions as a — (a) multiplexer (b) demultiplexer (c) encoder (d) comparator
  31. A 3-to-8 decoder output line represents a — (a) maxterm (b) minterm (c) prime implicant (d) parity bit
  32. A priority encoder resolves — (a) fan-out limits (b) simultaneous active inputs (c) race conditions (d) hazards
  33. 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
  34. 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
  35. 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
  36. In a PROM — (a) both arrays are programmable (b) AND programmable, OR fixed (c) AND fixed, OR programmable (d) neither
  37. An EPROM is erased by — (a) electrical pulses (b) ultraviolet light (c) magnetic field (d) heat
  38. 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
  39. The 2’s complement of 10110100 is — (a) 01001011 (b) 01001100 (c) 01001101 (d) 10110101
  40. 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
  41. 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
  42. In BCD addition, 0110 is added when the group exceeds — (a) 0111 (b) 1000 (c) 1001 (d) 1111
  43. The product of two n-bit numbers requires at most — (a) n bits (b) n + 1 bits (c) 2n bits (d) n² bits
  44. A latch is — (a) edge-triggered (b) level-triggered (c) clockless always (d) always synchronous
  45. 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
  46. 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
  47. The characteristic equation of a T flip-flop is — (a) Q+ = T (b) Q+ = TQ (c) Q+ = T ⊕ Q (d) Q+ = T’ Q’
  48. 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
  49. The flip-flop whose excitation table contains the most don’t-cares is — (a) SR (b) D (c) T (d) JK
  50. 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
  51. 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
  52. A master–slave flip-flop changes its output — (a) twice per clock (b) once per clock (c) on both edges (d) asynchronously
  53. Metastability is caused by violating — (a) fan-out (b) setup or hold time (c) noise margin (d) the modulus
  54. A SIPO register performs — (a) parallel-to-serial conversion (b) serial-to-parallel conversion (c) parallel-to-parallel transfer (d) delay only
  55. A 4-bit SISO register delays data by — (a) 1 clock (b) 2 clocks (c) 4 clocks (d) 8 clocks
  56. A ring counter with n flip-flops has how many states — (a) n (b) 2n (c) 2^n (d) n²
  57. A Johnson counter with 4 flip-flops has — (a) 4 states (b) 8 states (c) 15 states (d) 16 states
  58. A mod-12 counter requires at least — (a) 3 flip-flops (b) 4 flip-flops (c) 5 flip-flops (d) 12 flip-flops
  59. A decade counter counts — (a) 0 to 9 (b) 0 to 10 (c) 1 to 10 (d) 0 to 15
  60. 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
  61. 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
  62. In a Moore machine, the output depends on — (a) inputs only (b) present state only (c) state and input (d) the clock only
  63. A Mealy machine generally requires — (a) more states than Moore (b) fewer states than Moore (c) the same number (d) no states
  64. 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
  65. A static-1 hazard is removed by adding — (a) a delay element (b) the consensus term (c) a flip-flop (d) an inverter
  66. In digital circuits, a BJT is operated in — (a) active region (b) cut-off and saturation (c) breakdown (d) the linear region
  67. TTL outputs that may be wire-ANDed together are — (a) totem pole (b) open collector (c) tri-state only (d) none
  68. The fastest bipolar logic family is — (a) TTL (b) DTL (c) ECL (d) RTL
  69. 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
  70. The dynamic power of a CMOS gate is proportional to — (a) V (b) V² f (c) 1/f (d) V/f

Answer key

1 c2 a3 a4 b5 a6 b7 c8 b9 c10 c
11 c12 a13 c14 b15 c16 b17 b18 b19 b20 c
21 b22 c23 c24 b25 c26 b27 c28 c29 a30 b
31 b32 b33 c34 b35 b36 c37 b38 b39 b40 b
41 b42 c43 c44 b45 d46 b47 c48 b49 d50 b
51 b52 b53 b54 b55 c56 a57 b58 b59 a60 b
61 c62 b63 b64 b65 b66 b67 b68 c69 b70 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.