CS302 – Digital Logic Design: Midterm Important Subjective (40 Solved Q&As)
Computer Science • Read every solved subjective question with its model answer directly on this page. Free, no login required.
All 664 Midterm Packs · CS302 Course Page · CS302 MCQ Pack (251 MCQs)
-
Differentiate between hexadecimal and octal number system. (Fall 2009 paper, Q20)
Topic: Core Subjective Topics
Octal is a base-8 number system, whereas hexadecimal is a base-16 number system. Octal and hexadecimal are used to represent numbers instead of decimal because there is a very easy and direct way to convert from the "real" way that computers store numbers (binary) to something easier for humans to handle (fewer symbols). To translate a binary number to octal, simply group the binary digits three at a time and convert each group. For hexadecimal, group the binary digits four at a time and convert each group of four bits into its hex digit (0-9, A-F).
-
Explain the "Sum-of-Weights Method" for hexadecimal-to-decimal conversion with at least one example. (Fall 2009 paper, Q21)
Topic: Core Subjective Topics
The hexadecimal (hex) numbering system provides even shorter notation than octal. Hexadecimal uses a base of 16. It employs 16 digits: numbers 0 through 9, and letters A through F, with A through F substituted for numbers 10 to 15 respectively. Hexadecimal numbers can be expressed as their decimal equivalents by using the sum-of-weights method: multiply each hex digit by the weight (power of 16) of its position and add the products. | Example: convert 1B7 (hex) to decimal. | Position weights: 16^2 = 256, 16^1 = 16, 16^0 = 1. | 7 x 16^0 = 7 x 1 = 7 | B x 16^1 = 11 x 16 = 176 | 1 x 16^2 = 1 x 256 = 256 | Sum of products = 7 + 176 + 256 = 439. So 1B7 (hex) = 439 (decimal). | Like octal numbers, hexadecimal numbers can easily be converted to binary or vice versa by writing the 4-bit binary equivalent of each hex digit (e.g. 1 = 0001, B = 1011, 7 = 0111, so 1B7 = 0001 1011 0111 in binary).
-
Which device performs an operation which is the opposite of the Decoder function? (Fall 2009 paper, Q17)
Topic: Core Subjective Topics
The Encoder. (A decoder converts a binary code at its inputs into a single active output out of many; an encoder performs the reverse operation, converting one active input line into a binary code at its outputs.)
-
Draw the function table of a two-bit comparator circuit, map it to a K-Map and derive the expression for (A > B). (Fall 2009 paper, Q22)
Topic: Core Subjective Topics
The function table of the two-bit comparator (A = X1X0, B = Y1Y0) is given below the answer heading. | TABLE:COMPARATOR | Mapping the 1s of the (A > B) column onto a 4-variable K-Map (variables X1 X0 Y1 Y0) and grouping them gives three groups: the four cells with X1 = 1 and Y1 = 0 give the term X1.Y1' ; the cells X0 = 1, Y1 = 0, Y0 = 0 give X0.Y1'.Y0' ; and the cells X1 = 1, X0 = 1, Y0 = 0 give X1.X0.Y0'. The derived expression for A > B is: | (A > B) = X1.Y1' + X0.Y1'.Y0' + X1.X0.Y0' | (where X1X0 is the 2-bit number A, Y1Y0 is the 2-bit number B, and ' denotes NOT).
-
Name any two modes in which PALs are programmed. (Fall 2009 paper, Q18)
Topic: Core Subjective Topics
PAL devices are programmed by blowing the fuses permanently using over-voltage. (Once a fuse link is blown it cannot be restored, so a PAL is a one-time programmable device; the programmed pattern of intact and blown fuses implements the desired AND-OR logic.)
-
Explain Combinational Function Devices. (Fall 2009 paper, Q19)
Topic: Core Subjective Topics
Combinational function devices are combinational logic devices whose output is a standard Boolean function of their inputs. XOR, XNOR, NAND and NOR are combinational function devices.
-
Convert the following: (a) the binary number 1010110 into decimal; (b) the decimal number 17 into BCD.
Topic: Core Subjective Topics
(a) Using the sum-of-weights method, the bit weights of 1010110 are 64, 32, 16, 8, 4, 2, 1. Only the bits at weights 64, 16, 4 and 2 are 1, so the decimal value = 64 + 16 + 4 + 2 = 86. | (b) In BCD each decimal digit is written separately as a 4-bit binary group: 1 = 0001 and 7 = 0111, so decimal 17 in BCD = 0001 0111. (Note: this is different from the pure binary value of 17, which is 10001.)
-
Find (a) the 2's complement of the binary number 100101, and (b) the 4-bit 2's complement representation of -7.
Topic: Core Subjective Topics
The 2's complement of a binary number is obtained by inverting all bits (1's complement) and adding 1 to the result. | (a) 100101 -> invert -> 011010 -> add 1 -> 011011. So the 2's complement of 100101 is 011011. | (b) +7 in 4 bits is 0111. Invert: 1000. Add 1: 1001. So -7 in 4-bit 2's complement form is 1001.
-
What is the Gray code? How does it differ from the ordinary binary code? Write the Gray code for decimal 8.
Topic: Core Subjective Topics
The Gray code is a binary code in which no weights are assigned to the bit positions, i.e. it is not a positional (weighted) code. It differs from the unsigned binary code in that successive values of the Gray code differ by only one bit, which makes it useful in applications such as shaft encoders and error-sensitive counting where changing only one bit at a time avoids false intermediate readings. Decimal 8 is 1000 in binary; converting to Gray code (keep the MSB, then XOR adjacent binary bits: 1, 1^0=1, 0^0=0, 0^0=0) gives 1100. So decimal 8 in Gray code is 1100.
-
What is a parity bit? Explain the even parity method of error detection.
Topic: Core Subjective Topics
Binary information can get corrupted during storage or transmission (a 1 may change to 0 or a 0 to 1). Many systems therefore append an extra bit, called the parity bit, to detect such errors. In the even parity method, the number of 1s in the information is counted and the appended parity bit is set to 0 or 1 so that the total number of 1s (including the parity bit) becomes even. At the receiving end, if the received data (with parity bit) does not have an even number of 1s, an error is detected. For example, for the information 10001101 (which has four 1s, already even), the even parity bit is 0.
-
Simplify the Boolean expression F = A + A'.B using the laws of Boolean algebra, showing each step.
Topic: Core Subjective Topics
F = A + A'.B | = (A + A').(A + B) [Distributive law: X + Y.Z = (X + Y)(X + Z), with X = A, Y = A', Z = B] | = 1.(A + B) [Complementary law: A + A' = 1] | = A + B [Identity law: 1.X = X] | Hence A + A'.B = A + B.
-
Why are the NAND and NOR gates called universal gates? Show how the NOT, AND and OR operations can be implemented using NAND gates only.
Topic: Core Subjective Topics
NAND and NOR gates are called universal gates because any Boolean expression (and therefore any logic circuit) can be implemented using only NAND gates, or using only NOR gates. | Using NAND gates only: | NOT: connect both inputs of a NAND gate together; output = (A.A)' = A'. | AND: follow a NAND gate with a NOT (NAND with tied inputs); output = ((A.B)')' = A.B. | OR: invert both inputs with NOT-configured NAND gates and feed them into a third NAND gate; output = (A'.B')' = A + B (by De Morgan's theorem).
-
Differentiate between Sum-of-Products (SOP) and Product-of-Sums (POS) forms of Boolean expressions, giving one example of each.
Topic: Core Subjective Topics
In the Sum-of-Products (SOP) form, the expression is written as a sum (OR) of product (AND) terms, e.g. F = A.B + A.B.C + A.C. An SOP expression is equal to 1 when one or more of its product terms are equal to 1. In the Product-of-Sums (POS) form, the expression is written as a product (AND) of sum (OR) terms, e.g. F = (A + B).(A + B' + C).(A' + C). A POS expression is equal to 0 when one or more of its sum terms are equal to 0. SOP is naturally implemented with an AND-OR (two-level) circuit, while POS is implemented with an OR-AND circuit.
-
What is a Karnaugh Map (K-Map)? How many cells are there in a 3-variable and a 4-variable K-Map?
Topic: Core Subjective Topics
A Karnaugh Map is a graphical method of simplifying Boolean expressions. Like a truth table, it presents all possible values of the input variables and the resulting output for each combination, arranged so that adjacent cells differ in only one variable, which allows common terms to be grouped and eliminated. A 3-variable K-Map has 2^3 = 8 cells, and a 4-variable K-Map has 2^4 = 16 cells, one cell for each minterm (or maxterm).
-
Use a Karnaugh Map to simplify the expression F(A, B, C) = sum of minterms (1, 3, 5, 6, 7), i.e. F = A'B'C + A'BC + AB'C + ABC' + ABC.
Topic: Core Subjective Topics
Plot the minterms on a 3-variable K-Map (rows A, columns BC in Gray order 00, 01, 11, 10): | A = 0 row: BC=00 -> 0, BC=01 -> 1 (m1), BC=11 -> 1 (m3), BC=10 -> 0. | A = 1 row: BC=00 -> 0, BC=01 -> 1 (m5), BC=11 -> 1 (m7), BC=10 -> 1 (m6). | Grouping: the four cells with C = 1 (m1, m3, m5, m7) form one group of four, giving the term C. The remaining cell m6 (ABC') pairs with m7 (ABC), giving the term A.B. No smaller expression covers all the 1s. | Simplified expression: F = C + A.B. | (Check: F = 1 exactly for input combinations 001, 011, 101, 110, 111, as required.)
-
Differentiate between the TTL and CMOS logic families with reference to supply voltage, power dissipation and noise margin.
Topic: Core Subjective Topics
Supply voltage: TTL devices work with a fixed DC supply of +5 V. CMOS devices work with supplies such as 5 V (CMOS 5 V series) or 3.3 V (CMOS 3.3 V series). | Power dissipation: the power dissipation of TTL devices remains constant throughout their operation. The power dissipation of CMOS devices is very low when idle and increases with the operating (switching) frequency; overall, the power consumption of TTL is higher than that of CMOS. | Noise margin: noise margin is a measure of a circuit's immunity to noise. The high-level noise margin VNH of the CMOS 5 V series is 0.9 V, whereas the high-level and low-level noise margins (VNH and VNL) of TTL are 0.4 V each, so CMOS offers better noise immunity. | In general, CMOS is preferred for low-power applications, while TTL is an older family with constant power draw and faster operation than the early (slow-switching) CMOS devices.
-
What is a tri-state buffer? Describe its three output states and one application.
Topic: Core Subjective Topics
A tri-state buffer is a logic buffer (basically a NOT/buffer gate with an enable or control input) whose output can be in one of three states: logic 0, logic 1, and a high-impedance (Hi-Z) state in which the output is effectively disconnected from the circuit. When the control line is active (e.g. high), the buffer operates like an ordinary gate; when the control line is inactive, the output goes to the Hi-Z state. Application: tri-state buffers allow several device outputs to share a common data bus, because only one device drives the bus at a time while all others remain in the Hi-Z state.
-
Differentiate between a Half Adder and a Full Adder. Give the Boolean expressions for the outputs of a Full Adder.
Topic: Core Subjective Topics
A Half Adder adds two 1-bit numbers (A and B); it has 2 inputs and 2 outputs (Sum and Carry), with Sum = A XOR B and Carry = A.B. It cannot accept a carry input from a previous lower-order stage. A Full Adder adds three bits: the two input bits A and B plus a carry-in Cin from the previous stage; it has 3 inputs and 2 outputs. Its expressions are: | Sum = A XOR B XOR Cin | Carry-out = Cin.(A XOR B) + A.B | A Full Adder can be built from two Half Adders and an OR gate, and n Full Adders are cascaded to add two n-bit numbers.
-
Two 4-bit binary numbers A = 1011 and B = 1111 are applied to a 4-bit parallel adder with carry-in Cin = 0. Determine the sum output and the final carry-out, showing the addition bit by bit.
Topic: Core Subjective Topics
Bit 0 (LSB): 1 + 1 + 0 = 0, carry 1 (sum bit S0 = 0, C1 = 1). | Bit 1: 1 + 1 + 1 = 1, carry 1 (S1 = 1, C2 = 1). | Bit 2: 0 + 1 + 1 = 0, carry 1 (S2 = 0, C3 = 1). | Bit 3: 1 + 1 + 1 = 1, carry 1 (S3 = 1, C4 = 1). | So the 4-bit sum output is S = 1010 and the final carry-out Cout = 1, i.e. the complete result is 1 1010 (decimal 26 = 11 + 15, which checks the addition).
-
Differentiate between an Encoder and a Decoder, giving one application of each.
Topic: Core Subjective Topics
A Decoder converts a binary code at its n inputs into 2^n output lines, of which exactly one is activated for each input combination; e.g. a BCD-to-7-segment decoder (4 inputs, 7 outputs) drives a seven-segment display. An Encoder performs the opposite (reverse) operation: it converts one active input line out of many (up to 2^n lines) into an n-bit binary code at its outputs; e.g. a decimal-to-BCD keypad encoder is used in telephone/calculator keypads to convert the pressed key into a BCD code.
-
What is a Multiplexer? How many data select (control) lines are required to select one of eight inputs? Also state the function of a Demultiplexer.
Topic: Core Subjective Topics
A Multiplexer (MUX) is a combinational circuit that selects binary information from one of many input lines and directs it to a single output line; it has many inputs and a single output (plus select lines). The selection is controlled by the data select lines: with n select lines, up to 2^n inputs can be selected, so selecting one of eight inputs requires 3 select lines (2^3 = 8). A multiplexer is also called a data selector and can be used as a parallel-to-serial converter. A Demultiplexer (DEMUX) performs the reverse operation: it has a single input and many outputs, and routes the input to the one output chosen by its select lines.
-
Differentiate between PROM, PAL and PLA in terms of which of their AND and OR arrays are programmable. Why can a GAL be reprogrammed?
Topic: Core Subjective Topics
PROM: it consists of a fixed (non-programmable) AND array, configured as a decoder, and a programmable OR array. | PAL (Programmable Array Logic): it has a programmable AND array and a fixed OR array. | PLA (Programmable Logic Array): both its AND array and its OR array are programmable. | A GAL (Generic Array Logic) device can be reprogrammed because, instead of one-time fuse links, it uses electrically erasable (E2CMOS/EEPROM-type) floating-gate logic cells, so the programmed pattern can be erased and rewritten many times.
-
What is ABEL? Write the ABEL symbols for the NOT, AND, OR and XOR operations, and state how every ABEL equation must end.
Topic: Core Subjective Topics
ABEL (Advanced Boolean Expression Language) is a hardware description language used to program PLDs such as PALs and GALs. Its operation symbols are: NOT is written as ! (e.g. !A), AND as & , OR as # , and XOR as $ . For example, the Boolean expression A + B is written in ABEL as A # B. All ABEL equations must end with a semicolon ( ; ). ABEL is also case-sensitive: the variable 'A' is treated separately from the variable 'a'.
-
What is an S-R latch? Give its truth table (active-HIGH, NOR-gate based) and identify the invalid condition.
Topic: Core Subjective Topics
An S-R (Set-Reset) latch is a bistable sequential circuit, i.e. it has two stable states and stores one bit of information; it can be implemented using two cross-coupled NOR gates. It retains its state unless the inputs force a change. For an active-HIGH S-R latch: | S = 0, R = 0 -> Q unchanged (hold / no change) | S = 1, R = 0 -> Q = 1 (SET) | S = 0, R = 1 -> Q = 0 (RESET) | S = 1, R = 1 -> Q = 0 and Q' = 0 (INVALID condition - both outputs become equal, so this input combination is not allowed).
-
Differentiate between Combinational and Sequential logic circuits.
Topic: Core Subjective Topics
In a combinational circuit, the output at any instant depends only on the present combination of inputs; such circuits have no memory or storage elements (e.g. logic gates, adders, multiplexers, encoders and decoders). In a sequential circuit, the output depends on the present inputs as well as on the past history (previous state) of the circuit; such circuits contain storage elements (e.g. latches and flip-flops) that retain the state. Sequential circuits are therefore used wherever information must be stored, such as in registers, counters and memories.
-
How many inputs and outputs does the GAL22V10 have?
Topic: Core Subjective Topics
The GAL22V10 has 22 inputs and 10 outputs. (In the device name, V stands for Variable.)
-
What is an equivalent representation for the Boolean expression A' + 1?
Topic: Core Subjective Topics
Using the Boolean rule A + 1 = 1, put A = A': A' + 1 = 1. Any variable ORed with 1 always gives 1.
-
What are PLDs? How are they classified?
Topic: Core Subjective Topics
Programmable Logic Devices (PLDs) are integrated circuits made of a matrix of AND and OR gates that can be programmed to obtain certain logic functions. They replaced SSI and MSI circuits, saving space and reducing the number of devices in a design. PLDs are classified into four types: (a) PROM - Programmable Read-Only Memory, (b) PLA - Programmable Logic Array, (c) PAL - Programmable Array Logic, (d) GAL - Generic Array Logic (similar to PAL but reprogrammable).
-
If an S-R latch has a 0 on the S input and a 1 on the R input, and then the R input goes to 0, what will the latch be?
Topic: Core Subjective Topics
With S = 0 and R = 1, the latch is in the RESET state (Q = 0). When R then goes to 0, both inputs become 0 (S = 0, R = 0), which is the hold condition, so the latch remains in the reset condition (Q stays 0).
-
For BCD numbers that add up to an invalid BCD number or generate a carry, the number 6 (0110) is added to the result. Why?
Topic: Core Subjective Topics
The binary combinations 1010, 1011, 1100, 1101, 1110 and 1111 are not allowed in BCD. When the sum of two BCD digits produces one of these invalid combinations or generates a carry, the result is 6 more than the correct BCD digit, because the binary adder counts through all 16 combinations whereas a BCD digit counts only 10. Adding 6 (0110) skips the six invalid combinations and gives the correct BCD result. Example: 15 + 9: 0001 0101 + 0000 1001 = 0001 1110 (1110 is invalid), add 0000 0110, giving 0010 0100 = 24.
-
Why do we use +0V and +5V instead of +0V and +1V in Digital Logic Design, when the values are always '0' and '1'?
Topic: Core Subjective Topics
Logic circuits are built from electronic devices (ICs) that operate on actual voltages, not on the abstract values 0 and 1. In the TTL/CMOS circuits used in Digital Logic Design the supply voltage is +5 V, so a logic 1 is represented by +5 V applied to a gate input and a logic 0 is represented by 0 V. The values 0 and 1 are simply the binary names given to these two voltage levels.
-
Where do we use the Caveman Number System?
Topic: Core Subjective Topics
The Caveman number system is a primitive system of representing numbers with symbols, introduced in very old ages as a symbolic representation of quantities (counts). It is only of historical interest: it is not used anywhere in modern practice, and is studied just to see how number systems evolved into the positional systems used today.
-
How is a Standard SOP expression converted into a Standard POS expression?
Topic: Core Subjective Topics
To convert a Standard SOP expression into a Standard POS expression: (1) write the binary values of all the product terms (minterms) present in the SOP expression; (2) the binary values that are NOT present in the SOP expression are the values of the sum terms (maxterms) of the POS expression; (3) write the POS expression as the product of those maxterms, complementing each literal as required (a variable is written uncomplemented for a 0 and complemented for a 1 in a maxterm).
-
Write the truth table of a NOR gate.
Topic: Core Subjective Topics
NOR gate truth table (inputs A, B; output F = (A + B)'): A = 0, B = 0 -> F = 1 A = 0, B = 1 -> F = 0 A = 1, B = 0 -> F = 0 A = 1, B = 1 -> F = 0 The NOR output is 1 only when both inputs are 0.
-
What is an 8-to-3 bit encoder? Explain briefly.
Topic: Core Subjective Topics
An encoder performs the operation opposite to that of a decoder: it accepts an active level at one of its inputs and generates a binary (or BCD) code at its outputs representing the selected input. An 8-to-3 binary encoder has 8 inputs (I0 to I7) and 3 outputs (Y2, Y1, Y0). When input Ik is active, the outputs give the 3-bit binary code of k; for example, if I5 is active (and all other inputs are inactive), the output is Y2Y1Y0 = 101. In general, a 2^n-to-n encoder converts 2^n input lines into an n-bit binary code.
-
How many input and output bits does a Half-Adder contain?
Topic: Core Subjective Topics
A Half-Adder has 2 input bits (the two bits A and B to be added) and 2 output bits (the Sum bit S and the Carry bit C).
-
Draw (write) the truth table of a NAND-based S-R Latch.
Topic: Core Subjective Topics
In a NAND-based S-R latch the inputs are active-LOW (S' and R'). Its truth table is: S' = 0, R' = 0 -> Q = 1, Q' = 1 (Invalid condition) S' = 0, R' = 1 -> Q = 1, Q' = 0 (Set) S' = 1, R' = 0 -> Q = 0, Q' = 1 (Reset) S' = 1, R' = 1 -> Q and Q' unchanged (Hold / no change)
-
Draw the block diagram of a 4-bit BCD Adder and explain it briefly.
Topic: Core Subjective Topics
A 4-bit BCD Adder is built from two 4-bit binary adders and correction logic. The first 4-bit binary adder adds the two BCD digits A and B (with carry-in). Its sum output passes through correction-detection logic (AND/OR gates) which produces a signal when the sum is greater than 9 (1001) or a carry is generated. When this signal is 1, the second 4-bit binary adder adds 0110 (6) to the first sum to produce the corrected BCD sum digit; when the signal is 0, the second adder adds 0000 and the sum passes unchanged. The carry-out of the correction stage is the BCD carry to the next digit position.
-
A tri-state buffer's control input can be connected in four different ways. Name any three.
Topic: Core Subjective Topics
The control (enable) input of a tri-state buffer can be connected in any of these ways: (1) tied permanently to logic high (+5V), so the buffer stays enabled all the time; (2) tied permanently to logic low (GND), so the buffer stays disabled (output in the high-impedance state); (3) connected to an external control/enable signal generated by another circuit, so the buffer is enabled only when required; (4) connected to the output of another logic circuit (for example a decoder) that enables one buffer at a time on a shared bus.
-
Explain how a Multiplexer can be used as a 'Logic Function Generator' for a three-variable function.
Topic: Core Subjective Topics
A multiplexer can implement any Boolean function of its select variables, so it works as a logic function generator. The variables of the function are connected to the select (control) inputs of the multiplexer, and each data input is tied to logic 0 or logic 1 according to the value of the function in the corresponding row of the truth table. As the select inputs step through all combinations, the output reproduces the function values. For a three-variable function, an 8-to-1 multiplexer is used: the three variables drive the select lines and the eight data inputs are set to the truth-table outputs (0 or 1) of the function.