DE
DE
Excess-3 Code
For example:
Example Table:
0 3 0011 0011
1 4 0100 0100
2 5 0101 0101
3 6 0110 0110
4 7 0111 0111
5 8 1000 1000
6 9 1001 1001
7 10 1010 1010
8 11 1011 1011
9 12 1100 1100
1/10
Usage: Excess-3 code is used in applications requiring digital calculations, encoding systems,
and error detection techniques.
Gray code, also known as reflected binary code, is a binary numeral system where two
successive values differ in only one bit. This unique property minimizes errors in digital
systems, especially in analog-to-digital conversions and error-sensitive applications like
position encoders, as only one bit changes at a time.
1. Keep the most significant bit (MSB) of the binary number the same in Gray code.
2. For each subsequent bit, perform an XOR operation between the current bit and the bit
to its left.
For example:
Binary: 1011
1 ⊕ 0 = 1, 0 ⊕ 1 = 1, 1 ⊕ 1 = 0
Gray Code: 1110
0000 0000
0001 0001
0010 0011
0011 0010
0100 0110
0101 0111
0110 0101
0111 0100
2/10
Gray code is widely used in digital systems to reduce error rates during bit transitions,
making it valuable for high-accuracy applications.
Sum of Products (SOP) and Product of Sums (POS) are two common forms of representing
Boolean expressions in digital logic. They simplify the design and analysis of digital circuits.
Example:
Consider a Boolean function F (A, B, C) that is true for the minterms where ABC =
001, 100, and 111.
F (A, B, C) = A ⋅ B ⋅ C + A ⋅ B ⋅ C + A ⋅ B ⋅ C
Example:
Using the same function F (A, B, C), but now expressed in POS form based on the
maxterms where F = 0 (e.g., ABC = 000, 010, 110, and 101):
F (A, B, C) = (A + B + C) ⋅ (A + B + C) ⋅ (A + B + C ) ⋅ (A + B + C )
Summary
SOP: Each product term represents where the function is true, combined with OR
operations.
3/10
POS: Each sum term represents where the function is false, combined with AND
operations.
Both forms are crucial for simplifying and designing logical expressions in digital circuit
design.
Add these BCD numbers i) 1101 + 1011 ii) 1011 1011 + 1110
1010 (2 marks)
To add Binary-Coded Decimal (BCD) numbers, remember that BCD uses a 4-bit
representation for each decimal digit (0–9). When the sum of any BCD digit exceeds 9, we
add a "correction" of 6 (i.e., 0110 in binary) to adjust the result back to valid BCD.
10010 represents two BCD digits: 0010 (2) and 0100 (4).
4/10
1011 + 1010 = 10101
This sum (21 in decimal) exceeds 9, so we add the correction of 6:
Final Answers
1. i) 1101 + 1011 = 0010 0100 (BCD for 24)
2. ii) 1011 1011 + 1110 1010 = 0001 1001 0011 (BCD for 193)
2/2
To simplify the Boolean expression Y (w, x, y, z) = Σm(0, 2, 4, 8, 7, 10, 12, 14, 15) with
don't-care conditions D(6, 11) using a Karnaugh map (K-map), follow these steps:
1. Set Up the K-map: For a 4-variable function, we use a 4x4 K-map with variables w, x, y,
and z arranged as follows:
lua
yz
00 01 11 10
wx -------------------
00 | m0 m1 m3 m2 |
01 | m4 m5 m7 m6 |
5/10
11 | m12 m13 m15 m14|
10 | m8 m9 m11 m10|
Place a 1 in the K-map for each minterm in Σm(0, 2, 4, 8, 7, 10, 12, 14, 15).
lua
yz
00 01 11 10
wx -------------------
00 | 1 0 0 1 |
01 | 1 0 1 X |
11 | 1 0 1 1 |
10 | 1 0 X 1 |
3. Grouping: Group the 1s and don't-care terms into the largest possible groups of 1, 2, 4,
or 8 cells. Prioritize groups that will simplify the expression the most.
Group 1: A group of 8 covering minterms (0, 2, 4, 8, 12, 10, 14, 15) and don’t-cares (6
and 11).
For Group 1: This group simplifies to w ′ since x varies but w is 0 across the group.
For Group 2: This group simplifies to xz because y varies but x and z are consistent
across the group.
Y (w, x, y, z) = w′ + xz
Final Answer
Y (w, x, y, z) = w′ + xz
6/10
Explain half adder and full adder circuits with truth tables.
(14 marks)
Adder circuits are fundamental components in digital electronics used for performing binary
addition. They are crucial in various arithmetic operations within digital systems. There are
two primary types: the Half Adder and the Full Adder.
1. Half Adder
A Half Adder is a combinational circuit that adds two single-bit binary numbers, producing a
sum and a carry. It is called a "half" adder because it does not account for any incoming
carry from a previous addition.
Circuit Design
Logic Operations
S =A⊕B
Carry (C) is the AND of A and B .
C =A⋅B
Truth Table
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Explanation
When both inputs A and B are 0, both sum and carry are 0.
7/10
When A is 0 and B is 1, the sum is 1 and the carry is 0.
When both inputs are 1, the sum is 0 (since 1 + 1 = 10 in binary) and the carry is 1.
The Half Adder is often used in basic addition circuits, but its limitation is that it does not
account for a carry-in from previous operations.
2. Full Adder
A Full Adder is an advanced version of the Half Adder, capable of adding three bits: two input
bits and an incoming carry bit from a previous addition. This makes it suitable for chaining
multiple adders together to add binary numbers longer than a single bit.
Circuit Design
Logic Operations
S = A ⊕ B ⊕ Cin
Truth Table
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
8/10
A B Cin Sum (S) Cout
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Explanation
When all inputs A, B , and Cin are 0, both sum and carry-out are 0.
For combinations resulting in a binary sum of 2 (e.g., A = 0, B = 1, Cin = 1), the sum
is 0 with a carry-out of 1.
For a binary sum of 3 (all inputs are 1), the sum is 1 and the carry-out is 1.
The Full Adder circuit is ideal for multi-bit binary addition as it allows carrying between
adjacent bits.
Summary
Circuit Inputs Outputs Function
Half Adder A, B Sum (S), Carry (C) Adds two bits without carry-in
The Full Adder’s ability to handle carry-in makes it an essential building block for arithmetic
circuits, enabling accurate addition of binary numbers in multi-bit digital systems.
A BCD to 7-segment decoder is a digital circuit that converts a Binary-Coded Decimal (BCD)
input into signals to drive a 7-segment display, allowing it to represent decimal digits (0–9)
visually. The 7-segment display consists of seven LEDs arranged in the shape of the number
"8," labeled segments a through g. By illuminating different combinations of these
segments, any decimal digit can be displayed.
9/10
Working of a BCD to 7-Segment Decoder
1. BCD Input: The decoder takes a 4-bit BCD input, where each digit (0–9) is represented in
binary (0000 for 0 through 1001 for 9). Inputs that are not valid BCD values (1010 to
1111) are ignored or result in all segments being off.
2. Segment Control: The decoder maps each BCD input to an appropriate combination of
outputs that control the seven segments (a–g). For example:
For 0 (BCD 0000): The segments a, b, c, d, e, and f are on, while g is off.
3. Logic Circuit: Internally, the decoder uses a combination of logic gates to determine
which segments should be illuminated based on the BCD input. Each segment output (a–
g) is a function of the BCD inputs (A, B, C, D).
4. Display Output: The appropriate segments are illuminated to display the corresponding
decimal digit on the 7-segment display.
By converting BCD input values to specific 7-segment configurations, the decoder enables
straightforward display of decimal numbers in digital systems, such as calculators and digital
clocks.
2/2
10/10