DLD Chap6
DLD Chap6
S S
A S
A
Cout
B Cout B
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Full-Adder
Inputs Outputs
A B Cin Cout S
By contrast, a full adder has three binary
0 0 0 0 0
inputs (A, B, and Carry in) and two binary 0 0 1 0 1
outputs (Carry out and Sum). The truth table 0 1 0 0 1
summarizes the operation. 0 1 1 1 0
1 0 0 0 1
A full-adder can be constructed from two 1 0 1 1 0
half adders as shown: 1 1 0 1 0
1 1 1 1 1
S S
A A S A S Sum
S
B B Cout B Cout A S
B
Cout
Cin Cin
Cout Symbol
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Full-Adder
S S 0 Sum
1 A S 1 A S
0 B Cout 0 B Cout 1
For the given inputs, determine the
intermediate and final outputs of the full 1 Cout
adder. 1
The second half-adder has inputs of 1 and 1; therefore the Sum = 0 and the
Carry out = 1.
The OR gate has inputs of 1 and 0, therefore the final carry out = 1.
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Full-Adder
Notice that the result from the previous example can be read directly on the
truth table for a full adder.
Inputs Outputs
A B Cin Cout S
S S 0 Sum
0 0 0 0 0 1 A S 1 A S
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0 0 B Cout 0 B Cout 1
1 0 0 0 1
1 0 1 1 0 1 Cout
1 1 0 1 0
1 1 1 1 1 1
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Two bit adder
Summary
Parallel Adders
Full adders are combined into parallel adders that can add binary
numbers with multiple bits. A 4-bit adder is shown.
A4 B4 A3 B3 A2 B2 A1 B1
C0
C4
C3 C2 C1
S4 S3 S2 S1
The output carry (C4) is not ready until it propagates through all of the
full adders. This is called ripple carry, delaying the addition process.
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Parallel Adders
The logic symbol for a 4-bit parallel adder is shown. This 4-bit adder
includes a carry in (labeled (C0) and a Carry out (labeled C4).
S
1 1
Binary 2 2 4-bit
number A 3 3 sum
4 4
1
Binary 2
number B 3
4
Input Output
C0 C4
carry carry
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Comparators
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
(a) Logic Symbol
A0 A0
A1 X A1 X
A2 A2
A3 A3
Active HIGH decoder for 0011 Active LOW decoder for 0011
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Decoders
A0 = 0
A1 = 1
1
A2 = 0
A3 = 1
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
The 3-Bit decoder
Summary
Decoders
Bin/Dec
0 1
For the input shown, 1 1
2 1
what is the output? 3 1
4 1
1 A0 5 1
6 1
4-bit binary 1 A1 7 1 Decimal
input 0 A2 8 1 outputs
9 1
1 A3 10 1
11 0
12 1
13 1
14 1
15 1
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
BCD to decimal decoder
BCD-to-decimal decoders accept a binary coded decimal input and activate one of ten possible decimal digit indications.
BCD to 7-Segment Decoder
7-Segment Display
it is used to display the decimal numbers0 to 9. It has seven segments a,b,c,d,e,f,g
Function table for segment a
Function table for segment b
Function table for segment c
Function table for segment d
Function table for segment e
Function table for segment f
Function table for segment g
Active low BCD to 7 segment decoder
(74LS42)
• Logic symbol
55
Summary
Encoders
An encoder accepts an active logic level on one of its inputs and converts it to
a coded output, such as BCD or binary.
1
The decimal to BCD is an encoder A0
with an input for each of the ten 2
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
A Decimal to BCD Encoder
Summary
Encoders
1 0 1
A0
2 0
1
3 1
A1
4 0
5 0 0
0 A2
6 0
7
8 0 0
A3
0
9
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Encoders
(16)
This device is offers additional (11)
HPRI/BCD
1
flexibility in that it is a priority (12)
2
(13)
encoder. This means that if more (1)
3
1
(9)
4 (7)
than one input is active, the one Decimal (2) 5
2
(6)
BCD
input 4 output
with the highest order decimal (3)
(4)
6
8
(14)
digit will be active. (5)
7
8
(10) 9
(8)
74HC147
The next slide shows an application … GND
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
What is Gray Code? and Advantages
of Gray Code: This code belongs to a
class of codes called minimum change
code in which only one bit in the code
group changes when going from one
step to the next.
This is an un-weighted code which
means that there are no specific
weights assigned to the bit
positions. Because of this the Gray
code is not suited for arithmetic
operations but finds applications in
input/output devices and some types
of analog to digital converters (ADCs).
In Gray code, if we go from one
decimal number to next, only one bit
of the gray code changes. Because of
this feature, an amount of switching is
minimized and the reliability of the
switching systems is improved.
Summary
Code converters
1 1 1 1
0 0
0 MSB 0 MSB
Binary-to-Gray Gray-to-Binary
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Multiplexers
A multiplexer (MUX) selects one data line from two or more input lines and
routes data from the selected line to the output. The particular data line that
is selected is determined by the select inputs.
MUX
Two select lines are shown 0
S0 0
Data 1
here to choose any of the select S1
1
four data inputs.
D0 0 Data
D1 1 output
Data
D 2
inputs D2
Which data line is selected if 3 3
S1S0 = 10? D2
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Demultiplexers
Summary
Parity Generators/Checkers
The ASCII letter S is 1010011. Show the parity bit for the letter
S with odd and even parity.
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Summary
Parity Generators/Checkers
The 74LS280 can be used to generate a parity bit or to check an incoming data
stream for even or odd parity.
Floyd, Digital Fundamentals, 10 th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved