Combinational Logic
Combinational Logic
1
Basic Adders
Half-Adder - The half-adder accepts two binary
digits on its inputs and produces
two binary digits on its outputs.
Sum bit and Carry bit are outputs.
Full-Adder - Full-adder accepts two input bits
and an input carry bit and generates
a sum output and an output carry bit.
2
Half-Adder
Simple Binary Addition
0+0=0 Zero plus zero equals zero
0+1=1 Zero plus one equals one
1+0=1 One plus zero equals one
1 + 1 = 10 One plus one equals zero with a carry
of one
3
Half-Adder
4
Full-Adder – Extra Input
5
Full-adder logic.
6
Full-Adder
• Full adder from two half-adder circuits
7
Determine the outputs for the inputs shown.
8
Parallel Binary Adders
To add binary numbers with more than one bit,
you must use additional full-adders.
Carry bit from right column
1
11
+ 0 1
1 0 0
10
Parallel Binary Adders
• Find the sum generated by the 3-bit parallel adder. Show the intermediate
carries when the binary numbers 101 (A) and 011 (B) are added.
1 0 0 1 1 1
1 1
4
1 0 0 0
11
Parallel Binary Adders
• Four-bit parallel binary adder
14
Propagation delay characteristics for the 74LS283.
15
Figure Examples of adder expansion.
16
Figure
Two 74LS283 adders connected as an 8-bit parallel adder (pin numbers are in parentheses).
17
Figure A voting system using full-adders and parallel binary adders.
18
Figure A 4-bit parallel ripple carry adder showing “worst-case” carry propagation delays.
19
• Ripple Carry Adder suffers from propagation
delay
• Look-Ahead Carry Adder
– Tries to anticipate the output carry of each stage
– Carry Generation occurs when both inputs are 1
• Cg = AB
– Carry Propagation occurs when input is rippled
to the output carry
• Cp = A + B
– Output Carry is a 1 if Cg = 1 or (Cp = 1 AND Cin = 1)
• Cout = Cg + CpCin
20
Figure Illustration of conditions for carry generation, C g, and carry propagation, Cp.
22
Figure Logic diagram for a 4-stage look-ahead carry adder.
24
Comparators
• 1-Bit Comparator - Exclusive NOR
25
Comparators
• 2-Bit Comparator
26
• Apply the following set of binary numbers to the comparator inputs
and determine the output by following the logic levels through the
circuit. (Exclusive NOR - High is inputs are the same)
11 and 10
1 0
0
0
?
1 1
1
28
Figure What are the outputs for the given inputs?
0
A B
0110 > 0011 YES
0110 = 0011 NO
0110 < 0011 NO
29
Figure An 8-bit magnitude comparator using two 74HC85s.
• Binary decoder
• 4-bit decoder
• BCD-to-decimal decoder
• BCD-to-7-segement decoder
31
Decoders
• Suppose we want to know when a binary
1001 occurs on the inputs of a digital circuit.
• We can use a Decoder for this function.
• Binary decoder
The output is 1 only when:
A0 = 1
A2 = 0
A3 = 0
A4 = 1
33
Decoders
• 4-bit decoder (4 line to 16 line decoder or 1 of 16 decoder)
Logic
Diagram
34
Decoders
• 4-bit decoder
– Binary inputs
– Active-low outputs
(bubbles)
Truth
Table
A3A2A1A0 Output
0 1 1 0 6 is low, all other outputs are high 35
Decoders
• BCD-to-decimal decoder
If 0011 is input, then output 3 is low and all other outputs are high
Active Low output since bubbles on outputs. 36
Decoders
• BCD-to-7-segement decoder
Common-anode
Logic
Diagram
37
Common Anode has all anodes of LEDs tied to +V
Decoders
• BCD-to-7-segment decoder
Truth
Table
38
Figure
Pin diagram and logic symbol for the 74LS47 BCD-to-7-segment decoder/driver.
LT = Lamp Test - when LOW and BI/RBO is HI then all LEDs are ON
BI = Blanking Input
RBI = Ripple Blanking Input 39
Copyright ©2006 by Pearson Education, Inc.
Upper Saddle River, New Jersey 07458
RBO = Ripple Blanking Output All rights reserved.
Figure
Examples of zero suppression using the 74LS47 BCD to 7-segment decoder/driver.
• Decimal-to-BCD encoder
• 8-line-to-3-line encoder
41
Encoders
• Decimal-to-BCD encoder ( 10 inputs, 4 outputs)
42
Logic Diagram of Decimal-to-BCD Encoder
All odds
A0 = 1 + 3 + 5 + 7 + 9
A1 = 2 + 3 + 6 + 7
A2 = 4 + 5 + 6 + 7
A3 = 8 + 9
43
Encoders
• 8-line-to-3-line encoder
• BCD-to-binary conversion
• Binary-Gray conversions
45
BCD
• Convert BCD number 00100111 to binary.
• Could convert to decimal 27 and then convert to binary.
• Can add weights.
80 40 20 10 8 4 2 1
0 0 1 0 0 1 1 1
1 1
10 2
100 4
10100 20
0011011 27
46
Figure Four-bit binary-to-Gray conversion logic.
Convert 1 1 0 0 to Gray
101 0
XOR
47
Figure
Four-bit Gray-to-binary conversion logic.
Convert 1 0 1 0 to Gray
110 0
XOR
48
Multiplexers (Data Selectors)
• 4-input multiplexer
• Expanded multiplexers
49
Multiplexers (Data Selectors)
• 4-input multiplexer
01
1
1 10
0
1
0
51
Demultiplexers
Reverses the multiplexing function.
Sends the data input to the selected output.
Decoders can be demultiplexers.
52
Demultiplexers
• 2-line-to-4-line demux
53
• Find the data-output waveforms for the demultiplexer.
S0 and S1 select
which output line
will receive the
input data.
If data input is zero,
then all outputs will
be zero.
54
Parity Generators/Checkers
• Parity generator/checker
Sum of even number of 1s is always 0.
Sum of odd number of 1s is always 1.
55
Figure Problem 4. Find the sum based on the inputs.
Note: We are adding A = 111 to B = 101.
1 1 0 0
56
Figure Problem 14. Plot the 3 outputs (A>B, A=B, A<B)
1 0 0 1 0 1 0 0 1 0 0
1 1 1 1 1 1 1 1 0 1 0
1 1 1 0 0 0 1 0 1 0 0
1 1 0 0 0 0 1 1 1 0 0
0 1 0 1 1 1 0 0 0 0 1
A>B
A=B
A<B
57
Figure Problem 22. Find sequence of digits that appear.
A3A2A1A0
0 0 0 0 0
0
1 0 0 1 9
1 1 1 1 undefined
58
Figure Like Problem 28.
If S0S1 = 11 and
D3D2D1D0 = 1001,
what is the output?
=1
59