Beruflich Dokumente
Kultur Dokumente
1
FACULTY OF COMPUTER SCIENCE & INFORMATION SYSTEM
2
Basic Adder
3 4
Basic Adder:
Half Adder
A⊕B
XOR
5 6
5 6
2012/2013-ii @m 1
12/6/12
Σ
A Σ
Sum
Basic Adder:
Β
STEP 1: Produce a
Accepts two input bits and truth table
n Σ STEP 2: Map the K-Map
an input carry and A Σ
Sum Inputs Outputs
generates a sum output and Β
A B CIN ∑ COUT
Cout
an output carry. Input Carry Cin
Output Carry
0 0 0 0 0
n Suitable for adding more 0 0 1 1 0
than 1 bits by cascading the 0 1 0 1 0
full adder. 0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
7 8
= A⊕B
(Module: Page 149)
= AB
∑= (A ⊕ B) ⊕ C in
(A ⊕ B)Cin
Cout = AB + (A ⊕ B)Cin
Cout = AB + ACin + BCin AB Cout = AB + (A ⊕ B)Cin
= AB + (A + B)Cin (Half Adder with 2 half adder)
9 10
Σ Σ A = 1, B = 0, and Cin = 0
1 A Σ
Sum 1 A Σ
Sum =1
Example: 0 Β
Solution: 0 Β
1 + 0 + 0 = 1 with no carry
Cout Output Carry Cout Output Carry =0
0 Cin 0 Cin
∑ = 1, Cout = 0
For each of
the three full
Σ Σ A = 1, B = 1, and Cin = 0
adders, 1 A Σ
Sum 1 A Σ
Sum =0
determine the 1 Β
1 Β
1 + 1 + 0 = 0 with carry 1
Cout Cout
outputs for 0 Cin
Output Carry
0 Cin
Output Carry
=1
∑ = 0, Cout = 1
the inputs
shown.
Σ Σ A = 1, B = 0, and Cin = 1
1 A Σ
Sum 1 A Σ
Sum =0
0 Β
0 Β
1 + 0 + 1 = 0 with carry 1
Cout Cout
1 Cin
Output Carry
1 Cin
Output Carry
=1
∑ = 0, Cout = 1
11 12
2012/2013-ii @m 2
12/6/12
Ex Ex
tr tr
a a
Exercise 6.1: Determine the sum ( ∑ ) and the output carry Exercise 6.2: A full adder has Cin = 1. What are the sum ( ∑ )
(Cout) of a half adder for each set of input bits: and the output carry (Cout) when A = 1 and B = 1?
Σ
A Σ
Sum
∑= A ⊕ B Cout = AB Β
Cout Output Carry
Input, A Input, B Sum ( ∑ ) Output carry (Cout) Cin
i) 0 1
ii) 0 0
iii) 1 0
iv) 1 1
13 14
Parallel Adder
(Module: Page 175)
15 16
A3 A2 A1
+ B3 B2 B1
∑∑∑∑4 3 2 1
∑∑∑∑∑
5 4 3 2 1
∑= (A ⊕ B) ⊕ C in
Cout = AB + (A ⊕ B)Cin
2012/2013-ii @m 3
12/6/12
Comparator
(Module: Page 177)
19 20
• To check for N bit equality (XNOR), combine the result of Example: Design a single comparator that compares X and
comparing an N single bit comparator. Y. Determine whether X=Y, X<Y or X>Y.
Solution:
The circuit: Example: Apply each of the following sets of binary numbers to the
comparator inputs in the Figure, and determine the
Design a separate output (equity) by following the logic levels through the
circuit for each output circuit.
and finally combine
them. (a) 10 and 10 (b) 11 and 10
X > Y → XY
X = Y → X Y + XY = X • Y
X < Y → XY
23 24
2012/2013-ii @m 4
12/6/12
Solution:
(a) 10 and 10 MSI chip: (74LS85) Figure: Logic symbol for a
4-bit comparator with
4-bit Comparator
inequality indication.
(b) 11 and 10
Example: Determine the A = B, A > B, and A < B outputs for the Solution:
input numbers shown on the comparator in the Figure.
A > B output is
HIGH and the
1 other outputs
are LOW
0
27 28
Ex
tr
a
Exercise 6.3: What are the comparator outputs when binary number of
A = 1011 and B = 1010 applied as the inputs ?
Decoders
29 30
2012/2013-ii @m 5
12/6/12
Decoders
n Function
n detect the presence of a specified combination of bits (code) on Types of Decoder
its inputs
n to indicate the presence of that code by a specified output level.
31 32
Ex
tr
Decoder: a
Binary Decoder
Exercise 6.4: Develop the logic required to detect the binary code
10010 and produce an active-LOW output.
33 34
Ex
tr
a Binary Decoder:
3-Bit Decoder
Exercise 6.5: When the output is active-HIGH for each of decoding
gates in the Figure, what is the binary code appearing on
the inputs? The MSB is A3.
For this example:
Input active HIGH Output active HIGH
A B C
Decoding
A0 functions: A B C Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
A0
Q
ABC 0 0 0 1 0 0 0 0 0 0 0 0
A1 ABC 0 0 1 0 1 0 0 0 0 0 0 Q1
A2 A1 ABC 0 1 0 0 0 1 0 0 0 0 0 Q2
A3
ABC 0 1 1 0 0 0 1 0 0 0 0 Q3
ABC 1 0 0 0 0 0 0 1 0 0 0 Q4
A2 ABC 1 0 1 0 0 0 0 0 1 0 0 Q5
ABC 1 1 0 0 0 0 0 0 0 1 0 Q6
A3 ABC 1 1 1 0 0 0 0 0 0 0 1 Q7
2012/2013-ii @m 6
12/6/12
Decoder:
4-Bit Decoder
• AND is used because we want an active HIGH output.
n to 2n 1 of 2n
• The each input there will be only one HIGH output.
0 Example: X/Y 0
1
0
2
1 If the input = 101, 3
A0 1 4
0 A1 2 5
the output Q5 = 1
Decoder 0 A2 4 6
8 7
A3
1 0 8
9
0 0 10
Note: 11
0
1 Only one output will 12
13
Active active with a unique 14
HIGH CS1 &
output binary pattern at input. 15
ABC CS 2 EN
Active HIGH input
10
0
1
0
1 10
0
1 0 1 0 0
0 EN
39 40
a
tr
(Module: Page 185)
Ex
Example:
Address Decoder.
• Decoder is use a lot to decode an
address of a computer. Example:
0
Port Address: 01002 0
I/O Request : LOW(0) 1
0
41 42
2012/2013-ii @m 7
12/6/12
Ex
tr
a Decoder:
BCD to Decimal
Review . . .
Binary Coded Decimal (BCD)
0 1 2 3 4 5 6 7 8 9
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
43 44
Decoder:
Binary to 7-Segments
f b
g
e c
45 46
Encoders
Encoders
Type of Encoders:
47 48
2012/2013-ii @m 8
12/6/12
Encoder:
Decimal to BCD
Vcc
Vcc
S0
S0
S1
S1
S2
AA0 S2
AA0
S3 A S3
Pengekod B A1 Pengekod BA1
S4 C A2
S4
(Encoder) CA
S5 (Encoder) 3
S5
D
2
D S6 A3
(Kod BCD)
S6 S7
(Kod BCD)
S7 S8
S9
S8
S9
Logic symbols for a decimal to BCD encoder.
49 50
Exercise 6.6:
Solution 6.6:
Encoder:
Priority Encoder
Multiplexers (MUX)
Multiplexers (DEMUX)
53 54
2012/2013-ii @m 9
12/6/12
Multiplexers (MUX)
(Data Selector)
S0 Data Output
0 Y = D0 Y = S 0 D0 + S1D1
1 Y = D1
57 58
Exercise 7: Exercise 7:
59 60
2012/2013-ii @m 10
12/6/12
Multiplexers (DEMUX)
(Data Distributor)
Exercise 8: What is the output of Y if the binary values of S and D are n A DEMUX is basically reverse the multiplexing function.
given in the Figure. n It takes digital information from one line and distributes it to a given
number of output lines.
Solution 8: n For this reason, DEMUX is also known as a data distributor.
1 n Decoder can also be used as DEMUX.
0
S1 S0 Q3 Q2 Q1 Q0
Q0
Q1 If
1 only 0 0 0 0 0 1
I Q2
1 I=1 0 1 0 0 1 0
0 Qn-1
1 0 0 1 0 0
1
Y = D1 = 1
1 1 1 0 0 0
Pemilih
Selector (S)
61 62
63 64
Code Converter
66
Code Converter
65 66
2012/2013-ii @m 11
12/6/12
67 68
69
2012/2013-ii @m 12