Part A - All Questions
Part A - All Questions
Q.4. Draw the truth table for a half adder circuit and write the boolean expressions for
sum and carry.
Answer:
A | B | Sum | Carry
--|---|-----|------
0 | 0 | 0 | 0
0 | 1 | 1 | 0
1 | 0 | 1 | 0
1 | 1 | 0 | 1
Sum = A ⊕ B; Carry = A · B.
Q.7. What are the advantages and disadvantages of R-2R ladder D/A converter.
Answer: Advantage: Requires only two resistor values (R and 2R), providing better
accuracy. Disadvantage: Slower conversion speed compared to some other architectures.
Q.8. State the advantages and applications of sample and hold circuits.
Answer: Advantage: It holds the analog voltage steady, allowing the A/D converter
sufficient time for an accurate conversion. Application: Used at the input stage of A/D
converters.
● I₀ (ABC=000): Minterms (0, 1). Function includes m(0), so we need the output to be 1
when D=0. This means I₀ = D'.
● I₁ (ABC=001): Minterms (2, 3). Function includes both m(2) and m(3). The output is 1
for D=0 and D=1. So, I₁ = 1.
● I₂ (ABC=010): Minterms (4, 5). Function includes neither. So, I₂ = 0.
● I₃ (ABC=011): Minterms (6, 7). Function includes m(6). The output is 1 when D=0.
So, I₃ = D'.
● I₄ (ABC=100): Minterms (8, 9). Function includes both m(8) and m(9). So, I₄ = 1.
● I₅ (ABC=101): Minterms (10, 11). Function includes neither. So, I₅ = 0.
● I₆ (ABC=110): Minterms (12, 13). Function includes m(12). The output is 1 when
D=0. So, I₆ = D'.
● I₇ (ABC=111): Minterms (14, 15). Function includes m(14). The output is 1 when D=0.
So, I₇ = D'.
The implementation requires connecting A, B, C to the select lines S₂, S₁, S₀ respectively.
The data inputs are connected as derived above.
● SISO (Serial-In, Serial-Out): Data enters one bit at a time and exits one bit at a time.
● SIPO (Serial-In, Parallel-Out): Data enters serially but is available on all outputs
simultaneously.
● PISO (Parallel-In, Serial-Out): All bits are loaded at once but are shifted out one by
one.
● PIPO (Parallel-In, Parallel-Out): Data is loaded and read in parallel.
Applications:
1. Data Conversion: SIPO and PISO registers are crucial for converting between serial
and parallel data formats in communication systems like UARTs.
2. Time Delays: A SISO register can be used to delay a digital signal by N clock cycles,
where N is the number of flip-flops.
3. Counters and Sequence Generators: Modified shift registers like Ring Counters
and Johnson Counters are used to generate specific repeating state sequences for
control applications.
4. Arithmetic Operations: Can be used to perform multiplication and division by
powers of two.
Q.6. Write short notes on the following: (i) Sequential Memory (ii) ROM as a PLD
Answer:
(i) Sequential Memory: This is a type of memory where data is stored and accessed in a
specific linear sequence. To read or write a particular piece of data, one must physically scan
through all the preceding data locations. This is in contrast to random access memory (RAM)
where any location can be accessed directly. Magnetic tapes are a classic example of
sequential memory. While access time is very slow, its main advantage is very high storage
density and low cost per bit, making it suitable for data archiving and backup.
(ii) ROM as a PLD: A Read-Only Memory (ROM) can be used to implement any
combinational logic function, effectively acting as a Programmable Logic Device (PLD). A
ROM consists of a fixed AND array and a programmable OR array. The AND array is an
N-to-2ᴺ decoder that generates all possible 2ᴺ minterms for N input variables. The OR array
consists of a set of OR gates whose inputs can be programmably connected to any of the
minterm lines. By programming the connections in the OR array, we can sum any desired
set of minterms to create any Boolean function.
● Non-Volatile: CPLDs retain their configuration when power is removed, usually using
EEPROM or Flash technology.
● Predictable Timing: The interconnect structure is less complex than an FPGA's,
leading to very predictable and deterministic timing delays, which is a major
advantage for high-speed control logic.
● Applications: They are well-suited for implementing decoders, state machines, and
other "glue logic" functions that connect larger components in a digital system.
Paper: 4E1324 (2024) - Part C
● The Most Significant Bit (MSB) of the binary code is the same as the MSB of the
Gray code.
B₃ = G₃
● For all subsequent bits, the binary bit is the result of the XOR operation between the
previous binary bit and the current Gray code bit.
B₂ = B₃ ⊕ G₂
B₁ = B₂ ⊕ G₁
B₀ = B₁ ⊕ G₀
● BCD Addition: When adding two BCD numbers, the standard binary addition is
performed on each 4-bit group. A correction is needed if the result of a 4-bit sum is
an invalid BCD code (i.e., greater than 9) or if a carry-out is generated from the 4-bit
group. In either case, the result is corrected by adding 6 (0110) to that 4-bit sum. The
carry from this addition is then propagated to the next 4-bit group.
Carry Look-Ahead Adder: This is a high-speed parallel adder designed to overcome the
speed limitations of the ripple-carry adder. The ripple-carry adder's delay is proportional to
the number of bits because each full adder must wait for the carry-in from the previous
stage.
● Principle: The Carry Look-Ahead (CLA) logic computes the carry for each stage in
parallel. It uses two signals for each bit position i:
○ Carry Generate (Gᵢ = Aᵢ · Bᵢ): A carry is generated at this stage regardless of
the carry-in.
○ Carry Propagate (Pᵢ = Aᵢ ⊕ Bᵢ): An incoming carry will be propagated to the
next stage.
●
● Implementation: The carry-out for any stage i+1 can be expressed as Cᵢ₊₁ = Gᵢ +
Pᵢ·Cᵢ. By recursively expanding this, all carries can be calculated directly from the
primary inputs (A, B, and C₀) using a two-level logic circuit, making the addition
process significantly faster.
● Clocked SR Flip-Flop: This is the most basic clocked flip-flop, with Set (S), Reset
(R), and Clock (CLK) inputs. Its operation is defined as:
○ Hold (S=0, R=0): The output Q remains in its current state.
○ Set (S=1, R=0): The output Q is forced to 1 on the active clock edge.
○ Reset (S=0, R=1): The output Q is forced to 0 on the active clock edge.
○ Forbidden (S=1, R=1): This input condition is invalid because it attempts to
set and reset the output simultaneously, leading to an unpredictable state.
This is the main drawback of the SR flip-flop.
●
● J-K Flip-Flop: The J-K flip-flop is an enhancement of the SR flip-flop that resolves
the forbidden state issue. The J input behaves like S (Set) and the K input behaves
like R (Reset).
○ Hold (J=0, K=0): Output Q holds its state.
○ Set (J=1, K=0): Output Q becomes 1.
○ Reset (J=0, K=1): Output Q becomes 0.
○ Toggle (J=1, K=1): This is the key feature. The output inverts its current state
(Q becomes Q') on each active clock edge. This toggle functionality makes it
extremely versatile for designing counters.
●
● D-type Flip-Flop (Data/Delay Flip-Flop): This flip-flop has a single data input, D. Its
function is to capture and store the value on the D input at the moment of the active
clock edge. The characteristic equation is simply Q(t+1) = D. Whatever value (0 or 1)
is present at the D input is transferred to the Q output when the clock triggers. It
effectively delays the input signal by one clock cycle, making it the primary building
block for memory registers and shift registers.
● Advantage: Because all flip-flops are triggered by the same clock edge, they all
change state simultaneously (after a small propagation delay). This eliminates the
cumulative delay of ripple counters and allows for much higher operating frequencies
and reliable decoding of states.
● Design: The logic for the J-K or D inputs of each flip-flop is designed based on the
desired count sequence. An excitation table is used to determine the necessary
inputs for each flip-flop to transition from its present state to the next state in the
sequence.
Q.5. Describe A/D converter using voltage to frequency and voltage to time
conversion.
Answer:
These are both types of integrating A/D converters, which are known for their high noise
immunity but are generally slower than other architectures.
● Voltage-to-Frequency (V/F) ADC: This converter first transforms the analog input
voltage into a pulse train. The key principle is that the frequency of this pulse train is
directly proportional to the input voltage amplitude. The conversion to a digital value
is then achieved by using a counter to count the number of pulses that occur within a
fixed, precision time interval. A higher input voltage results in a higher frequency,
which in turn leads to a larger count and a higher digital output value.
● Voltage-to-Time (V/T) ADC (Dual-Slope Converter): This is a very common and
accurate integrating ADC. It converts the input voltage into a time interval, which is
then measured. The process involves two phases (slopes):
1. Phase 1 (Integrate Input): The analog input voltage V_in is integrated for a
fixed period of time (T₁). The voltage on the integrator's capacitor ramps up to
a level proportional to V_in.
2. Phase 2 (De-integrate Reference): The input to the integrator is switched to
a fixed, negative reference voltage (-V_ref). The capacitor now ramps down
at a constant rate. A counter measures the time (T₂) it takes for the voltage to
return to zero.
This time T₂ is directly proportional to V_in. The dual-slope method has the
advantage of canceling out errors due to component aging (like capacitor or
resistor value changes), making it very accurate.
●
b. (A3B)₁₆ to decimal:
Multiply each digit by its positional weight (power of 16).
= (A × 16²) + (3 × 16¹) + (B × 16⁰)
= (10 × 256) + (3 × 16) + (11 × 1)
= 2560 + 48 + 11 = 2619₁₀.
c. (2D5)₁₆ to binary:
Convert each hexadecimal digit to its 4-bit binary equivalent.
2 → 0010
D → 1101
5 → 0101
Result: (001011010101)₂.
d. (115)₁₀ to hexadecimal:
Use repeated division by 16.
115 ÷ 16 = 7 Remainder 3
7 ÷ 16 = 0 Remainder 7
Reading remainders bottom-up gives (73)₁₆.
● Power Consumption: CMOS has extremely low static power consumption because
in a steady state, one transistor in the complementary pair is always off. TTL
consumes significantly more power as its transistors draw current even when idle.
● Speed: Standard TTL is generally faster than older standard CMOS. However,
modern CMOS technologies (like HCMOS) are very fast and often outperform TTL
variants.
● Noise Immunity: CMOS has a higher noise margin and is more immune to noise
because its logic levels are closer to the supply rails (Vdd and Vss).
● Fan-out: This is the number of standard inputs a gate can drive. Standard TTL can
drive up to 10 other standard TTL gates. CMOS fan-out is very high when driving
other CMOS gates (limited by capacitance and speed requirements) but lower when
driving TTL gates.
● Supply Voltage: TTL operates on a strict +5V supply with tight tolerances. CMOS
has a much wider and more flexible operating voltage range (e.g., 3V to 15V for older
series).
● Packing Density: CMOS technology allows for a higher packing density of
transistors on a chip, which is why it dominates in LSI and VLSI applications like
microprocessors.
We create a 4-variable K-map and place 1s in the cells corresponding to the given minterms.
CD\AB 00 01 11 10
00 . . . .
01 1 1 1 1 (m1, m5, m13, m9)
10 . . . .
11 . 1 1 1 (m7, m15, m11)
From the K-map, we can form the following groups to cover all the 1s:
1. Group 1 (Quad): Covers the four corners of the map, m(1, 5, 9, 13). In these cells, B
is always 0 and D is always 1. The term for this group is B'D.
2. Group 2 (Quad): Covers the cells m(5, 7, 13, 15). Here, B is always 1 and D is
always 1. The term for this group is BD.
3. Group 3 (Quad): Covers the cells m(9, 11, 13, 15). Here, A is always 1 and D is
always 1. The term for this group is AD.
1. Data Input: Data is fed serially into the D input of the first flip-flop.
2. Shifting: At each active clock edge, the bit at the D input of each flip-flop is
transferred to its Q output. This effectively shifts the entire contents of the register
one position to the right. The new bit enters the first flip-flop, and the bit from the last
flip-flop is shifted out (and lost, unless captured).
3. Parallel Output: After four clock pulses, the 4-bit serial data word is fully loaded into
the register. The value of each bit is then available simultaneously on the parallel
output pins (Q₀, Q₁, Q₂, Q₃). This register is essential for converting serial data
streams from communication lines into parallel data for processing by a
microprocessor.
Q.5. Draw the logic diagram and timing sequence of a 4-bit ring counter.
Answer:
A 4-bit ring counter is a simple synchronous sequential circuit created from a shift register. It
circulates a single active logic level (usually a '1') through its stages.
Logic Diagram:
It is constructed from four D-type flip-flops (FF₀, FF₁, FF₂, FF₃) connected in a cascade. The
output of each flip-flop (Q) is connected to the data input (D) of the next one: Q₀→D₁, Q₁→D₂,
Q₂→D₃. The "ring" is formed by feeding the output of the final flip-flop (Q₃) back to the data
input of the first one (D₀). All flip-flops share a common clock signal. An asynchronous Preset
or Clear input is required to initialize the counter to a starting state, typically '1000', as it has
invalid "lock-up" states (e.g., 0000) from which it cannot escape.
Q.6. Explain the terms accuracy and resolution for D/A converter.
Answer:
Accuracy and resolution are two critical, but distinct, performance metrics for a
Digital-to-Analog Converter (DAC).
● Resolution: This is a measure of the smallest possible change in the analog output
voltage. It is determined by the number of digital input bits (N). For an N-bit DAC,
there are 2ᴺ possible output levels. The resolution is the voltage difference between
two adjacent output levels, often called the step size or LSB (Least Significant Bit)
value.
Resolution (Step Size) = V_fs / (2ᴺ), where V_fs is the full-scale output voltage.
A higher number of bits (e.g., 16-bit vs 8-bit) results in a smaller step size and thus a
finer, or higher, resolution.
● Accuracy: This measures how close the actual analog output voltage is to the
theoretically ideal or expected voltage for a given digital input. It is expressed as a
percentage of the full-scale range or in terms of LSBs. Accuracy is affected by
real-world imperfections in the DAC's components, such as:
○ Offset Error: A constant voltage shift present at the output even for a zero
input.
○ Gain Error: A deviation in the slope of the actual transfer curve from the ideal
one.
○ Non-linearity: The deviation of the transfer curve from a perfect straight line.
A converter can have high resolution (many small steps) but poor accuracy
(the steps are in the wrong place).
●
Q.1. Define the following with one example: Error correcting codes, Gray code,
Hamming distance, Even and odd parity code.
Answer:
● Error Correcting Codes (ECC): These are advanced codes designed not only to
detect the presence of errors in transmitted data but also to locate and correct a
certain number of them without requiring re-transmission. They achieve this by
adding carefully designed redundant bits. Example: Hamming code is a classic ECC
that can detect up to two-bit errors and correct single-bit errors.
● Gray Code: This is a non-weighted binary encoding system where any two
successive values differ in only one bit position. This property is highly useful in
systems where a value is changing sequentially (like a rotary shaft encoder) because
it prevents the temporary, erroneous intermediate states that can occur when multiple
bits change simultaneously in standard binary code. Example: The 2-bit Gray code
sequence is 00, 01, 11, 10.
● Hamming Distance: This is a metric for comparing two binary strings of equal
length. It is defined as the number of bit positions in which the corresponding bits are
different. The minimum Hamming distance of a code set determines its error
detection and correction capability. Example: The Hamming distance between the
codewords 10110 and 11010 is 3.
● Even and Odd Parity Code: This is a simple error detection scheme. A single bit,
called the parity bit, is appended to a block of data.
○ Even Parity: The parity bit is set to 0 or 1 to make the total number of '1's in
the codeword (data + parity bit) an even number. Example: For data 1101
(three 1s), the even parity bit is 1, making the codeword 11011.
○ Odd Parity: The parity bit is set to make the total number of '1's an odd
number. Example: For data 1101, the odd parity bit is 0, making the
codeword 11010.
This can detect any single-bit error.
●
Q.2. Using the Quine-McCluskey method, obtain the minimal sum of product
expression of the following function. F(A, B, C, D) = Σm(0,1,3,7,8,9,11,15).
Answer:
The Quine-McCluskey method is a tabular method for logic minimization.
Step 1: Group Minterms by Number of 1s
| Group | Minterm | Binary |
|---|---|---|
| G0 | 0 | 0000 |
| G1 | 1, 8 | 0001, 1000 |
| G2 | 3, 9 | 0011, 1001 |
| G3 | 7, 11 | 0111, 1011 |
| G4 | 15 | 1111 |
No further combinations are possible. The prime implicants are all terms from Step 2 that
were not used in Step 3, plus the term from Step 3.
Prime Implicants (PIs): B'D, A'B'C', B'C'D', A'CD, BCD, ACD.
● m(8) is only covered by B'C'D'. It is an Essential Prime Implicant (EPI). It also covers
m(0).
● m(7) is only covered by A'CD. It is an EPI. It also covers m(3).
● After selecting these EPIs, we need to cover the remaining minterms: m(1), m(9),
m(11), m(15).
● PI B'D covers m(1), m(9), and m(11).
● PI ACD covers m(11) and m(15).
● To cover the remaining minterms, we need to cover m(1), m(9), m(11), m(15).
● Selecting B'D covers 1, 9, 11. Only 15 remains.
● To cover 15, we must select either BCD or ACD. Both have the same cost.
● One minimal solution is F = B'C'D' + A'CD + B'D + BCD.
● Let's check the chart again. My EPI selection might be wrong.
○ m8 -> B'C'D'. EPI. Covers 0, 8.
○ Remaining: 1,3,7,9,11,15.
○ m9 -> only covered by B'D. EPI. Covers 1,3,9,11.
○ Remaining: 7, 15.
○ m7 -> only covered by A'CD or BCD.
○ m15 -> only covered by BCD or ACD.
○ To cover both 7 and 15, we can select BCD.
Minimal Solution: F = B'C'D' + B'D + BCD.
●
Q.3. a. Convert J-K flip-flop to S-R flip-flop. b. Design a 4-bit synchronous counter.
Answer:
a. Convert J-K flip-flop to S-R flip-flop:
The goal is to use a JK-FF and external logic to replicate the behavior of an SR-FF.
1. Characteristic Table: We create a table showing the SR inputs (S, R), the desired
state transition (Q(t) to Q(t+1)), and the required JK inputs (J, K) to achieve that
transition.
| S | R | Q(t) | Q(t+1) | J | K |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | X |
| 0 | 0 | 1 | 1 | X | 0 |
| 0 | 1 | 0 | 0 | 0 | X |
| 0 | 1 | 1 | 0 | X | 1 |
| 1 | 0 | 0 | 1 | 1 | X |
| 1 | 0 | 1 | 1 | X | 0 |
| 1 | 1 | X | X | X | X | (Forbidden in SR, so all are Don't Cares)
2. K-maps for J and K: We create K-maps for J and K in terms of S, R, and Q(t).
○ For J: The K-map gives J = S.
○ For K: The K-map gives K = R.
3.
4. Implementation: The conversion is trivial. Connect the S input directly to the J
terminal and the R input directly to the K terminal of the JK flip-flop.
1. State Table and Excitation Table: We determine the required T input for each
flip-flop (T₃, T₂, T₁, T₀) to transition from the Present State (Q₃Q₂Q₁Q₀) to the Next
State. A T-FF toggles (Q->Q') when T=1.
| Present State | Next State | T₃ | T₂ | T₁ | T₀ |
|---|---|---|---|---|---|
| 0000 | 0001 | 0 | 0 | 0 | 1 |
| 0001 | 0010 | 0 | 0 | 1 | 1 |
| 0010 | 0011 | 0 | 0 | 0 | 1 |
| 0011 | 0100 | 0 | 1 | 1 | 1 |
...and so on...
2. Derive Logic Expressions: By observing the pattern or using K-maps for each T
input:
○ T₀ toggles on every clock pulse: T₀ = 1.
○ T₁ toggles whenever Q₀ is 1: T₁ = Q₀.
○ T₂ toggles whenever Q₁ and Q₀ are both 1: T₂ = Q₁·Q₀.
○ T₃ toggles whenever Q₂, Q₁, and Q₀ are all 1: T₃ = Q₂·Q₁·Q₀.
3.
4. Circuit Implementation:
○ Use four T flip-flops, with all clock inputs connected to a common clock signal.
○ Connect T₀ to a logic HIGH source.
○ Connect T₁ to the Q₀ output.
○ Use a 2-input AND gate with inputs Q₁ and Q₀ to drive T₂.
○ Use a 3-input AND gate with inputs Q₂, Q₁, and Q₀ to drive T₃.
5.
Q.5. Write a notes on FPGA (field programmable gate array) with a neat diagram.
Answer:
A Field-Programmable Gate Array (FPGA) is a high-density, semiconductor integrated circuit
containing a large matrix of programmable logic components and programmable
interconnects. Unlike a microprocessor, which executes software instructions sequentially,
an FPGA is configured to implement a custom digital hardware circuit directly.
1. Configurable Logic Blocks (CLBs) / Logic Array Blocks (LABs): These are the
fundamental building blocks for implementing logic. A typical CLB contains one or
more Look-Up Tables (LUTs) and several flip-flops. An N-input LUT is a small RAM
that can implement any combinational logic function of N variables. The flip-flops are
used to implement sequential logic (registers, counters, state machines).
2. Programmable Interconnects: This is a rich, hierarchical network of routing
channels and programmable switches (pass transistors or multiplexers) that connect
the CLBs to each other and to the I/O blocks. The routing architecture is a key factor
in an FPGA's performance and density.
3. Input/Output Blocks (IOBs): Located at the periphery of the chip, these blocks
connect the internal logic to the external pins of the FPGA. They are highly
configurable to support a wide variety of I/O standards (e.g., LVCMOS, LVDS) and
can be configured as inputs, outputs, or bidirectional pins.
4. Specialized Blocks: Modern FPGAs also include dedicated hardware blocks for
common functions, such as Block RAMs (BRAMs) for memory, DSP slices for digital
signal processing, and high-speed transceivers.
Design Flow:
1. Design Entry: The user describes the desired hardware circuit using a Hardware
Description Language (HDL) like VHDL or Verilog.
2. Synthesis: An EDA tool synthesizes the HDL code into a netlist of generic logic
gates and flip-flops.
3. Implementation (Place & Route): The tool maps the synthesized logic to the
specific resources of the target FPGA (e.g., placing logic into CLBs) and then routes
the connections between them using the programmable interconnects.
4. Bitstream Generation: The final placed and routed design is converted into a
bitstream file, which contains the configuration data for every programmable element
in the FPGA. This file is then downloaded to the FPGA to implement the circuit.