π Lecture 15 β BCD ADDER
π Overview: This lecture covers BCD addition, where a 6 is added to invalid sums to produce correct BCD digits. It extends the concept to 2-digit BCD adders and then introduces subtraction using 2βs complement, showing how an adder can perform both addition and subtraction. Finally, it discusses the Arithmetic and Logic Unit (ALU) and its implementation, including group-carry look-ahead for efficient cascading.
ποΈ Topics Covered
The lecture begins with the BCD Adder, explaining the need for two 4-bit parallel adders and an invalid BCD detector circuit. It then details the design and function table of the invalid BCD detector, followed by its connection to a second adder. The construction of a 2-digit BCD adder by cascading single-digit adders is shown with examples. The topic then shifts to subtraction in digital systems using 2βs complement, leading to the design of a 4-bit adder/subtracter unit and its extension to an 8-bit unit. Finally, the lecture introduces the Arithmetic and Logic Unit (ALU), its variants, and the concept of group-carry look-ahead for cascading multiple ALUs.
π Lecture Summary
BCD ADDER
BCD binary numbers represent Decimal digits 0 to 9. A 4-bit BCD code is used to represent the ten numbers 0 to 9. Since the 4-bit Code allows 16 possibilities, the first 10 4-bit combinations are considered to be valid BCD combinations. The latter six combinations are invalid and do not occur. BCD Code has applications in Decimal number Display Systems such as Counters and Digital Clocks. BCD Addition is similar to normal Binary Addition except for the case when sum of two BCD digits exceeds 9 or a Carry is generated. When the Sum of two BCD numbers exceeds 9 or a Carry is generated, a 6 is added to convert the invalid number into a valid number. The carry generated by adding a 6 to the invalid BCD digit is passed on to the next BCD digit. Addition of two BCD digits requires two 4-bit Parallel Adder Circuits. A BCD Adder uses a circuit which checks the result at the output of the first adder circuit to determine if the result has exceeded 9 or a Carry has been generated. If the circuit determines any of the two error conditions, the circuit adds a 6 to the original result using the second Adder circuit. The output of the second Adder gives the correct BCD output. If the circuit finds the result of the first Adder circuit to be a valid BCD number (between 0 and 9 and no Carry has been generated), the circuit adds a zero to the valid BCD result using the second Adder.
π Definition β BCD Adder: A digital circuit that adds two BCD digits, detecting and correcting invalid sums (greater than 9 or with a carry) by adding 6.
The Invalid BCD Detector Circuit
The circuit that checks if the output of the first Adder has exceeded 9 is a simple combinational circuit with a function table. The Boolean expression for the Invalid BCD Number Detector obtained from the Karnaugh Map which maps the function table is SβSβ + SβSβ = Sβ(Sβ + Sβ). The Invalid BCD Number is represented by two error conditions: either the BCD number is one of the invalid numbers or a Carry out has been generated. Therefore the complete expression for determining an incorrect BCD output is C_out1 + Sβ(Sβ + Sβ).
π Formula: Invalid BCD Detection: F = C_out1 + Sβ(Sβ + Sβ) β A logical 1 indicates an invalid BCD sum requiring correction.
π Example: If the first adder's output is SβSβSβSβ = 1010 (decimal 10), C_out1 = 0. The detection circuit computes 0 + 1(0+1) = 1, indicating an invalid sum.
Connection of Invalid BCD Detector Circuit to second Adder
Adding of 6 when error conditions are detected and adding a zero when error conditions are not detected is implemented by connecting the output of the Invalid BCD Number Detector circuit to bits Bβ and Bβ of the Adder. Bits Bβ and Bβ are permanently connected to 0. When an error condition is detected, the output of the circuit is set to logic 1, setting bits Bβ and Bβ to 1 and the 2nd Adder input B to 0110 (binary for 6). When the error condition is not detected, the circuit output is 0 and the 2nd Adder input B is set to 0000.
2-digit BCD Adder
Two single digit BCD Adders can be cascaded together to form a 2-digit BCD Adder. Four, 4-bit 74LS283 MSI chips are used. Two 74LS283s are required to directly add the two 2-digit BCD numbers and the remaining two 74LS283s are required to add a six to the result if any of the two digits add up to invalid BCD digits or generate a Carry. Two invalid BCD detector circuits are used.
π Example: Adding BCD numbers 99 and 99. The LSD addition (9+9+0) gives sum 0010 with Cout=1. The detector circuit sees Cout=1 (error condition), so the second LSD adder adds 0010 + 0110 = 1000 with a carry out of 0. The MSD addition (9+9+1) gives sum 0011 with Cout=1. The detector circuit sees Cout=1, so the second MSD adder adds 0011 + 0110 = 1001 with a carry out of 1. The final result is 1 1001 1000 (BCD 198).
π Example: Adding BCD numbers 99 and 66. The LSD addition (9+6+0) gives sum 1111 (15) with no carry. The detector circuit finds 1(1+1) = 1 (invalid), so the second LSD adder adds 1111 + 0110 = 0101 with a carry out of 1. The MSD addition (9+6+1) gives sum 0000 with Cout=1. The detector circuit sees Cout=1, so the second MSD adder adds 0000 + 0110 = 0110 with a carry out of 1. The final result is 1 0110 0101 (BCD 165).
Subtraction
Subtraction in Digital Systems is performed by taking the 2βs complement of the number to be subtracted (subtrahend) and adding it to the minuend. The 2βs complement of any number is obtained by taking the 1βs complement of a number and then adding a 1 to the 1βs complement.
π Formula: 2βs Complement: 2βs complement of X = 1βs complement of X + 1
π Example: To subtract 5 from 9, first find the 2βs complement of 5: (0101) β 1βs complement is 1010 β add 1 gives 1011. Then add: 1001 (9) + 1011 = 1 0100. Neglecting the carry bit, the 4-bit number 0100 represents decimal 4.
An Adder can be used to perform subtraction operations if the minuend is presented in its 1βs complemented form at the input of the adder circuit. The binary 1 that is added to the 1βs complement to convert it into 2βs complement is applied at the Carry In of the Adder Circuit.
A 4-bit Adder/Subtracter Unit
An Adder can be connected to perform Additions and Subtractions by applying the un-complemented and complemented data at one of the two inputs of the Adder respectively. The Carry In input has also to be connected to 0 or 1 respectively. The AND gate and OR gate implementation connected at the B input of the 4-bit Adder is used to allow Complemented or Un-Complemented B input to be connected to the Adder input. Adding of two 4-bit numbers A and B can be performed by selecting the Add/Subtract = 0. The AND gates marked U (un-complemented) are enabled allowing Bβββ to be passed on to the OR gates and the B input of the Adder. Subtraction is performed by selecting the Add/Subtract = 1. The AND gates marked C (complemented) are enabled allowing complemented Bβββ to be passed on to the OR gates and the B input of the Adder. The Carry In is also set to 1 when Add/Subtract is set to 1.
An 8-bit Adder/Subtracter Unit
Two 4-bit 74LS283 chips can be cascaded together to form an 8-bit Parallel Adder Unit. Each of the two 74LS283 ICs is connected to the 1βs Complement circuitry that allows either the un-complemented form for addition or the complemented form for subtraction to be applied at the B inputs. The Add/Subtract function select input are tied together. The Carry In of the 1st 4-bit Adder circuit is connected to the Add/Subtract function select input. The Carry Out of the 1st 4-bit Adder circuit is connected to the Carry In of the 2nd 4-bit Adder circuit.
π Example: Adding 103 (binary 0110 0111) and 67 (binary 0100 0011) with Add/Subtract=0. The LSD adder sums 0111 + 0011 = 1010 with Cout=0. The MSD adder sums 0110 + 0100 = 1010 with Cout=0 and Cin=0. The final sum is 1010 1010 (decimal 170).
π Example: Subtracting 67 from 103 with Add/Subtract=1. The B inputs are complemented. The LSD adder (1βs complement of 0011 is 1100) sums 0111 + 1100 + 1 = 1 0100 with Cout=1. The MSD adder (1βs complement of 0100 is 1011) sums 0110 + 1011 + 1 = 1 0010 with Cout=1. The final result is 0010 0100 (decimal 36).
Arithmetic and Logic Unit (ALU)
Microprocessors have Arithmetic and Logic Units, a combinational circuit that can perform any of the arithmetic operations and logic operations on two input values. The operation to be performed is selected by set of inputs known as function select inputs. Three commercially available 4-bit ALUs are:
- 74XX181: Has five function select inputs allowing 32 different Arithmetic and Logic operations.
- 74XX381: Has three function select inputs allowing only 8 different arithmetic and logic functions.
- 74XX382: Similar to the 74XX381, but provides ripple carry and overflow outputs instead of group-carry look-ahead outputs.
π Definition β ALU: A combinational circuit that performs multiple arithmetic and logic operations on two input values based on function select inputs.
Implementing 16-bit ALU
A 16-bit ALU can be implemented by cascading together four 4-bit ALUs. These 4-bit ALUs have built in Look-Ahead Carry Generator circuits that eliminate the delay caused by carry bit propagating through the Parallel Adder circuit within the 4-bit ALU circuit. However, when a number of such units are cascaded together to implement large 16-bit and 32-bit ALU, the carry propagating between one unit to the next gets delayed due to the Carry rippling through multiple 4-bit units.
Group-Carry Look-Ahead
The Look-Ahead Carry Generator provides Carries Cβ, Cβ, Cβ, and Cβ simultaneously after a gate delay of two. These terms are generated on the basis of Pβ, Pβ, Pβ, and Pβ (the four Carry Propagate terms) and Gβ, Gβ, Gβ, and Gβ (the four Carry Generate terms). These terms are used to generate Group-Carry Look-Ahead outputs that can be used to cascade together multiple units eliminating the problem of rippling carry. The G and P output pins of the 74XX381 provide the group-carry look-ahead outputs.
π Formula: Group-Carry Look-Ahead Outputs: G = Gβ + PβGβ + PβPβGβ + PβPβPβGβ and P = PβPβPβPβ
π‘ Why this matters: This allows multiple ALU chips to be cascaded for wider bit operations without the propagation delay of a ripple carry.
β Key Takeaways
For BCD addition, the sum of two digits is invalid if it exceeds 9 or generates a carry, requiring a correction by adding 6 (binary 0110), which is implemented by an invalid BCD detector and a second adder. Subtraction in digital logic is achieved by taking the 2's complement of the subtrahend and adding it to the minuend, making an adder capable of both operations with a selectable complementing circuit. An Adder/Subtracter unit uses the Add/Subtract control line to select between un-complemented (addition) and complemented (subtraction) B inputs, while also setting the carry-in accordingly. An ALU is a universal combinational circuit that can perform multiple arithmetic and logic operations, with different MSI chips like the 74XX381 offering various function sets. Group-carry look-ahead is essential for cascading multiple ALUs to build wider units without performance degradation from ripple carry delays.
π§ Quick Revision Questions
- What are the two conditions that make a sum of two BCD digits invalid, and what correction is applied?
- Derive the Boolean expression for the invalid BCD detector circuit from the Karnaugh map.
- Explain how a single 4-bit adder can be used as an adder/subtracter unit, detailing the role of the Add/Subtract control and the complemented B inputs.
- Why is group-carry look-ahead output (G and P) necessary when cascading multiple 4-bit ALUs to form a 16-bit or 32-bit unit?
- Perform BCD addition for 55 and 59, showing the results of both the first and second adder stages for each digit.
π Lecture 16 β 16-BIT ALU
π Overview: This lecture covers the construction of a 16-bit ALU from four 4-bit ALU units using look-ahead carry generation to eliminate propagation delays. It also introduces comparators, including iterative circuit-based comparators and MSI comparators, and concludes with decoders, their applications, and the binary decoder circuit.
ποΈ Topics Covered
The lecture begins by explaining the carry propagation delay in cascaded 4-bit ALUs and how it is eliminated using group carry generate and propagate terms with a look-ahead carry generator. It then introduces comparator circuits, including their basic function, Boolean expressions for 2-bit comparators, cascading comparators, and iterative circuit-based comparators. Finally, it covers decoders, their applications in computer systems, the binary decoder, and the MSI 74LS139 decoder.
π Lecture Summary
16-BIT ALU
Consider four ALUs connected to form a 16-bit ALU without the Look-Ahead Carry circuit. The ALU1 will only generate an output and a Carry Out 8 when it has received an input at Carry In 4. Similarly, ALU2 will only generate an output and a Carry Out 12 when it has received Carry In 8. Finally, the Carry Out 16 is generated only when ALU3 has received Carry In 12. Thus, the Carry, instead of rippling through the 4-bits of the individual ALU circuit, has to propagate through four ALU units. The last ALU unit has to wait until it receives the Carry propagating through each of the three units.
The delay caused by the Carry propagating through the four units is eliminated by the Group Carry terms used by the 381 ALUs. Instead of the Carry Out, each ALU generates Group-Carry Generate and Propagate terms, which indicate if the most significant Carry is generated by the 4-bit ALU or otherwise. The Group Carry terms are connected to the Look-Ahead Carry Generator which generates the Carry bits C1, C2 and C3 which are connected to Cin4, Cin8 and Cin12 respectively. Thus, Carry no longer propagates through the ALU units.
The G output is activated if the 4-bit unit generates a Carry Out irrespective of Carry In. The P output is activated if the 4-bit unit generates a Carry Out if the Carry In is active. The Look-Ahead circuit implemented earlier is based on Logic Gates, where the Look-Ahead Carry Generator circuit has P0, P1, P2, and P3 Carry Propagate and G0, G1, G2, and G3 Carry Generate Inputs and C1, C2, C3, and C4 Carry Out outputs. The 74XX182 is the MSI version of the Look-Ahead Carry Generator, which provides identical inputs and outputs except for the C4 output which is available in the form of P and G output pins to allow a second level Cascading. The connection of four 74XX381 4-bit ALUs and a 74XX182 to implement a 16-bit ALU is shown. The inputs A, B and the output F of the four 4-bit ALUs 0, 1, 2 and 3 are connected to appropriate bits of the 16-bit inputs A, B and output F respectively. The Group-Carry Generate and Propagate outputs of the four ALUs are connected to the inputs of Look-Ahead Carry generator 74X182 respectively. The Carry outputs C1, C2 and C3 from the Look-Ahead Carry generator circuit are generated after a gate delay of 2 and are connected to the Carry in pins of ALUS 1, 2 and 3 respectively.
Comparators
The basic function of a Comparator is to compare two binary quantities and to determine if the two quantities are equal. If the quantities are not equal, then it has to determine which of the two quantities is greater than the other. Many Integrated Circuit Comparators have three outputs to indicate A=B, A>B and A<B.
π Definition β Comparator: A digital circuit that compares two binary numbers and indicates their relationship (equal, greater than, or less than).
Earlier, simplified Boolean expressions for a 2-bit Comparator circuit were determined that compares two 2-bit numbers and sets one of its three outputs to indicate A=B, A>B or A<B.
π Formula (A>B): (A > B) = A1B1' + A0B1'B0' + A1A0'B0'
π Formula (A=B): (A = B) = A1'A0'B1'B0' + A1'A0B1'B0 + A1A0'B1B0' + A1A0B1B0
π Formula (A<B): (A < B) = A1'B1 + A1'A0'B0 + A0'B1B0
The 2-bit Comparator discussed earlier is considered to be a Parallel Comparator as all the bits are compared simultaneously. External Logic has to be used to Cascade together two such Comparators to form a 4-bit Comparator. The two most significant bits of 4-bit numbers A and B are compared by the Most Significant 2-bit Comparator M and the least significant two bits are compared by the Least Significant 2-bit Comparator L. If the two most significant bits of number A are greater than the two most significant bits of number B, the Most Significant Comparator indicates A>B and there is no need to compare the remaining two least significant bits. However, if the two most significant bits of numbers A and B indicates A=B then least significant two bits have to be compared. Thus the A=B output of the Most Significant 2-bit Comparator is used to enable three AND gates. An alternate method of implementing Comparators which allows the Comparators to be easily cascaded without the need for extra logic gates by Iterative Circuit based Comparators.
Iterative Circuit based Comparator
An Iterative circuit is implemented using identical modules each of which has Primary Inputs and Outputs and Cascading Inputs and Outputs. The Cascading inputs of the least significant module are connected to fixed logic inputs and the Cascading outputs are connected to the Cascading inputs of the next significant module. In the Iterative Circuit for A=B, the Cascading input of Module 0 is connected to logic 1. If input A0 is equal to input B0, the XNOR gate output in Module 0 is a 1 which is passed on to Module 1 through its Cascading input. The output A=B is 1 when input A1 is equal to B1. In the Iterative Circuit for A>B, the Cascading input of Module 0 is connected to Logic 0. The output of Module 0 is 1 when A0>B0. The Cascading output of Module 0 is connected to the Cascading input of Module 1. The output A>B of Module 1 is 1 if A1=B1 and Cascading input is 1, or if A1>B1. Similar Iterative Circuit for A<B allows multiple modules to be cascaded together to form multi-bit A<B unit.
MSI 74HC85 4-bit Iterative Circuit based Comparator allows multiple 74HC85s to be cascaded together to form Comparators N x 4-bit Comparators. Three Comparators are cascaded together: Comparator 1 compares the least significant bits 0 to 3, Comparator 2 compares bits 4 to 7 and Comparator 3 compares the most significant bits 8 to 11. The Cascading inputs of Comparator 1 are permanently connected to Ground and +5 volts: A<B in and A>B in are connected to ground and A=B in is connected to +5 Volts. The cascading outputs of Comparator 1 are connected to the respective cascading inputs of comparator 2, and so on. The final output of the 12-bit Comparator circuit is available at the cascading outputs of Comparator 3.
Decoders
A Decoder has multiple inputs and multiple outputs. The Decoder device accepts as an input a multi-bit code and activates one or more of its outputs to indicate the presence of the multi-bit code.
π Definition β Decoder: A combinational circuit that converts binary information from n input lines to a maximum of 2^n unique output lines.
Basic Decoder: Consider an electronic door lock which unlocks the door when a 4-bit code 1011 is entered. The door is locked when another 4-bit combination 1001 is entered. The lock and unlock circuit is implemented using a combination of NOT and AND gates. The circuit is configured to activate the Lock output when the Door Lock code 1011 is applied at inputs ABCD. The Un-Lock output is activated when the Door Un-Lock code 1001 is applied. The decoder circuit can be expanded to have more Lock and Un-Lock outputs to Lock and Un-Lock different doors in a building.
Applications of decoders:
- Selection of Peripheral Devices: Computers have different internal and external devices. Each of these different devices is selected by specifying different codes. A decoder is used to uniquely select or deselect the appropriate devices.
- Instruction Decoder: Computer programs are based on instructions which are decoded by the Computer Hardware and implemented. Instruction codes are decoded by an Instruction Decoder to generate signals that control different logic circuits like the ALU and memory.
Binary Decoder: The simplest and most commonly used Decoders are the n-to-2^n Decoders. These Decoders have n inputs and 2^n outputs. Each n-bit input selects 1 out of 2^n output code. A 2-to-4 Decoder output O0 is activated to Logic 1 when the input is 00. Similarly for inputs 01, 10 and 11 the outputs O1, O2 and O3 are respectively activated.
MSI Decoder: The 74LS139 MSI chip has dual 2-to-4 Decoders. The 74LS139 has active-low outputs, thus the output which is activated is at logic 0 whereas the outputs that are not selected are at logic 1. A third active-low input G is the enable input, which when set to 0 enables all NAND gates. Setting the G input to 1 disables all NAND gates and all four outputs are at logic 1 (the in-active state). Extra NOT gates are placed at the inputs A and B. By having the extra NOT gates each input presents a single unit load.
β Key Takeaways
The most critical concept is the use of group carry generate (G) and propagate (P) terms to eliminate carry propagation delays in multi-bit ALUs, allowing all ALU units to operate in parallel. Comparators can be built using either parallel comparison or iterative circuits, with iterative circuits allowing easy cascading without additional logic gates. The 74HC85 MSI comparator enables simple expansion to any N x 4-bit comparison by cascading chips with fixed logic on the least significant chip's cascading inputs. Decoders are fundamental for selecting peripheral devices and decoding instructions in computer systems, with n-to-2^n decoders being the most common form. The 74LS139 decoder uses active-low outputs and an enable input, with extra NOT gates to reduce input loading.
π§ Quick Revision Questions
- How does the group carry generate (G) and propagate (P) output of a 74XX381 ALU eliminate carry propagation delay when constructing a 16-bit ALU?
- What are the three Boolean expressions for a 2-bit comparator's outputs (A>B, A=B, A<B)?
- Why must the cascading inputs of the least significant comparator in an iterative circuit be connected to fixed logic values (e.g., A<B and A>B to ground, A=B to Vcc)?
- What is the function of the enable input (G) in the 74LS139 2-to-4 decoder, and what does it mean for the outputs to be active-low?
- In a 12-bit comparator built from three 74HC85s, which comparator's outputs provide the final comparison result?
π Lecture 17 β THE 74XX138 3-TO-8 DECODER
π Overview: This lecture covers the 74XX138 3-to-8 Decoder, its internal structure, enable inputs, and function table. It then explores how decoders can implement standard SOP and POS Boolean expressions, describes BCD-to-7-Segment and BCD-to-Decimal decoders, and introduces encodersβincluding binary and priority encodersβalong with multiplexers.
ποΈ Topics Covered
The lecture begins with the 74XX138 3-to-8 Decoder, its function table and enable inputs, and how to cascade them to form larger decoders like 4-to-16. It then shows how to implement POS and SOP Boolean expressions using decoders with AND and NAND gates. Next, it covers BCD-to-7-Segment Decoders, including MSI 74LS47 with lamp test and blanking functions, and BCD-to-Decimal Decoder 74LS42. The second half introduces encoders, starting with binary 8-to-3 encoders and their drawback, then priority encoders and their cascading, followed by decimal-to-BCD encoder for keypads. Finally, multiplexers are explained, including the 4-to-1 and dual 4-input Multiplexer (74XX153).
π Lecture Summary
THE 74XX138 3-TO-8 DECODER
The 3-to-8, 74XX138 Decoder is commonly used in logical circuits. Similar to the 2-to-4 Decoder, it has active-low outputs and three extra NOT gates at the three inputs to reduce the four unit load to a single unit load. The 3-to-8 Decoder has three enable inputs: one is active-high and the remaining two are active-low. All three enable inputs must be activated for the Decoder to work.
π Definition β Active-low output: An output that is normally at logic HIGH and goes LOW when activated. π Function Table: For 74LS138, when G1=1, G2A=0, G2B=0 (all enables active), the outputs Y0-Y7 correspond to the binary value of inputs C(MSB), B, A(LSB). For invalid enable conditions, all outputs are HIGH. π Example: When C=0, B=0, A=0 and enables are active, Y0=0 and all other outputs Y1-Y7=1.
Implementing Standard SOP and POS Boolean expressions
The function table of 3-to-8 Decoder is a table of maxterms. For example, when A,B,C is 0,0,0 the Y0 output is activated indicating the sum term or maxterm A+B+C. When A,B,C is 1,0,1, the Y5 output activates indicating A+B+C. The POS Boolean expression represented by a 3-variable Karnaugh Map can be implemented by the 3-to-8 Decoder using an AND gate to implement the product of sum terms. The 3-to-8 Decoder can also implement SOP expression by connecting the outputs of the Decoder to the input of a NAND gate. The three bubbles cancel out the three bubbles connected at the outputs representing the three minterms or product terms.
π‘ Why this matters: This shows how decoders serve as universal logic building blocksβany Boolean function can be implemented using a decoder plus a single gate.
π Definition β Maxterm: A sum term (OR) that includes every variable in its true or complemented form; corresponds to rows of the truth table where the output is 0. π Definition β Minterm: A product term (AND) that includes every variable; corresponds to rows where the output is 1. π Formula: For SOP: Output = Ξ£(minterms) β Connect decoder outputs to NAND gate. For POS: Output = Ξ (maxterms) β Connect decoder outputs to AND gate. π Example: Karnaugh Map for Ξ (0,1,3,5,7) is implemented using 3-to-8 Decoder with AND gate connected to Y0, Y1, Y3, Y5, Y7 outputs. For Ξ£(2,4,6), connect Y2, Y4, Y6 to NAND gate.
BCD to 7-Segment Decoder
BCD to 7-Segment Decoder is a specific type of decoder that converts a 4-bit BCD Code to a 7-Segment Code. Unlike Binary Decoders, it activates multiple but unique sets of outputs for each 4-bit BCD input combination. Each of the seven Boolean expressions for activating segments can be implemented using a combination of NOT-AND-OR gates. The implementations for segments a, b and g are shown.
π Formula: Segment a = A + C + BD + BD. Segment b = B + CD + CD. Segment g = A + BC + CD + BC. π Example: For BCD input 0000 (decimal 0), segment a is activated (along with b, c, d, e, f but not g) to display "0".
MSI Seven-Segment Decoder
The 7-Segment Decoder circuit is available in MSI form as 74LS47. This IC has 4-bit BCD input ABCD and 7-bit active-low outputs for segments a through g. It also has three extra active-low inputs: LT (Lamp test), RBI (Ripple Blanking Input), and BI/RBO (Blanking Input/Ripple Blanking Output). When a LOW is applied to LT input and BI/RBO is HIGH, all seven segments turn on to test for burned-out segments. The Ripple Blanking Input and Blanking Input/Ripple Blanking Outputs are used to prevent display of leading and trailing zeros.
π‘ Why this matters: These extra features (lamp test and blanking) are essential for practical digital displays where you need to test the display and suppress unnecessary leading zeros.
BCD-to-Decimal Decoder
The BCD-to-Decimal Decoder operates the same as a Binary 4-to-16 decoder, but has ten output pins instead of sixteen, and the input must be a valid BCD number (0000 to 1001). Invalid BCD codes (1010, 1011, 1100, 1101, 1110, 1111) do NOT activate any of the ten outputs. The commercially available MSI is the 74LS42, which has active-high inputs and active-low outputs.
Encoder
An Encoder performs the opposite operation of a Decoder. It accepts an active level at one of its inputs and generates a BCD or Binary output representing the selected input.
Binary Encoder
The simplest encoders are 2βΏ-to-n encoders. For an 8-to-3 Binary Encoder, the I0 input is unconnected to any gate. If all inputs are inactive LOW, or I0 input is HIGH, the output is 000. The appropriate 3-bit output combination is activated for each input asserted HIGH. The Binary encoder has a drawback when more than one input is activated simultaneouslyβif I3 and I6 are both HIGH, the outputs become a combination (011 and 110), putting all three output pins at logic 1.
π Definition β Binary Encoder: A circuit that converts an active input line into a binary code representing that line's position. π Example: For 8-to-3 encoder, when I3=1 (and all others 0), output O2O1O0 = 011. When I6=1, output = 110. If both are 1 simultaneously, outputs conflict.
Priority Encoders
Priority Encoders solve the problem of multiple simultaneous inputs by having logic to activate outputs corresponding to the highest priority input. Boolean expressions for the three outputs O2, O1, O0 are derived using priority logic where I7 has highest priority and I0 has lowest.
π Definition β Priority Encoder: An encoder that includes priority logic so that when multiple inputs are asserted, only the output corresponding to the highest-priority input is generated.
π Formula: O2 = I7 + I6 + I5 + I4 O1 = I7 + I6 + I5Β·I4Β·I3 + I5Β·I4Β·I2 O0 = I7 + I6Β·I5 + I6Β·I4Β·I3 + I6Β·I4Β·I2Β·I1
Cascading Priority Encoders
The 74XX148 Priority Encoder has active-low inputs and active-low outputs, plus an active-low enable input EI that enables/disables outputs. The Group Select GS active-low output is asserted when any input is asserted. The Enable output EO signal cascades multiple Encoders for larger configurationsβEO connects to the EI input of the Encoder handling lower priority inputs. Two 8-input Priority Encoders can form a 16-input Priority Encoder.
π‘ Why this matters: Cascading allows building priority encoders for more inputs (e.g., 16, 32, 64) using standard MSI chips.
Decimal-to-BCD Encoder
The Decimal-to-BCD Encoder has ten inputs (decimal digits 0-9) and four outputs for 4-bit BCD. The 74LS147 is a Decimal-to-BCD Priority Encoder with active-low inputs and outputs. It is used as a keypad encoderβa telephone keypad connects through pull-up resistors ensuring inputs are logic HIGH when no key is pressed. When a key is pressed, the encoder input connects to logic LOW and the BCD code is generated.
π Example: Pressing key "5" on a telephone keypad connects input I5 to LOW, and the encoder outputs the BCD code for 5 (0101).
Multiplexer
A Multiplexer (or Data Selector) is a digital switch with several inputs and a single output. It has select inputs that allow any one input to be connected to the output. In a computer, ALU combinational circuits use multiplexers to route contents from multiple registers to ALU inputs. For a 4-to-1 Multiplexer, when select inputs S1,S0 are 00, the top AND gate enables input I0 to reach output Z; when select is 10, the third gate enables I2.
π Definition β Multiplexer: A combinational circuit that selects one of many inputs and routes it to a single output, controlled by select lines. π Function Table: For 4-to-1 MUX: S1,S0=00 β Z=I0; 01βZ=I1; 10βZ=I2; 11βZ=I3. π Example: In a CPU, register contents are routed to ALU through multiplexers to perform arithmetic on any two selected registers.
Dual 4-Input Multiplexer
The commercial 74XX153 IC has two 4-input multiplexers with common select inputs (A and B) but separate enable inputs (1G and 2G). Each multiplexer has active-high inputs (1C0-1C3 and 2C0-2C3) and active-high outputs (1Y and 2Y). Two extra NOT gates at select inputs reduce unit load from 5 to 1 each. Select lines enable one of four AND gates per multiplexer to route the corresponding input value through the OR gate to the output. The enable signals independently control each multiplexer's four AND gates.
β Key Takeaways
The 74XX138 3-to-8 Decoder requires all three enable inputs (G1 HIGH, G2A and G2B LOW) to function, and its active-low outputs represent minterms/maxterms for implementing any Boolean function using a single AND or NAND gate. Priority encoders like the 74XX148 solve the problem of multiple simultaneous inputs by generating output for only the highest-priority input, and they can be cascaded using EO and EI pins to handle more inputs. Multiplexers serve as data selectors in systems like ALUs, with common select lines and independent enables, and the 74XX153 provides dual 4-input multiplexers in one package. BCD decoders (74LS42 and 74LS47) handle only valid BCD codes, with the 7-segment decoder featuring lamp test and blanking for practical displays. The Decimal-to-BCD Priority Encoder (74LS147) enables keypad encoding with active-low operation and pull-up resistors.
π§ Quick Revision Questions
- What are the three enable inputs of the 74LS138 3-to-8 Decoder, and what logic levels must each be at for the decoder to function?
- How can a 3-to-8 Decoder be used to implement a POS Boolean expression given by Ξ (0,1,3,5,7)?
- What is the difference between a Binary Encoder and a Priority Encoder in handling multiple simultaneous inputs?
- Explain how two 8-input Priority Encoders (74XX148) can be cascaded to form a 16-input Priority Encoder, including the role of EI, EO, and GS pins.
- For a 4-to-1 Multiplexer with select inputs S1=1, S0=0, which input (I0, I1, I2, or I3) is routed to the output Z?
π Lecture 18 β 2-INPUT 4-BIT MULTIPLEXER
π Overview: This lecture introduces the 2-input 4-bit multiplexer (74X157) and its functional operation. It then covers how to expand multiplexers to create larger configurations like 8-input, 16-input, and 2-input 8-bit multiplexers. Finally, it explores four key applications: data routing for 7-segment displays, parallel-to-serial conversion, logic function generation, and operation sequencing for industrial processes.
ποΈ Topics Covered
The lecture begins with the 2-input 4-bit multiplexer (74X157), its function table and circuit. It then explains how to expand multiplexers by connecting them to form 8-input, 16-input, and 2-input 8-bit multiplexers. The applications section covers data routing using a 2-digit 7-segment display circuit, parallel to serial conversion using an 8-to-1 multiplexer, logic function generation directly from a truth table, and operation sequencing for controlling manufacturing processes using a multiplexer and decoder.
π Lecture Summary
a) 2-INPUT 4-BIT MULTIPLEXER
The MSI 74X157 is a 2-input, 4-bit Multiplexer. It has two sets of 4-bit inputs (1A, 2A, 3A, 4A and 1B, 2B, 3B, 4B), a single select input (S), an active-low enable input (G), and 4-bit outputs (1Y, 2Y, 3Y, 4Y). When G is logic 1 (disabled), all outputs are 0. When G is logic 0 (enabled) and S is 0, the A inputs are routed to the Y outputs; when S is 1, the B inputs are routed. This enables four bits of data from two sources to be routed to the output.
π Definition β Active-High Input/Output: An input or output where a logic 1 (high voltage) represents the active or TRUE state. In the 74X157, inputs 1A-4A and outputs 1Y-4Y are active-high.
π Example: If G=0, S=0, and inputs are 1A=1, 2A=0, 3A=1, 4A=0, then outputs will be 1Y=1, 2Y=0, 3Y=1, 4Y=0. If G=0, S=1, with 1B=0, 2B=1, 3B=0, 4B=1, then outputs become 1Y=0, 2Y=1, 3Y=0, 4Y=1.
Expanding Multiplexers
Multiple multiplexer ICs can be connected to form larger multiplexers for specific application requirements.
1. 8-Input Multiplexer A single dual 4-input multiplexer 74X153 can form an 8-input multiplexer. Two 4-input multiplexers (M1 and M2) are used. The two active-low enable inputs are connected together using a NOT gate to form the C (most significant) select input. Select inputs A and B are common. When C=0, M1 is enabled allowing its inputs 1C0-1C3 to be selected. When C=1, M2 is enabled. The two outputs are connected through an OR gate to produce the final output F.
π Definition β 74X153: A dual 4-input multiplexer IC containing two independent 4-to-1 multiplexers with common select inputs but separate enable and output pins.
2. 16-Input Multiplexer Two 74X153 dual 4-input multiplexers can form a 16-input multiplexer. The select inputs A and B are common, selecting one of four inputs within each enabled multiplexer. The four active-low enable inputs are connected to the active-low outputs of a 2-to-4 decoder. The decoder inputs C and D enable one multiplexer at a time. All four outputs are connected through a 4-input OR gate. The G enable input of the decoder, when set to 1, disables the entire circuit.
π Definition β 2-to-4 Decoder: A combinational circuit with 2 inputs and 4 outputs; for each input combination, exactly one output (active-low in this case) is asserted.
3. 2-Input, 8-bit Multiplexer Two 2-input, 4-bit multiplexers 74X157 can implement a 2-input, 8-bit multiplexer. The select inputs (S) of both multiplexers are tied together, so when S=0 both select the A inputs simultaneously, and when S=1 both select the B inputs. The active-low enable inputs (G) are also tied together, enabling or disabling both multiplexers simultaneously. The outputs combine to form an 8-bit output (1Y-4Y from the first IC, and 5Y-8Y from the second).
π‘ Why this matters: Expanding multiplexers allows designers to create data selection circuits of any size using standard, off-the-shelf ICs, enabling flexible digital system design without custom chips.
Applications of Multiplexers
Multiplexers have a wide variety of applications, primarily for routing data from multiple sources to a single destination.
1. Data Routing A 2-digit 7-Segment Display can be implemented using a single BCD to 7-Segment Decoder and a multiplexer, instead of using two decoders. The BCD numbers for both digits are applied to inputs A and B of the multiplexer. The 4-bit multiplexer output feeds the BCD to 7-Segment Decoder, whose outputs connect to both Common Cathode displays. The MSD/LSD signal is connected to the select input of the multiplexer and, through a NOT gate, to the Common Cathode of the LSD.
π Definition β Common Anode Display: All LED anodes are connected together; a segment lights when its cathode is connected to ground (0V). π Definition β Common Cathode Display: All LED cathodes are connected together; a segment lights when its anode is connected to +5V.
π Example: To display "29", BCD 0010 (MSD=2) is at Input A and BCD 1001 (LSD=9) is at Input B. When MSD/LSD=0, the multiplexer selects Input A, routes 0010 to the decoder, which drives both displays, but only the MSD display is enabled (its common cathode is at 0V). When MSD/LSD=1, Input B is selected, and the LSD display is enabled. By rapidly switching MSD/LSD between 0 and 1, both digits appear simultaneously due to persistence of vision.
2. Parallel to Serial Conversion Digital systems typically use parallel data (multiple bits simultaneously). For remote transmission, serial data (a sequence of single bits) is preferred because it requires only one wire instead of eight. An 8-to-1 multiplexer (74X151) converts 8-bit parallel data to serial form. The 8-bit data is applied to inputs Iβ-Iβ. A 3-bit counter (counting 0 to 7) drives the select inputs Sβ, Sβ, Sβ. A clock pulses the counter every 1 millisecond. Initially, the counter is 000, selecting Iβ. After 1ms, the counter becomes 001, selecting Iβ, and so on. After 8ms, all 8 bits have been output serially.
π Definition β Parallel Data: Multiple bits transmitted simultaneously on multiple wires (e.g., 8-bit byte on 8 wires). π Definition β Serial Data: Single bits transmitted sequentially on one wire.
π‘ Why this matters: Serial transmission dramatically reduces wiring cost in long-distance communication systems (e.g., telephone lines, internet cables).
3. Logic Function Generator A multiplexer can implement any logic function directly from its truth table without simplification. The select inputs of the multiplexer become the function variables. The data inputs are connected to logic 1 or 0 to represent the function output for each input combination.
π Example: For a 3-variable function with truth table rows (ABC: 000β1, 001β1, 010β1, 011β0, 100β0, 101β1, 110β0, 111β1), an 8-to-1 multiplexer is used. Input Iβ (for 000) connects to 1, Iβ (001)β1, Iβ (010)β1, Iβ (011)β0, Iβ (100)β0, Iβ (101)β1, Iβ (110)β0, Iβ (111)β1. The select inputs A, B, C directly correspond to function inputs.
4. Operation Sequencing Many industrial processes require sequential operation where each step must complete before the next begins. A multiplexer and decoder control the sequence. A 2-bit counter (initially 00) drives both the multiplexer select inputs and the decoder inputs. The decoder output Yβ activates Process 1. When Process 1 completes, it outputs logic 1, which is routed by the multiplexer (input Iβ selected) to the counter's clock input, incrementing it to 01. This selects Iβ and activates Yβ to start Process 2. This continues through Process 4, after which the entire manufacturing process ends.
π Definition β Operation Sequencing: A control method where each step of a process must complete before the next step is initiated, with completion signals from each step driving the sequence forward.
β Key Takeaways
The 2-input 4-bit multiplexer (74X157) is a fundamental building block that selects between two 4-bit data sources. Multiplexers can be expanded to any size by cascading smaller multiplexers with decoders and OR gates, enabling 8-input, 16-input, and wider data path configurations. The four key applications are: data routing (e.g., reducing component count in 7-segment displays), parallel-to-serial conversion (essential for cost-effective long-distance data transmission), logic function generation (implementing any truth table without minimization), and operation sequencing (controlling multi-step industrial processes with completion-driven progression). The most critical concept is that the select inputs determine which data input is routed to the output, and by using counters, decoders, and feedback, multiplexers become versatile controllers in digital systems.
π§ Quick Revision Questions
- What are the functions of the G (enable) and S (select) inputs in the 74X157 2-input 4-bit multiplexer?
- Explain how two 4-input multiplexers and a NOT gate can form an 8-input multiplexer. What is the role of the NOT gate?
- In the 2-digit 7-segment display using a multiplexer, why does the MSD/LSD signal need to rapidly switch between 0 and 1?
- Describe the steps involved in converting 8-bit parallel data to serial data using an 8-to-1 multiplexer and a 3-bit counter.
- In the operation sequencing application, how does the completion signal from one process cause the next process to start?