Combinational Logic
description
Transcript of Combinational Logic
![Page 1: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/1.jpg)
1
Combinational Logic
Chapter 4
![Page 2: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/2.jpg)
Combinational Circuits
![Page 3: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/3.jpg)
Combinational Circuits
• Adders• Subtractors• Comparators• Decoders• Encoders• MultiplexersAvailable as MSI Circuits and as Standard Cells in VLSI (Bonus Assignment: Get one example of each type of combinational circuits in the CMOS family, 5 points for the second exam)
![Page 4: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/4.jpg)
Analysis Procedure
• Given a logical diagram, determine one or more of the following:– Boolean functions;– Truth table;– Explanation of circuit operation
• Make sure the circuit is combinational, not sequential (No feedback loops)
![Page 5: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/5.jpg)
Analysis Procedure
1. Label all gate outputs that are a function of input variables. Determine the Boolean function for each gate output
2. Label the gates that are a function of input variables and previously labeled gates. Find the Boolean functions for these gates
3. Repeat step 2 until output of circuits are obtained4. By repeated substitution of previously defined
functions, obtain the output Boolean functions in terms of input variables
![Page 6: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/6.jpg)
Analysis Procedure
![Page 7: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/7.jpg)
Analysis Procedure𝑇 2=𝐴𝐵𝐶𝑇 1=𝐴=𝐵+𝐶𝐹 2=𝐴𝐵+𝐴𝐶+𝐵𝐶
Step 1
Step 2𝑇 3=𝐹 2
′ 𝑇1𝐹 1=𝑇 3+𝑇 2Steps 3 and 4𝐹 1=𝑇 3+𝑇 2=𝐹 2
′ +𝐴𝐵𝐶¿ ( 𝐴𝐵+𝐴𝐶+𝐵𝐶 )′ (𝐴+𝐵+𝐶 )+𝐴𝐵𝐶¿ ( 𝐴′+𝐵′ ) (𝐴′+𝐶 ′ ) (𝐵′+𝐶 ′ ) ( 𝐴+𝐵+𝐶 )=𝐴𝐵𝐶¿ ( 𝐴′+𝐵′𝐶 ′ ) (𝐴𝐵′+𝐴𝐶 ′+𝐵𝐶 ′+𝐵′𝐶 )+𝐴𝐵𝐶¿ 𝐴′𝐵𝐶 ′+𝐴′𝐵′𝐶+𝐴𝐵′𝐶 ′+ 𝐴𝐵𝐶
![Page 8: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/8.jpg)
Analysis Procedure
1. Determine the number of input variables in the circuit. For inputs, form the possible input combinations and list the binary numbers from to in a table
2. Label the outputs of selected gates with arbitrary symbols
3. Obtain the truth table for the outputs of those gates which are a function of the input variables only
4. Proceed to obtain the truth table for the outputs of those gates which are a function of previously defined values until the columns for all outputs are determined
![Page 9: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/9.jpg)
Analysis Procedure
![Page 10: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/10.jpg)
Design Procedure
1. From the specifications of the circuit, determine the required number of inputs and outputs and assign a symbol to each
2. Derive the truth table that defines the required relationship between inputs and outputs
3. Obtain the simplified Boolean functions for each output as a function of the input variables
4. Draw the logical diagram and verify correctness of the design
![Page 11: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/11.jpg)
Code conversion example
![Page 12: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/12.jpg)
Code conversion example
![Page 13: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/13.jpg)
Code conversion example𝑧=𝐷 ′𝑦=𝐶𝐷+𝐶 ′ 𝐷′=𝐶𝐷+𝐶+𝐷 ¿ ′𝑥=𝐵′𝐶+𝐵′𝐷+𝐵𝐶′ 𝐷′=𝐵′ (𝐶+𝐷 )+𝐵𝐶 ′𝐷 ′¿𝐵′ (𝐶+𝐷 )+𝐵 (𝐶+𝐷) ′
𝑤=𝐴+𝐵𝐶+𝐵𝐷=𝐴+𝐵(𝐶+𝐷)
![Page 14: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/14.jpg)
Code conversion example
![Page 15: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/15.jpg)
Binary Adder-SubtractorHalf adder
𝑆=𝑥 ′ 𝑦+𝑥𝑦 ′𝐶=𝑥𝑦
![Page 16: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/16.jpg)
Half adder
![Page 17: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/17.jpg)
Full adder
![Page 18: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/18.jpg)
Full adder
𝑆=𝑥 ′ 𝑦 ′ 𝑧+𝑥 ′ 𝑦 𝑧 ′+𝑥 𝑦 ′ 𝑧 ′+𝑥𝑦𝑧𝐶=𝑥𝑦+𝑥𝑧+𝑦𝑧
Implementation of full adder in sum-of-products
![Page 19: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/19.jpg)
Full Adder
![Page 20: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/20.jpg)
Full adder
𝑆=𝑧⊕(𝑥⊕𝑦 )¿ 𝑧 ′ (𝑥 𝑦 ′+𝑥 ′ 𝑦 )+𝑧 (𝑥 𝑦 ′+𝑥 ′ 𝑦) ′¿ 𝑧 ′ (𝑥 𝑦 ′+𝑥 ′ 𝑦 )+𝑧 (𝑥𝑦+𝑥′ 𝑦 ′ )¿ 𝑥 𝑦 ′ 𝑧 ′+𝑥 ′ 𝑦 𝑧 ′+𝑥𝑦𝑧+𝑥′ 𝑦 ′ 𝑧
𝐶=𝑧 (𝑥 𝑦 ′+𝑥 ′ 𝑦 )+𝑥𝑦=𝑥 𝑦 ′ 𝑧+𝑥 ′ 𝑦𝑧+𝑥𝑦
Implementation of full adder using two half adders and one or gate
![Page 21: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/21.jpg)
Binary adder
![Page 22: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/22.jpg)
Carry propagation
Full Adder with and shownCarry Generate
![Page 23: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/23.jpg)
Carry propagation𝑃 𝑖=𝐴𝑖⊕𝐵𝑖𝐺𝑖=𝐴𝑖𝐵𝑖𝑆 𝑖=𝑃𝑖⨁𝐶𝑖
𝐶𝑖+1=𝐺𝑖+𝑃 𝑖𝐶𝑖
𝐶0=input carry𝐶1=𝐺0+𝑃0𝐶0
𝐶2=𝐺1+𝑃1𝐶1=𝐺1+𝑃1 (𝐺0+𝑃𝑜𝐶0 )=𝐺1+𝑃1𝐺0+𝑃1𝑃0𝐶0
𝐶3=𝐺2+𝑃2𝐶2=𝐺2+𝑃2𝐺1+𝑃2𝑃1𝐺0+𝑃2𝑃1𝑃0𝐶0
Carry lookahead generator
![Page 24: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/24.jpg)
Four-bit adder with carry lookaheadCarry lookahead generator
![Page 25: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/25.jpg)
Four-bit adder with carry lookahead
![Page 26: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/26.jpg)
Binary subtractor
![Page 27: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/27.jpg)
Overflow
• Occurs only when adding two positive numbers or two negative numbers;
• Overflow produces change in result signExample: eight-bit adder
+70
+80
+150
0 1
0 1000110
0 1010000
1 0010110
-70
-80
-150
1 0
1 0111010
1 0110000
0 1101010
Carry bits
![Page 28: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/28.jpg)
Decimal Adder
• Consider adding two decimal digits in BCD
• Output sum cannot exceed 9+9+1=19 (the last 1 is the carry from previous digit)
![Page 29: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/29.jpg)
Decimal AdderCarry
Nee
d co
rrec
tion
𝐶=𝐾+𝑍8𝑍 4+𝑍 8𝑍 2Condition for correcting result
![Page 30: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/30.jpg)
Decimal Adder
![Page 31: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/31.jpg)
Binary Multiplier
Exercise:Multiply
Explain how you carried the multiplication out. How many bits at the output?
![Page 32: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/32.jpg)
Binary Multiplier
Two-bit multiplier
![Page 33: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/33.jpg)
Binary MultiplierExercise: With your neighbor classmate discuss its operation.
![Page 34: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/34.jpg)
Magnitude Comparator
Exercise: Discuss with your neighbor classmate and write down how you would compare two four-bit binary numbers and , where and . You should have three outputs corresponding to , , and . Explain how you determined each condition.
![Page 35: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/35.jpg)
Magnitude Comparator
Does this circuit correspond to what you wrote down in the exercise? Discuss again with your neighbor classmate the comparison of your result with this circuit.
![Page 36: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/36.jpg)
Decoders
Exercise: Minimize the functions for two of the eight output lines.
![Page 37: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/37.jpg)
Decoders
Three-to-eight-line decoder
Exercise: Compare your function with the circuit.
![Page 38: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/38.jpg)
Decoders
0
![Page 39: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/39.jpg)
Decoders
decoder constructed with two decoders
Exercise: Explain how this decoder works.
![Page 40: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/40.jpg)
Combinational logic implementation
Exercise: For the maps of the full adder shown above, express the sum (left) and the carry bit (right) as a sum of minterms.
![Page 41: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/41.jpg)
Combinational Logic Implementation
𝑆 (𝑥 , 𝑦 ,𝑧 )=∑ (1,2,4,7)
𝐶 (𝑥 , 𝑦 , 𝑧 )=∑ (3,5,6,7)Compare in terms of propagation time and number of gates this Full Adder with the previously studied implementation.
![Page 42: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/42.jpg)
Encoders
𝑧=𝐷1+𝐷3+𝐷5+𝐷7
𝑦=𝐷2+𝐷3+𝐷6+𝐷7
𝑥=𝐷4+𝐷5+𝐷6+𝐷7
![Page 43: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/43.jpg)
Priority encoderValid outputHighest priority
![Page 44: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/44.jpg)
Priority encoder
Exercise: obtain the function for
![Page 45: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/45.jpg)
Priority encoder
![Page 46: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/46.jpg)
Multiplexers
• Selects binary information from one of many input lines
• Directs input line to output, controlled by a set of selection lines
• input lines and selection lines
![Page 47: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/47.jpg)
Multiplexers
Two-to-one-line multiplexer
![Page 48: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/48.jpg)
Multiplexers
Four-to-one-line multiplexer
![Page 49: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/49.jpg)
Multiplexers
Quadruple two-to-one-line multiplexer
![Page 50: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/50.jpg)
Boolean function implementation
• Multiplexer is essentially a decoder with OR gates• Thus can implement Boolean functions, similar to
decoders• Minterms generated by circuit associated with
selection inputs• Individual minterms can be selected by data
inputs• Boolean function of variables and data inputs
![Page 51: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/51.jpg)
Boolean function implementation
• More efficient method for implementing a Boolean function of variables with multiplexer of selection inputs
• Remaining variable of function is used for the data inputs
![Page 52: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/52.jpg)
Boolean function implementation
• Example:
Implementation of a three-input Boolean function
0
1
2
3
Selected input line
![Page 53: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/53.jpg)
Boolean function implementation𝐹 ( 𝐴 ,𝐵 ,𝐶 ,𝐷 )=∑ (1,3,4,11,12,13,14,15)
0
1
2
3
4
5
6
7
![Page 54: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/54.jpg)
Three-state gates
![Page 55: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/55.jpg)
Three-state gates
Multiplexers with three-state gates
![Page 56: Combinational Logic](https://reader035.fdocuments.net/reader035/viewer/2022062501/5681613e550346895dd0a704/html5/thumbnails/56.jpg)
Homework Assignment
• 4.3• 4.9• 4.17• 4.27• 4.33• Using LogicWorks, simulate a 4-bit full adder
with and without carry-lookahead.