BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) Question Paper 2078 Nepal
This is the official BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) question paper for 2078, as set in the regular annual examination. It carries 80 full marks and a time allowance of 180 minutes, across 12 questions. On Kekkei you can attempt this Digital Logic (IOE, EX 502) past paper online with a timer, get instant AI feedback and step-by-step solutions, and track the topics where you lose marks — completely free. Whether you are revising for your BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) exam or solving previous years' question papers, this 2078 paper is a great way to practise under real exam conditions.
Section A: Long Answer Questions
Attempt all / any as specified.
(a) Perform the following number system conversions, showing all steps: (i) Convert the decimal number to its binary, octal and hexadecimal equivalents. (ii) Convert the hexadecimal number to decimal. (6 marks)
(b) Differentiate between weighted and non-weighted codes with examples. Encode the decimal number into BCD (8421), Excess-3 and Gray code, and explain one practical advantage of using Gray code in digital systems. (6 marks)
(a) Number System Conversions
(i) to binary, octal, hexadecimal
Integer part 427 to binary (repeated division by 2, read remainders bottom-up):
| Division | Quotient | Remainder |
|---|---|---|
| 427/2 | 213 | 1 |
| 213/2 | 106 | 1 |
| 106/2 | 53 | 0 |
| 53/2 | 26 | 1 |
| 26/2 | 13 | 0 |
| 13/2 | 6 | 1 |
| 6/2 | 3 | 0 |
| 3/2 | 1 | 1 |
| 1/2 | 0 | 1 |
So .
Fraction 0.625 to binary (repeated multiplication by 2, read carries top-down): . So .
Octal — group binary in 3s from the binary point:
Hexadecimal — group in 4s from the binary point ():
(ii) to decimal
(b) Weighted vs Non-weighted Codes
| Weighted codes | Non-weighted codes |
|---|---|
| Each bit position carries a fixed weight; value = sum of weighted bits | Bits have no positional weight |
| e.g. BCD (8421), 2421, 5211 | e.g. Excess-3, Gray code |
Encoding :
- BCD (8421):
- Excess-3 (add 3 to each digit, then BCD):
- Gray code of : MSB unchanged, then each Gray bit = XOR of adjacent binary bits:
Advantage of Gray code: Only one bit changes between successive values, so in applications like shaft/position encoders and asynchronous state transitions it eliminates spurious intermediate outputs (glitches/false codes) that occur when multiple bits change simultaneously.
(a) State and prove De Morgan's theorems for two variables. Hence simplify the Boolean expression and implement it using only NAND gates. (5 marks)
(b) A logic function is given by . Simplify the function using a four-variable Karnaugh map, identify any don't-care groupings that arise, and draw the minimized logic circuit using basic gates. (7 marks)
(a) De Morgan's Theorems
Statement:
Proof by truth table (for ):
| A | B | ||
|---|---|---|---|
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 |
Columns 3 and 4 are identical, so the identity holds. The second theorem is proved similarly (the truth tables of and match).
Simplify :
Apply De Morgan to each term:
Using the absorption identity :
NAND-only implementation: A SOP/OR form is realized with NAND by double-inversion. Since , invert , (using NAND as inverters, inputs tied together) and use directly, then feed into one 3-input NAND gate whose output is . (An OR of three terms = NAND of their complements.)
(b) K-map for
Four-variable map (rows , columns in Gray order ):
| AB\CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 1(0) | 1(1) | 1(3?)0 | 1(2) |
| 01 | 1(4) | 1(5) | 1(7) | 0(6) |
| 11 | 1(12) | 1(13) | 1(15) | 0(14) |
| 10 | 1(8) | 1(9) | 0(11) | 1(10) |
Minterm 3 is not present, so cell (00,11) = 0. Filling the 12 given minterms and grouping the 1s:
- Group of 8 — column pairs and (i.e. ) covers ⇒ term .
- Group of 4 — (cells ) ⇒ term .
- Group of 2 — minterms and () actually share ; minterm 2 , 10 : common ⇒ term .
(No don't-care cells were specified; all unlisted minterms are treated as 0.)
Circuit: one inverter for ; one 2-input AND for ; one 3-input AND for ; feed the three product terms into a 3-input OR gate to obtain .
(a) Explain the difference between synchronous and asynchronous (ripple) counters, clearly discussing the propagation delay limitation of ripple counters. (4 marks)
(b) Design a synchronous MOD-6 counter that counts in the sequence using JK flip-flops. Draw the state diagram, construct the excitation table, derive the simplified flip-flop input equations using K-maps, and draw the final circuit diagram. (12 marks)
(a) Synchronous vs Asynchronous (Ripple) Counters
| Synchronous counter | Asynchronous (ripple) counter |
|---|---|
| All flip-flops share the same clock, triggered simultaneously | Clock of each FF is driven by the output of the previous FF |
| Outputs change at the same instant | Outputs change one after another (a "ripple") |
| Faster; no cumulative delay | Slower; delay accumulates |
| More complex combinational logic on inputs | Simpler hardware |
Propagation-delay limitation of ripple counters: because each stage clocks the next, the change must ripple through every stage. With flip-flops each having delay , the worst-case settling time is . This (i) limits the maximum clock frequency to roughly and (ii) produces transient false intermediate counts (decoding spikes) during the ripple interval. Synchronous counters avoid this since all FFs switch together.
(b) Synchronous MOD-6 Counter (0→1→2→3→4→5→0) using JK Flip-Flops
State diagram: a single directed loop . Three flip-flops are needed (); states 6 and 7 are unused (don't-cares).
JK excitation table (Q→Q⁺ ⇒ J,K): ; ; ; .
State / excitation table (, present → next):
| Present | Next | |||
|---|---|---|---|---|
| 000 | 001 | 0 X | 0 X | 1 X |
| 001 | 010 | 0 X | 1 X | X 1 |
| 010 | 011 | 0 X | X 0 | 1 X |
| 011 | 100 | 1 X | X 1 | X 1 |
| 100 | 101 | X 0 | 0 X | 1 X |
| 101 | 000 | X 1 | 0 X | X 1 |
| 110 | X (unused) | X X | X X | X X |
| 111 | X (unused) | X X | X X | X X |
K-map simplification (using 110,111 as don't-cares):
- ? Check: must be 1 at states 000,010,100 (where and we move to ). at 000,010,100 ⇒ region; minimal: is not needed — simply except at state 011/101 where . Taking =0 rows: 000,010,100 give . So covering 000,010,100 (and don't-care 110) ⇒ ... evaluating, the clean minimal result is:
(Verification: at 011 → sets ; resets ; resets ⇒ next = 100 ✓. At 101 → resets , resets ⇒ 000 ✓.)
Final circuit: three JK flip-flops with a common clock. Wire (OR of inverted ) and (tied high); (AND of and ), ; (AND), . Outputs give the 0–5 count.
(a) Design a full adder using two half adders and additional gates. Write its truth table and derive the expressions for SUM and CARRY. (6 marks)
(b) Show how a -to- multiplexer can be used to implement the Boolean function by treating and as select lines. Draw the implementation, clearly indicating the data input connections. (6 marks)
(a) Full Adder from Two Half Adders
Truth table (inputs ; outputs ):
| A | B | S | ||
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Expressions:
Realization with two half adders (HA):
- HA-1 inputs → sum , carry .
- HA-2 inputs → sum , carry .
- An OR gate combines the two carries: .
(b) Implement with a 4-to-1 MUX (A,B as select)
With as select lines (), the remaining variable (and constants) form the data inputs. Tabulate minterms grouped by :
| (select) | minterms | Data input | ||
|---|---|---|---|---|
| 00 | m0,m1 | F=0 | F=1 (m1) | |
| 01 | m2,m3 | F=1 (m2) | F=0 | |
| 10 | m4,m5 | F=1 (m4) | F=0 | |
| 11 | m6,m7 | F=0 | F=1 (m7) |
Data input connections:
Implementation: a 4:1 MUX with select , . Connect and to , and and to (one inverter generates ). The MUX output . This requires just the MUX plus one NOT gate.
Section B: Short Answer Questions
Attempt all / any as specified.
Perform the subtraction using the 8-bit 2's complement method. Show the binary representation of each operand, the addition step, and interpret the final result including its sign.
using 8-bit 2's complement
Operands in 8-bit binary:
2's complement of 52 (so we can add ): invert , then add 1 → . So .
Addition :
0010 0011 (+35)
+ 1100 1100 (-52)
-----------
1110 1111 (no carry out of MSB)
Result .
Interpretation: MSB ⇒ the result is negative. Take its 2's complement to read the magnitude: invert , add 1 → .
There is no carry out of the MSB, which (together with operands of opposite sign) confirms there is no overflow and the result is valid.
Explain the operation of a 3-to-8 line decoder. Draw its block diagram and truth table, and show how two such decoders together with an enable input can be combined to build a 4-to-16 line decoder.
3-to-8 Line Decoder
A decoder is a combinational circuit that converts an -bit binary code into one of unique output lines. A 3-to-8 decoder has 3 inputs () and 8 outputs (–); for each input combination exactly one output is active (HIGH) — the one whose index equals the binary value of the input. Each output is a minterm: .
Block diagram (described): a box with inputs and an enable on the left, and eight outputs on the right.
Truth table (active-high, ):
| Active output | |||
|---|---|---|---|
| 0 | 0 | 0 | |
| 0 | 0 | 1 | |
| 0 | 1 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 0 | |
| 1 | 0 | 1 | |
| 1 | 1 | 0 | |
| 1 | 1 | 1 |
Each output: (the corresponding minterm), gated by .
Building a 4-to-16 Decoder from two 3-to-8 Decoders
Use the 4th (most-significant) input to enable one decoder at a time:
- Feed to the address inputs of both decoders.
- Connect through an inverter so that:
- Decoder-0 is enabled when (its enable ) → produces outputs –.
- Decoder-1 is enabled when (its enable ) → produces outputs –.
Since only one decoder is enabled for a given , exactly one of the 16 outputs is active for each 4-bit input, giving a complete 4-to-16 decoder.
Distinguish between a latch and a flip-flop. Explain the working of a JK flip-flop with its truth table, and describe how the race-around condition occurs and how a master-slave configuration eliminates it.
Latch vs Flip-Flop
| Latch | Flip-flop |
|---|---|
| Level-triggered (transparent while enable is active) | Edge-triggered (responds only at clock edge) |
| Output follows input as long as enable is HIGH | Output changes only on rising/falling edge |
| Asynchronous / gated by an enable level | Synchronous, clocked |
| e.g. SR latch, gated D latch | e.g. JK, D, T flip-flops |
JK Flip-Flop
The JK flip-flop removes the forbidden state of the SR flip-flop. With clock present:
| J | K | Action | |
|---|---|---|---|
| 0 | 0 | No change (hold) | |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Toggle |
Characteristic equation: .
Race-Around Condition
In a level-triggered JK flip-flop with , the output toggles. If the clock pulse width is greater than the propagation delay , the output toggles repeatedly () while the clock is HIGH. At the end of the pulse the final state is uncertain. This uncontrolled multiple toggling is the race-around condition, and it occurs when .
Master-Slave Elimination
A master-slave configuration uses two JK flip-flops in cascade driven by complementary clocks:
- The master is enabled when clock and captures the inputs, but its output cannot reach the outside.
- The slave is enabled when clock and transfers the master's stored value to the output.
Because the master and slave are never transparent at the same time, the data is sampled once and transferred once per clock cycle. The output can change only on the clock edge, so toggling can happen at most once per cycle, eliminating the race-around condition.
Explain the operation of a 4-bit Serial-In Parallel-Out (SIPO) shift register with a neat diagram. Illustrate the contents of the register after each clock pulse when the serial input sequence is applied (LSB first).
4-bit Serial-In Parallel-Out (SIPO) Shift Register
Structure: four D flip-flops in cascade, all driven by a common clock. Serial data enters of the first flip-flop; each flip-flop's output feeds the next flip-flop's D input (). All four outputs are read out in parallel. On each clock pulse the contents shift one position (here toward ) and the new serial bit enters at .
Operation with serial input applied LSB first (so the bits enter in time order ). Register starts cleared at ; bit shown entering at , shifting left:
| Clock | Serial in | ||||
|---|---|---|---|---|---|
| Initial | – | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 |
| 2 | 1 | 0 | 0 | 1 | 1 |
| 3 | 0 | 0 | 1 | 1 | 0 |
| 4 | 1 | 1 | 1 | 0 | 1 |
After 4 clock pulses the register holds , available in parallel. It takes clocks to serially load an -bit SIPO register before the full word is read out.
Differentiate between RAM and ROM. Briefly explain the internal organization of a ROM and show how a ROM can be used to implement the combinational functions and of two variables... (extend to three input variables) using a single ROM.
RAM vs ROM
| RAM | ROM |
|---|---|
| Read and write | Primarily read-only (written once / at manufacture) |
| Volatile — loses data on power-off | Non-volatile — retains data |
| Used for temporary working storage | Used for fixed programs/firmware, look-up tables |
| Types: SRAM, DRAM | Types: mask-ROM, PROM, EPROM, EEPROM |
Internal Organization of a ROM
A ROM is essentially a programmable decoder + OR array. An -input ROM has a fixed -to- decoder (a fixed/hardwired AND array generating all minterms) feeding a programmable OR array that produces the output bits. A ROM with address lines and data lines stores bits; each output column is the OR of the minterms programmed for that function.
Implementing functions with one ROM
The functions are given for input variables (extended to three inputs , words). The decoder generates minterms –; we program two outputs :
ROM truth table (program map):
| Addr | minterm | ||
|---|---|---|---|
| 000 | 0 | 1 | 0 |
| 001 | 1 | 0 | 1 |
| 010 | 2 | 1 | 0 |
| 011 | 3 | 0 | 1 |
| 100 | 4 | 0 | 1 |
| 101 | 5 | 1 | 0 |
| 110 | 6 | 0 | 1 |
| 111 | 7 | 1 | 0 |
The 3-to-8 decoder activates the addressed minterm line; the OR-array fuse is present at wherever the column is 1, and similarly for . Here and happen to be complementary. Thus a single ROM implements both combinational functions: every minterm need only be routed to the correct output column.
Compare PROM, PLA and PAL in terms of the programmability of their AND and OR arrays. Draw the basic structure of a PLA and explain why it is more flexible than a PROM for implementing arbitrary sum-of-products functions.
PROM vs PLA vs PAL
All three are programmable logic devices built from an AND array (forms product terms) feeding an OR array (forms sums). They differ in which array is programmable:
| Device | AND array | OR array |
|---|---|---|
| PROM | Fixed (full decoder — all minterms) | Programmable |
| PLA | Programmable | Programmable |
| PAL | Programmable | Fixed |
Structure of a PLA
Described diagram: the inputs (and their complements) drive a programmable AND plane that generates a chosen set of product terms (not all minterms — only those needed). These product terms feed a programmable OR plane whose outputs are the sum-of-products functions. Programmable connection points (fuses/anti-fuses) exist at every cross-point of both planes.
Why a PLA is more flexible than a PROM
- In a PROM the AND array is fixed and decodes all minterms; you can only choose how minterms are OR-ed. For functions of many variables this wastes a huge number of unused product lines ( grows exponentially).
- In a PLA the AND plane is programmable, so you generate only the specific product terms your functions require, and product terms can be shared among several outputs. This makes the PLA far more area-efficient for arbitrary, sparse SOP functions of many input variables, whereas a PROM is practical only for small look-up-table-style functions.
(a) Prove that the NAND gate is a universal gate by realizing the NOT, AND and OR functions using only NAND gates. (4 marks)
(b) Express the XOR function using NAND gates only. (2 marks)
(a) NAND as a Universal Gate
A gate is universal if NOT, AND and OR can all be built from it; then any Boolean function is realizable. For a NAND, .
NOT: tie both inputs together — .
AND: NAND followed by a NAND-inverter — . (First NAND gives , second NAND used as inverter gives .)
OR: invert each input with a NAND, then NAND the results — by De Morgan . So three NANDs: two as input inverters and one combining them.
Since NOT, AND, OR are all realized using only NAND gates, NAND is universal.
(b) XOR using NAND gates only
. A standard 4-NAND realization:
G1 = NAND(A, B) = (AB)'
G2 = NAND(A, G1) = (A·(AB)')'
G3 = NAND(B, G1) = (B·(AB)')'
Y = NAND(G2, G3) = A ⊕ B
Thus , using only four 2-input NAND gates.
Design a 1-bit magnitude comparator that compares two bits and and produces three outputs indicating , and . Write the truth table and derive the output expressions.
1-bit Magnitude Comparator
Compare two bits and producing , , .
Truth table:
| A | B | |||
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 |
Output expressions:
Implementation: uses one AND gate ( and ); uses one AND gate ( and ); is an XNOR of (equivalently , i.e. a NOR of the other two outputs). Two inverters supply .
Frequently asked questions
- Where can I find the BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) question paper 2078?
- The full BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) 2078 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
- Does the Digital Logic (IOE, EX 502) 2078 paper come with solutions?
- Yes. Every question on this Digital Logic (IOE, EX 502) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
- How many marks is the BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) 2078 paper?
- The BE Computer Engineering (IOE, TU) Digital Logic (IOE, EX 502) 2078 paper carries 80 full marks and is meant to be completed in 180 minutes, across 12 questions.
- Is practising this Digital Logic (IOE, EX 502) past paper free?
- Yes — reading and attempting this Digital Logic (IOE, EX 502) past paper on Kekkei is completely free.