Digital Logic
Deep Understanding: 85 hours
Community
Digital Logic
2077 Boards
Section A
Answer any two questions.
To design a combinational circuit that generates the 9's complement of a BCD number, we need to determine the output logic for each bit based on the input BCD digit. A BCD number represents a decimal digit from 0 to 9 using four bits (A3 A2 A1 A0). The 9's complement of a digit D is 9 - D.
1. Truth Table Derivation
Let the 4-bit BCD input be A3A2A1A0 (where A3 is the MSB) and the 4-bit output, representing the 9's complement, be Y3Y2Y1Y0 (where Y3 is the MSB). Invalid BCD inputs (decimal 10 to 15) are treated as "don't cares" for simplification.
| Decimal (Input) | A3 | A2 | A1 | A0 | Decimal (Output) | Y3 | Y2 | Y1 | Y0 |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 9 | 1 | 0 | 0 | 1 |
| 1 | 0 | 0 | 0 | 1 | 8 | 1 | 0 | 0 | 0 |
| 2 | 0 | 0 | 1 | 0 | 7 | 0 | 1 | 1 | 1 |
| 3 | 0 | 0 | 1 | 1 | 6 | 0 | 1 | 1 | 0 |
| 4 | 0 | 1 | 0 | 0 | 5 | 0 | 1 | 0 | 1 |
| 5 | 0 | 1 | 0 | 1 | 4 | 0 | 1 | 0 | 0 |
| 6 | 0 | 1 | 1 | 0 | 3 | 0 | 0 | 1 | 1 |
| 7 | 0 | 1 | 1 | 1 | 2 | 0 | 0 | 1 | 0 |
| 8 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
| 9 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 10-15 | X | X | X | X | Don't Care | X | X | X | X |
2. K-map Simplification for Output Bits
We will derive simplified Boolean expressions for each output bit (Y3, Y2, Y1, Y0) using 4-variable K-maps. The "don't care" conditions for inputs 1010 to 1111 (decimal 10 to 15) are denoted by 'X'.
K-map for Y0:
| A3A2 \ A1A0 | 00 | 01 | 10 | 11 |
|---|---|---|---|---|
| 00 | 1 | 0 | 1 | 0 |
| 01 | 1 | 0 | 1 | 0 |
| 10 | 1 | 0 | X | X |
| 11 | X | X | X | X |
| Y0 = A0' |
K-map for Y1:
| A3A2 \ A1A0 | 00 | 01 | 10 | 11 |
|---|---|---|---|---|
| 00 | 0 | 0 | 1 | 1 |
| 01 | 0 | 0 | 1 | 1 |
| 10 | 0 | 0 | X | X |
| 11 | X | X | X | X |
| Y1 = A3'A1 |
K-map for Y2:
| A3A2 \ A1A0 | 00 | 01 | 10 | 11 |
|---|---|---|---|---|
| 00 | 0 | 0 | 1 | 1 |
| 01 | 0 | 1 | 0 | 0 |
| 10 | 0 | 0 | X | X |
| 11 | X | X | X | X |
| Y2 = A3'A2'A1 + A3'A2A1'A0 |
K-map for Y3:
| A3A2 \ A1A0 | 00 | 01 | 10 | 11 |
|---|---|---|---|---|
| 00 | 1 | 1 | 0 | 0 |
| 01 | 0 | 0 | 0 | 0 |
| 10 | 0 | 0 | X | X |
| 11 | X | X | X | X |
| Y3 = A3'A2'A1' |
3. Simplified Boolean Expressions
The simplified Boolean expressions for the 9's complement circuit outputs are:
- Y0 = A0'
- Y1 = A3'A1
- Y2 = A3'A2'A1 + A3'A2A1'A0
- Y3 = A3'A2'A1'
4. Logic Circuit Diagram
The circuit can be implemented using NOT, AND, and OR gates based on the derived Boolean expressions.
<<<GRAPHVIZ_START>>>
digraph G {
rankdir=LR;
node [shape=circle, fixedsize=true, width=0.3, label=""];
// Input nodes
A0 [label="A0", shape=box, width=0.5, style=filled, fillcolor=lightblue];
A1 [label="A1", shape=box, width=0.5, style=filled, fillcolor=lightblue];
A2 [label="A2", shape=box, width=0.5, style=filled, fillcolor=lightblue];
A3 [label="A3", shape=box, width=0.5, style=filled, fillcolor=lightblue];
// Inverter gates for complemented inputs
inv0 [shape=inv];
inv1 [shape=inv];
inv2 [shape=inv];
inv3 [shape=inv];
A0 -> inv0;
A1 -> inv1;
A2 -> inv2;
A3 -> inv3;
// Y0 = A0'
inv0 -> Y0_out [label="Y0"];
Y0_out [label="Y0", shape=box, style=filled, fillcolor=lightgrey];
// Y1 = A3' AND A1
and_Y1 [shape=and, min_inputs=2, label=""];
inv3 -> and_Y1;
A1 -> and_Y1;
and_Y1 -> Y1_out [label="Y1"];
Y1_out [label="Y1", shape=box, style=filled, fillcolor=lightgrey];
// Y2 = (A3' AND A2' AND A1) OR (A3' AND A2 AND A1' AND A0)
and_Y2_T1 [shape=and, min_inputs=3, label=""];
inv3 -> and_Y2_T1;
inv2 -> and_Y2_T1;
A1 -> and_Y2_T1;
and_Y2_T2 [shape=and, min_inputs=4, label=""];
inv3 -> and_Y2_T2;
A2 -> and_Y2_T2;
inv1 -> and_Y2_T2;
A0 -> and_Y2_T2;
or_Y2 [shape=or, min_inputs=2, label=""];
and_Y2_T1 -> or_Y2;
and_Y2_T2 -> or_Y2;
or_Y2 -> Y2_out [label="Y2"];
Y2_out [label="Y2", shape=box, style=filled, fillcolor=lightgrey];
// Y3 = A3' AND A2' AND A1'
and_Y3 [shape=and, min_inputs=3, label=""];
inv3 -> and_Y3;
inv2 -> and_Y3;
inv1 -> and_Y3;
and_Y3 -> Y3_out [label="Y3"];
Y3_out [label="Y3", shape=box, style=filled, fillcolor=lightgrey];
}
<<<GRAPHVIZ_END>>>
To implement the given functions using a Programmable Logic Array (PLA), first, each function must be simplified using K-maps to obtain a minimal sum-of-products (SOP) expression. Common product terms across all functions will then be identified for efficient PLA design.
The variables are A, B, C, D, where A is the MSB.
1. Simplification of Functions using K-Maps:
Function w (A, B, C, D) = Σ(2, 12, 13)
K-map for w:
| CD\AB | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 0 | 0 | 1 | 0 (m12) |
| 01 | 0 | 0 | 1 | 0 (m13) |
| 11 | 0 | 0 | 0 | 0 |
| 10 | 1 | 0 | 0 | 0 (m2) |
Minimal SOP for w:
- Group of 2: m(12, 13) = A B C'
- Group of 1: m(2) = A' B' C D'
w = A B C' + A' B' C D'
Function x (A, B, C, D) = Σ(7, 8, 9, 10, 11, 12, 13, 14, 15)
K-map for x:
| CD\AB | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 0 | 0 | 1 | 1 (m12, m8) |
| 01 | 0 | 0 | 1 | 1 (m13, m9) |
| 11 | 0 | 1 | 1 | 1 (m7, m15, m11) |
| 10 | 0 | 0 | 1 | 1 (m14, m10) |
Minimal SOP for x:
- Group of 8: m(8, 9, 10, 11, 12, 13, 14, 15) = A
- Group of 1: m(7) = A' B C D (essential for m7)
x = A + A' B C D
Function y (A, B, C, D) = Σ(0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15)
K-map for y:
| CD\AB | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 1 | 1 | 0 | 1 (m0, m4, m8) |
| 01 | 0 | 1 | 0 | 1 (m5, m9) |
| 11 | 1 | 1 | 1 | 1 (m3, m7, m15, m11) |
| 10 | 1 | 1 | 0 | 1 (m2, m6, m10) |
Minimal SOP for y:
- Group of 4: m(0, 2, 4, 6) = A' D'
- Group of 4: m(8, 9, 10, 11) = A B'
- Group of 4: m(3, 7, 11, 15) = C D (essential for m15, also covers m3, m7, m11)
y = A' D' + A B' + C D
Function z (A, B, C, D) = Σ(1, 2, 8, 12, 13)
K-map for z:
| CD\AB | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 0 | 0 | 1 | 1 (m12, m8) |
| 01 | 1 | 0 | 1 | 0 (m1, m13) |
| 11 | 0 | 0 | 0 | 0 |
| 10 | 1 | 0 | 0 | 0 (m2) |
Minimal SOP for z:
- Group of 2: m(12, 13) = A B C'
- Group of 1: m(1) = A' B' C' D
- Group of 1: m(2) = A' B' C D'
- Group of 1: m(8) = A B' C' D'
z = A B C' + A' B' C' D + A' B' C D' + A B' C' D'
2. Identification of Unique Product Terms for PLA:
Collect all unique product terms from the simplified expressions:
- P1 = A B C' (used by w, z)
- P2 = A' B' C D' (used by w, z)
- P3 = A (used by x)
- P4 = A' B C D (used by x)
- P5 = A B' (used by y)
- P6 = C D (used by y)
- P7 = A' D' (used by y)
- P8 = A B' C' D' (used by z)
- P9 = A' B' C' D (used by z)
There are 9 unique product terms required for the PLA implementation.
Output Equations in terms of Product Terms:
- w = P1 + P2
- x = P3 + P4
- y = P5 + P6 + P7
- z = P1 + P2 + P8 + P9
3. PLA Implementation (Graphviz DOT Code):
The PLA structure consists of inputs (A, B, C, D and their complements), an AND plane to generate the product terms (P1-P9), and an OR plane to combine these product terms to form the outputs (w, x, y, z).
<<<GRAPHVIZ_START>>>
digraph PLA {
rankdir=LR;
splines=true;
node[shape=box, style=filled, fillcolor=lightgray];
// Input Nodes (A, A', B, B', C, C', D, D')
subgraph cluster_inputs {
label="Inputs";
node[shape=box, style=filled, fillcolor=lightgray];
A [label="A"];
A_bar [label="A'"];
B [label="B"];
B_bar [label="B'"];
C [label="C"];
C_bar [label="C'"];
D [label="D"];
D_bar [label="D'"];
}
// Product Term (AND) Plane Nodes
subgraph cluster_and_plane {
label="AND Plane (Product Terms)";
node[shape=rect, style=filled, fillcolor=yellow];
P1[label="ABC'"];
P2[label="A'B'CD'"];
P3[label="A"];
P4[label="A'BCD"];
P5[label="AB'"];
P6[label="CD"];
P7[label="A'D'"];
P8[label="AB'C'D'"];
P9[label="A'B'C'D"];
}
// Output (OR) Plane Nodes
subgraph cluster_or_plane {
label="OR Plane (Outputs)";
node[shape=rect, style=filled, fillcolor=lightblue];
w_out[label="w"];
x_out[label="x"];
y_out[label="y"];
z_out[label="z"];
}
// Ranking to ensure proper left-to-right flow
{ rank=same; A; A_bar; B; B_bar; C; C_bar; D; D_bar; }
{ rank=same; P1; P2; P3; P4; P5; P6; P7; P8; P9; }
{ rank=same; w_out; x_out; y_out; z_out; }
// Connect Inputs to Product Terms (AND Plane)
// P1 = A B C'
A -> P1; B -> P1; C_bar -> P1;
// P2 = A' B' C D'
A_bar -> P2; B_bar -> P2; C -> P2; D_bar -> P2;
// P3 = A
A -> P3;
// P4 = A' B C D
A_bar -> P4; B -> P4; C -> P4; D -> P4;
// P5 = A B'
A -> P5; B_bar -> P5;
// P6 = C D
C -> P6; D -> P6;
// P7 = A' D'
A_bar -> P7; D_bar -> P7;
// P8 = A B' C' D'
A -> P8; B_bar -> P8; C_bar -> P8; D_bar -> P8;
// P9 = A' B' C' D
A_bar -> P9; B_bar -> P9; C_bar -> P9; D -> P9;
// Connect Product Terms to Outputs (OR Plane)
// w = P1 + P2
P1 -> w_out; P2 -> w_out;
// x = P3 + P4
P3 -> x_out; P4 -> x_out;
// y = P5 + P6 + P7
P5 -> y_out; P6 -> y_out; P7 -> y_out;
// z = P1 + P2 + P8 + P9
P1 -> z_out; P2 -> z_out; P8 -> z_out; P9 -> z_out;
}
<<<GRAPHVIZ_END>>>
To design the sequential circuit using T flip-flops, the following steps are undertaken:
- Derivation of State Table:
The given state diagram is converted into a state table, including present state, input, and next state. The states are represented by two flip-flop outputs, Q1 and Q0.
| Present State (Q1Q0) | Input (X) | Next State (Q1'Q0') |
|---|---|---|
| 00 | 0 | 01 |
| 00 | 1 | 00 |
| 01 | 0 | 11 |
| 01 | 1 | 10 |
| 10 | 0 | 11 |
| 10 | 1 | 10 |
| 11 | 0 | 00 |
| 11 | 1 | 11 |
- T Flip-Flop Excitation Table:
The excitation table for a T flip-flop defines the required T input for a given state transition from Q(t) to Q(t+1).
| Q(t) | Q(t+1) | T |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
- Complete State Table with T Flip-Flop Inputs:
Using the state table and the T flip-flop excitation table, the required T inputs (T1 for Q1 and T0 for Q0) are determined for each state transition.
| Present State (Q1Q0) | Input (X) | Next State (Q1'Q0') | T1 | T0 |
|---|---|---|---|---|
| 00 | 0 | 01 | 0 | 1 |
| 00 | 1 | 00 | 0 | 0 |
| 01 | 0 | 11 | 1 | 0 |
| 01 | 1 | 10 | 1 | 1 |
| 10 | 0 | 11 | 0 | 1 |
| 10 | 1 | 10 | 0 | 0 |
| 11 | 0 | 00 | 1 | 1 |
| 11 | 1 | 11 | 0 | 0 |
-
Karnaugh Map Simplification for Flip-Flop Input Equations:
K-maps are used to derive simplified Boolean expressions for T1 and T0 in terms of present states (Q1, Q0) and input (X).K-Map for T1:
Q1Q0 \ X 0 1 00 0 0 01 1 1 11 1 0 10 0 0 Grouping the 1s:
- One group of two: minterms (Q1'Q0X' and Q1'Q0X) simplifies to Q1'Q0.
- One group of one: minterm (Q1Q0X') simplifies to Q1Q0X'.
$T_1 = Q_1'Q_0 + Q_1Q_0X'$
K-Map for T0:
Q1Q0 \ X 0 1 00 1 0 01 0 1 11 1 0 10 1 0 Grouping the 1s:
- One group of two: minterms (Q1'Q0'X' and Q1Q0'X') simplifies to Q0'X'.
- One group of one: minterm (Q1Q0X') simplifies to Q1Q0X'.
- One group of one: minterm (Q1'Q0X) simplifies to Q1'Q0X.
$T_0 = Q_0'X' + Q_1Q_0X' + Q_1'Q_0X$
-
Sequential Circuit Diagram:
The simplified Boolean expressions for T1 and T0 are used to construct the logic circuit. Two T flip-flops are used, one for Q1 and one for Q0, and their inputs are connected to the combinational logic derived.
<<<GRAPHVIZ_START>>>
digraph G {
rankdir=LR;
compound=true;
// Global Clock
node [shape=circle, style=filled, fillcolor=lightgrey, fixedsize=true, width=0.4];
CLK [label="CLK"];
// Primary Input
node [shape=circle, style=filled, fillcolor=lightgrey, fixedsize=true, width=0.4];
X_in [label="X"];
// Flip-flops
node [shape=record, style=filled, fillcolor=lightblue, width=1.5];
FF1 [label="{ Q1 | <Q_prime> Q1'} }", fontsize=10];
FF0 [label="{ Q0 | <Q_prime> Q0'} }", fontsize=10];
// Inverters
node [shape=inv, style=filled, fillcolor=lightgoldenrod, width=0.5, height=0.5];
INV_X [label=""];
INV_Q1 [label=""];
INV_Q0 [label=""];
// AND gates
node [shape=and, style=filled, fillcolor=lightgreen, width=0.5, height=0.5];
AND_Q1_prime_Q0 [label=""]; // For Q1'Q0
AND_Q1_Q0_X_prime [label=""]; // For Q1Q0X'
AND_Q0_prime_X_prime [label=""]; // For Q0'X'
AND_Q1_prime_Q0_X [label=""]; // For Q1'Q0X
// OR gates
node [shape=or, style=filled, fillcolor=coral, width=0.5, height=0.5];
OR_T1 [label=""];
OR_T0 [label=""];
// Connections for CLK
CLK -> FF1:CLK;
CLK -> FF0:CLK;
// Inverter connections
X_in -> INV_X;
FF1:Q -> INV_Q1;
FF0:Q -> INV_Q0;
// T1 Logic: T1 = Q1'Q0 + Q1Q0X'
INV_Q1 -> AND_Q1_prime_Q0:in1;
FF0:Q -> AND_Q1_prime_Q0:in2;
AND_Q1_prime_Q0 -> OR_T1:in1;
FF1:Q -> AND_Q1_Q0_X_prime:in1;
FF0:Q -> AND_Q1_Q0_X_prime:in2;
INV_X -> AND_Q1_Q0_X_prime:in3;
AND_Q1_Q0_X_prime -> OR_T1:in2;
OR_T1 -> FF1:T;
// T0 Logic: T0 = Q0'X' + Q1Q0X' + Q1'Q0X
INV_Q0 -> AND_Q0_prime_X_prime:in1;
INV_X -> AND_Q0_prime_X_prime:in2;
AND_Q0_prime_X_prime -> OR_T0:in1;
// Reuse AND_Q1_Q0_X_prime for the Q1Q0X' term
AND_Q1_Q0_X_prime -> OR_T0:in2;
INV_Q1 -> AND_Q1_prime_Q0_X:in1;
FF0:Q -> AND_Q1_prime_Q0_X:in2;
X_in -> AND_Q1_prime_Q0_X:in3;
AND_Q1_prime_Q0_X -> OR_T0:in3;
OR_T0 -> FF0:T;
// Output nodes (optional, for clarity)
node [shape=circle, style=filled, fillcolor=palegreen];
Q1_out [label="Q1"];
Q0_out [label="Q0"];
FF1:Q -> Q1_out;
FF0:Q -> Q0_out;
}
<<<GRAPHVIZ_END>>>
Section B
Answer any two questions.
Characteristics of Digital Computer
- Speed: Digital computers can perform complex calculations and operations at extremely high speeds, processing millions or billions of instructions per second.
- Accuracy: They are designed to deliver precise results without errors, provided the input data and programs are correct.
Representation of -6 (8 bits)
-
Signed Magnitude:
- Positive 6 in 8-bit binary: 0000 0110
- For -6, the most significant bit (MSB) is set to 1 (for negative), and the remaining bits represent the magnitude.
- Representation: 1000 0110
-
Signed 1’s Complement:
- Positive 6 in 8-bit binary: 0000 0110
- To get the 1’s complement of -6, invert all bits of the positive 6 representation.
- Representation: 1111 1001
-
Signed 2’s Complement:
- Positive 6 in 8-bit binary: 0000 0110
- To get the 2’s complement of -6, take the 1’s complement and add 1.
- 1’s Complement of 6: 1111 1001
- Add 1: 1111 1001 + 1 = 1111 1010
- Representation: 1111 1010
Representation of Decimal Number 4673
a) Octal:
* Divide the decimal number by 8 and record the remainders.
* 4673 ÷ 8 = 584 remainder 1
* 584 ÷ 8 = 73 remainder 0
* 73 ÷ 8 = 9 remainder 1
* 9 ÷ 8 = 1 remainder 1
* 1 ÷ 8 = 0 remainder 1
* Reading the remainders from bottom to top gives the octal representation.
* Representation: 11101 (octal)
b) BCD (Binary-Coded Decimal):
* Each decimal digit is represented by its 4-bit binary equivalent.
* Decimal: 4 6 7 3
* BCD: 0100 0110 0111 0011
* Representation: 0100 0110 0111 0011
CMOS is suitable for use in applications requiring:
- Low Power Consumption: Ideal for battery-powered devices, portable electronics, and systems where heat dissipation is a concern.
- High Noise Immunity: Due to its large noise margins, CMOS is robust in electrically noisy environments.
- High Integration Density: Allows for complex circuits and large numbers of gates on a single chip, suitable for microprocessors, memory (SRAM), and ASICs.
- Wide Operating Voltage Range: Can operate reliably over a significant range of supply voltages.
Power dissipation refers to the rate at which energy is consumed by an electronic device or circuit and converted into heat. In digital circuits, it typically comprises static power dissipation (due to leakage currents) and dynamic power dissipation (due to switching activities and charging/discharging of capacitances).
Positive Logic NAND Gate as a Negative Logic NOR Gate (and vice versa):
This concept arises from the duality between positive and negative logic conventions.
- Positive Logic: A higher voltage level represents Logic '1', and a lower voltage level represents Logic '0'.
- Negative Logic: A lower voltage level represents Logic '1', and a higher voltage level represents Logic '0'.
Let $A_P, B_P, Y_P$ be variables in positive logic and $A_N, B_N, Y_N$ be variables in negative logic.
The conversion between the two conventions is: $A_N = \overline{A_P}$, $B_N = \overline{B_P}$, and $Y_N = \overline{Y_P}$.
-
Showing a positive logic NAND gate is a negative logic NOR gate:
A positive logic NAND gate performs the function:
$Y_P = \overline{A_P \cdot B_P}$To find its equivalent function in negative logic, substitute $A_P = \overline{A_N}$, $B_P = \overline{B_N}$, and $Y_P = \overline{Y_N}$:
$\overline{Y_N} = \overline{(\overline{A_N} \cdot \overline{B_N})}$
Applying double negation:
$Y_N = \overline{A_N} \cdot \overline{B_N}$
By De Morgan's theorem ($\overline{X} \cdot \overline{Y} = \overline{X+Y}$):
$Y_N = \overline{A_N + B_N}$
This is the Boolean expression for a NOR gate in negative logic.
Therefore, a circuit functioning as a NAND gate under positive logic behaves as a NOR gate under negative logic. -
Showing a positive logic NOR gate is a negative logic NAND gate:
A positive logic NOR gate performs the function:
$Y_P = \overline{A_P + B_P}$To find its equivalent function in negative logic, substitute $A_P = \overline{A_N}$, $B_P = \overline{B_N}$, and $Y_P = \overline{Y_N}$:
$\overline{Y_N} = \overline{(\overline{A_N} + \overline{B_N})}$
Applying double negation:
$Y_N = \overline{A_N} + \overline{B_N}$
By De Morgan's theorem ($\overline{X} + \overline{Y} = \overline{X \cdot Y}$):
$Y_N = \overline{A_N \cdot B_N}$
This is the Boolean expression for a NAND gate in negative logic.
Therefore, a circuit functioning as a NOR gate under positive logic behaves as a NAND gate under negative logic.
1. Function Simplification
The given Boolean function is F(w, x, y, z) = wx’ + y’z’ + w’yz’.
Applying Boolean algebra:
F = wx’ + y’z’ + w’yz’
F = wx’ + z’(y’ + w’y) (Factoring out z’)
Using the absorption law (A + A'B = A + B), where A = y' and B = w':
y’ + w’y = y’ + w’
So,
F = wx’ + z’(y’ + w’)
F = wx’ + y’z’ + w’z’
The simplified Sum-of-Products (SOP) form is F = wx’ + y’z’ + w’z’.
2. Two-Level NOR Gate Implementation
To implement a function with a two-level NOR gate circuit, it is typically easiest to use its Product-of-Sums (POS) form. A two-level NOR-NOR implementation directly realizes an expression in POS form, F = (S1)(S2)(S3)..., as F = ((S1)' + (S2)' + (S3)' + ...)', where S1, S2, S3 are sum terms. The first level NOR gates produce the complements of the sum terms, and the second level NOR gate combines these outputs.
First, we find the minterms for F:
wx' = Σm(8, 9, 10, 11)
y'z' = Σm(0, 4, 8, 12)
w'z' = Σm(0, 2, 4, 6)
F = Σm(0, 2, 4, 6, 8, 9, 10, 11, 12)
Next, we find the minterms for F' (the complement of F):
F' = Σm(1, 3, 5, 7, 13, 14, 15)
Now, we simplify F' using a Karnaugh map or algebraic grouping:
F' = w'x'y'z + w'x'yz + w'xy'z + w'xyz + wxy'z + wxyz' + wxyz
Grouping terms:
F' = (w'x'y'z + w'x'yz + w'xy'z + w'xyz) + (wxy'z + wxyz) + wxyz'
F' = w'z(x'y' + x'y + xy' + xy) + wxz(y'+y) + wxyz'
F' = w'z(1) + wxz(1) + wxyz'
F' = w'z + wxz + wxyz'
This can be further simplified to: F' = w'z + wx(z + yz') = w'z + wx(z+y)
So, the simplified SOP for F' is F' = w'z + wxy + wxz.
Finally, we find F by complementing F':
F = (F')' = (w'z + wxy + wxz)'
Using De Morgan's Law, F = (w'z)' * (wxy)' * (wxz)'
F = (w + z') * (w' + x' + y') * (w' + x' + z')
This is the POS form suitable for NOR-NOR implementation.
Let the sum terms be:
S1 = (w + z')
S2 = (w' + x' + y')
S3 = (w' + x' + z')
The two-level NOR gate circuit will consist of:
- First level: Three NOR gates, each producing the complement of a sum term (S1)', (S2)', (S3)'.
- Second level: One NOR gate, which takes the outputs of the first level NOR gates as its inputs.
Assuming complemented inputs (w', x', y', z') are available:
<<<GRAPHVIZ_START>>>
digraph G {
rankdir=LR;
splines=ortho;
node [shape=box, style=filled, fillcolor=lightgray];
// Input nodes
subgraph cluster_inputs {
label = "Inputs";
w [label="w"];
x [label="x"];
y [label="y"];
z [label="z"];
w_prime [label="w'"];
x_prime [label="x'"];
y_prime [label="y'"];
z_prime [label="z'"];
}
// Level 1 NOR gates
node [shape=nor, label="", width=0.5, height=0.5];
nor1 [label="", peripheries=1];
nor2 [label="", peripheries=1];
nor3 [label="", peripheries=1];
// Level 2 NOR gate
node [shape=nor, label="", width=0.5, height=0.5];
nor_final [label="", peripheries=1];
// Output node
node [shape=box, style=filled, fillcolor=lightgray];
F_out [label="F"];
// Connections for NOR1: (w + z')'
w -> nor1;
z_prime -> nor1;
// Connections for NOR2: (w' + x' + y')'
w_prime -> nor2;
x_prime -> nor2;
y_prime -> nor2;
// Connections for NOR3: (w' + x' + z')'
w_prime -> nor3;
x_prime -> nor3;
z_prime -> nor3;
// Connections for final NOR gate
nor1 -> nor_final;
nor2 -> nor_final;
nor3 -> nor_final;
// Output
nor_final -> F_out;
// Arrange elements
{rank=same; w; x; y; z; w_prime; x_prime; y_prime; z_prime;}
{rank=same; nor1; nor2; nor3;}
{rank=same; nor_final;}
{rank=same; F_out;}
}
<<<GRAPHVIZ_END>>>
A full subtractor circuit performs binary subtraction of three input bits: a minuend x, a subtrahend y, and an input borrow B_in. It produces two output bits: a difference Diff and an output borrow B_out. The operation performed is (x - y - B_{in}).
Truth Table
| x | y | (B_{in}) | Diff | (B_{out}) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
Boolean Expressions (Simplified)
From the truth table, the Boolean expressions for Diff and (B_{out}) can be derived using K-maps or by inspection:
-
Diff:
Diff = x'y'B_in + x'yB_in' + xy'B_in' + xyB_in
Diff = x XOR y XOR B_in -
B_out:
B_out = x'y'B_in + x'yB_in' + x'yB_in + xyB_in
B_out = x'y + x'B_in + yB_in
Alternatively, the circuit can be implemented by cascading two half-subtractors. In this approach:
- A first half-subtractor takes
xandyas inputs, producingD1 = x XOR yandB1 = x'y. - A second half-subtractor takes
D1andB_inas inputs, producingDiff = D1 XOR B_inandB2 = D1' B_in. - The final output borrow
B_outis the OR combination ofB1andB2:B_out = B1 OR B2.
Substituting the expressions,B_out = x'y + (x XOR y)' B_in.
Circuit Diagram (Logic Gates)
<<<GRAPHVIZ_START>>>
digraph FullSubtractor {
rankdir=LR;
// Input nodes
node [shape=circle, label="", fixedsize=true, width=0.4];
x_in [label="X"];
y_in [label="Y"];
bin_in [label="B_in"];
// Output nodes
node [shape=box, label="", style=filled, fillcolor=lightgray];
diff_out [label="Diff"];
bout_out [label="B_out"];
// Gate nodes (using box shape with labels for clarity)
node [shape=box, style=filled, fillcolor=lightblue, width=0.7];
// For Diff = X ^ Y ^ B_in
xor1 [label="XOR"];
xor2 [label="XOR"];
// For B_out = X'Y + (X^Y)'B_in
not_x [label="NOT"];
and1 [label="AND"];
not_xory [label="NOT"]; // for (X^Y)'
and2 [label="AND"];
or1 [label="OR"];
// Connections for Diff
x_in -> xor1;
y_in -> xor1;
xor1 -> xor2;
bin_in -> xor2;
xor2 -> diff_out;
// Connections for B_out
x_in -> not_x;
not_x -> and1;
y_in -> and1; // First term: X'Y
xor1 -> not_xory; // Reuse output of xor1 (X^Y)
not_xory -> and2;
bin_in -> and2; // Second term: (X^Y)'B_in
and1 -> or1;
and2 -> or1;
or1 -> bout_out;
}
<<<GRAPHVIZ_END>>>
A 4-bit even parity generator produces a parity bit (P) such that the total number of '1's in the 4 data bits (D3, D2, D1, D0) plus the parity bit is always even.
Boolean Expression:
The parity bit P is generated by performing an XOR operation on all the data bits:
P = D3 ⊕ D2 ⊕ D1 ⊕ D0
Logic Diagram:
The logic diagram implements the Boolean expression using a series of XOR gates.
<<<GRAPHVIZ_START>>>
digraph G {
rankdir=LR;
node [shape=none, fontsize=10];
D3 [label="D3"];
D2 [label="D2"];
D1 [label="D1"];
D0 [label="D0"];
P [label="P"];
node [shape=xor, label="", width=0.6, height=0.6]; // XOR gate shape
xor1;
xor2;
xor3;
D3 -> xor1:w;
D2 -> xor1:w;
D1 -> xor2:w;
D0 -> xor2:w;
xor1:e -> xor3:w;
xor2:e -> xor3:w;
xor3:e -> P:w;
}
<<<GRAPHVIZ_END>>>
-
Difference between Serial and Parallel Transfer
- Serial Transfer: Data bits are transmitted one after another over a single communication channel.
- Advantages: Requires fewer transmission lines, suitable for long-distance communication, lower cost.
- Disadvantages: Slower speed due to sequential bit transmission.
- Parallel Transfer: Multiple data bits are transmitted simultaneously over multiple dedicated communication channels (one for each bit).
- Advantages: Higher speed due to concurrent bit transmission.
- Disadvantages: Requires more transmission lines, typically used for short-distance communication, higher cost and complexity.
- Serial Transfer: Data bits are transmitted one after another over a single communication channel.
-
Data Conversion
- Serial to Parallel Conversion: Serial data bits are received one by one over a single input line. These bits are shifted into a register sequentially. Once the required number of bits (e.g., a byte) has been accumulated in the register, they can be read out simultaneously on multiple output lines.
- Parallel to Serial Conversion: Parallel data bits are loaded simultaneously into a register using multiple input lines. These bits are then shifted out of the register one bit at a time, sequentially, onto a single output line.
-
Type of Register Needed
A shift register is required for both serial-to-parallel and parallel-to-serial data conversion. Specifically:- A Serial-In, Parallel-Out (SIPO) shift register is used for serial-to-parallel conversion.
- A Parallel-In, Serial-Out (PISO) shift register is used for parallel-to-serial conversion.
A negative-edge triggered D flip-flop is a synchronous sequential logic device designed to capture the data present at its 'D' (Data) input and transfer it to its 'Q' (Output) only during the high-to-low transition (falling edge) of the clock signal. At all other times, regardless of changes at the 'D' input, the 'Q' output retains its previous state, providing state stability.
Logic Diagram:
<<<GRAPHVIZ_START>>>
digraph D_FlipFlop {
rankdir=LR;
node [shape=box style=filled fillcolor=lightgray];
D [label="D"];
CLK [label="CLK"];
Q [label="Q" shape=none];
Q_bar [label="Q\u0304" shape=none];
subgraph cluster_flipflop {
label="D Flip-Flop";
style=filled;
color=lightyellow;
node [shape=none];
FF_body [label="" width=0.8 height=0.6]; // Placeholder for visual bounding box
}
// Connect D to FF_body (conceptually)
D -> FF_body [arrowhead=none style=invis];
// Connect CLK to FF_body, showing negative edge trigger
CLK -> FF_body [arrowhead=odiamond label=" " pos="0,0.5!" headport=w tailport=e]; // Arrowhead with circle and triangle implies negative edge
FF_body -> Q [arrowhead=none style=invis];
FF_body -> Q_bar [arrowhead=none style=invis];
// Explicitly place text labels for inputs/outputs relative to a conceptual central point for a better visual representation
D_label [label="D" pos="0.5,0.7!"];
CLK_label [label="CLK" pos="0.5,0.3!"];
Q_label [label="Q" pos="2.5,0.7!"];
Qbar_label [label="Q\u0304" pos="2.5,0.3!"];
// Connect invisible labels to outputs for proper graphviz rendering
FF_body_in_D [label="" shape=none width=0 height=0];
FF_body_in_CLK [label="" shape=none width=0 height=0];
FF_body_out_Q [label="" shape=none width=0 height=0];
FF_body_out_Qbar [label="" shape=none width=0 height=0];
// Use a rectangle node to represent the D flip-flop symbol
D_FF_symbol [shape=rect, label="D", width=1.5, height=1, margin="0.1,0.1"];
// Connections to the D_FF_symbol
D -> D_FF_symbol:w [label="" style=invis headport=w];
CLK -> D_FF_symbol:w [label="" style=invis headport=w];
D_FF_symbol:e -> Q [label="" style=invis tailport=e];
D_FF_symbol:e -> Q_bar [label="" style=invis tailport=e];
// Explicitly draw lines to the symbol for better visualization
D_input_line [label="" shape=none];
CLK_input_line [label="" shape=none];
Q_output_line [label="" shape=none];
Qbar_output_line [label="" shape=none];
D -> D_input_line [arrowhead=none];
D_input_line -> D_FF_symbol:w [headport=w];
CLK -> CLK_input_line [arrowhead=none];
CLK_input_line -> D_FF_symbol:w [headport=w];
D_FF_symbol:e -> Q_output_line [tailport=e];
Q_output_line -> Q [arrowhead=none];
D_FF_symbol:e -> Qbar_output_line [tailport=e];
Qbar_output_line -> Q_bar [arrowhead=none];
// Add bubble and triangle for negative edge trigger
CLK_trigger [label="" shape=circle fixedsize=true width=0.1 height=0.1];
CLK_input_line -> CLK_trigger [arrowhead=none dir=back];
CLK_trigger -> D_FF_symbol:w [arrowhead=none];
// Position CLK_trigger correctly near the clock input of the flip-flop symbol
{rank=same; D; D_FF_symbol; Q;}
{rank=same; CLK; CLK_trigger;} // Ensure CLK_trigger is aligned with CLK
CLK_trigger -> D_FF_symbol:w [headport=w label="\u25BC" pos="0.5,0.5!"]; // Invisible arrow with triangle label
}
<<<GRAPHVIZ_END>>>
Truth Table:
| CLK | D | Q(t+1) | Q(t+1)-bar | Description |
|---|---|---|---|---|
| High (1) | X | Q(t) | Q(t)-bar | No change, output holds previous state |
| Low (0) | X | Q(t) | Q(t)-bar | No change, output holds previous state |
| Rising Edge (↑) | X | Q(t) | Q(t)-bar | No change, output holds previous state |
| Falling Edge (↓) | 0 | 0 | 1 | Output becomes 0 (resets) |
| Falling Edge (↓) | 1 | 1 | 0 | Output becomes 1 (sets) |
(X indicates a "don't care" condition)
(Q(t) represents the output state before the current clock edge, Q(t+1) is the output state after the current clock edge)
Binary Ripple Counter
- An asynchronous counter where the clock input for each successive flip-flop is derived from the output of the preceding flip-flop.
- Counts in a straightforward natural binary sequence (e.g., a 3-bit ripple counter counts from 000 to 111).
- The term "ripple" describes the way the output change propagates or "ripples" through the stages due to inherent propagation delays of the flip-flops.
- Often implemented using J-K or T flip-flops configured to toggle (J=K=1 or T=1).
- Used for basic event counting and frequency division.
BCD Ripple Counter (Decade Counter)
- A specialized asynchronous counter designed to count from 0 (0000) to 9 (1001) and then reset back to 0.
- It is essentially a 4-bit ripple counter with additional feedback logic to skip the binary states 1010 through 1111.
- Typically, a NAND gate detects the count of 10 (binary 1010, corresponding to Q3=1 and Q1=1) and its output is used to clear all flip-flops, forcing the counter to reset.
- This counter produces a BCD (Binary-Coded Decimal) output, making it highly useful in digital systems requiring decimal counting and display.
- Applications include digital clocks, frequency meters, and driving 7-segment displays.
RTL (Register Transfer Level)
- RTL is an abstraction level used in digital circuit design to describe the flow of data between hardware registers and the logical operations performed on that data.
- It focuses on how data is transferred between registers and what operations (e.g., arithmetic, logical, shift) are executed on the data held within them.
- RTL descriptions are typically written using Hardware Description Languages (HDLs) such as Verilog or VHDL.
- This level of abstraction facilitates the design and verification of complex digital systems by allowing designers to focus on functionality rather than low-level gate implementations.
- Key elements at the RTL include registers, multiplexers, adders, ALUs, and the control logic that orchestrates data movement and operations.
State Reduction
- State reduction is a process in the design of sequential circuits, particularly finite state machines (FSMs), aimed at minimizing the number of states required to implement a given state table or state diagram.
- The primary goal is to reduce the overall complexity of the circuit, which leads to a decrease in the number of flip-flops required and simplification of the associated combinational logic.
- Two states are considered equivalent if, for every possible input sequence, they produce the same output sequence and transition to equivalent next states.
- Techniques for state reduction include the implication table method or partitioning methods, which systematically identify and merge equivalent or redundant states.
- Successful state reduction results in a more efficient, cost-effective, and potentially faster hardware implementation without altering the specified sequential behavior of the system.