Exclusive OR/Exclusive NOR (XOR/XNOR) : XOR/XNOR Truth Table Xor B A Xnor B 0 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1
Exclusive OR/Exclusive NOR (XOR/XNOR) : XOR/XNOR Truth Table Xor B A Xnor B 0 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1
Exclusive OR/Exclusive NOR (XOR/XNOR) : XOR/XNOR Truth Table Xor B A Xnor B 0 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1
XNOR
1
a
b
XNOR = ab + ab
XOR = ab + ab
N. B. Dodge 9/15
N. B. Dodge 9/15
bc bc bc bc
a
a
3
000
001
011
010
100
101
111
110
Identical circuit
solution using
K-map method:
=
f ab + ac
N. B. Dodge 9/15
Exercise 1
0
0
0
0
0
1
1
1
1
Lecture #6: More Complex Combinational Logic Circuits
N. B. Dodge 9/15
K-Map Solution
y z yz yz yz
x
x
000
001
011
010
100
101
111
110
N. B. Dodge 9/15
Decoders
N. B. Dodge 9/15
Decoders (2)
The truth tables for a-d in our 2-to-4 decoder are:
x
y *
a
b
c
d
0
0
1
0
0
0
0
1
0
1
0
0
1
0
0
0
1
0
1
1
0
0
0
1
Using the truth tables above, we can define a-d in terms of x and y.
a = xy
b = xy
c = xy
d = xy
* Note that we put x first because we regard the xy pair as a number, with x the more significant bit.
Lecture #6: More Complex Combinational Logic Circuits
N. B. Dodge 9/15
Decoders (3)
Remembering that
=
a x=
y, b xy
=
, c x y,=
and xy :
If we consider xy a binary number with x
the MSB and y the LSB, then a-d represent a
x
true condition for each of the four possible
y
binary numbers that x and y can represent.
Thus we say that each output a-d has an
address, which is a unique combination of
the two bits in the binary number yx:
For
=
xy 00,
=
a 1; for
=
xy 01,
=
b 1;
for
=
xy 10,
=
c 1; for
=
xy 11,
=
d 1.
a
b
c
d
N. B. Dodge 9/15
Decoders (4)
a
b
c
d
e
f
g
h
3-input,
eightoutput
decoder
xy
z
g
N. B. Dodge 9/15
Definition of a Multiplexer
A multiplexer is a combinational logic circuit that has up to 2n
inputs, an n-bit address, and one output.
The multiplexer connects one of the inputs to the output,
depending on the value of the n-bit address.
The n-bit address is decoded, just as we have studied in the last
five slides.
Thus the multiplexer uses a decoder and a selector circuit (which
we will see in a subsequent slide) to tie one of its inputs to its
output.
The multiplexer is usually symbolized by the abbreviation MUX as
the symbol for its function.
10
N. B. Dodge 9/15
x
0
0
1
1
11
y
0
1
0
1
f
a
b
c
d
N. B. Dodge 9/15
Components of a Multiplexer
a
b
c
Output*
x
y
12
Selector
* Note that the multiplexer has
a 1-bit output.
Decoder
The multiplexer is shown above, with the various parts of the circuit labeled.
Lecture #6: More Complex Combinational Logic Circuits
N. B. Dodge 9/15
Multiplexer:
A multiplexer has two sets of inputs: n address lines (just like the
decoder) and as many as 2n inputs, one of which is selected by each
address for output (it may have less inputs).
A multiplexer has only one output. The output is the value of the input
selected by the address.
N. B. Dodge 9/15
Exercise 2
Lets design a simple decoder
and multiplexer.
14
N. B. Dodge 9/15
N. B. Dodge 9/15
Principles of Addition
Carries
5 8 7
6 4 3
1
2 3 0
Binary numbers are added in exactly the same way:
Carries
16
1 1 1 1
1 1 1
10101000111
+ 01111110101
(1) 0 0 1 0 0 1 1 1 1 0 0
Basic principles for an n-column addition:
Add column i plus carry from column i1 (ci1).
If a one-digit result, that number is the sum of column i, si.
If a 2-digit result, the right digit is si. The left digit is carry i, or ci.
The column i carry, ci, will be added to column (i+1).
Lecture #6: More Complex Combinational Logic Circuits
N. B. Dodge 9/15
A Half-Adder Circuit
17
a b S co
0
S Exp
co Exp
ab
ab
ab
a
S
Co
Half-Adder Circuit
N. B. Dodge 9/15
=
s ab + ab
s= a b
18
N. B. Dodge 9/15
Half-Adder in Action
= 0,
19
=1
Lecture #6: More Complex Combinational Logic Circuits
N. B. Dodge 9/15
20
N. B. Dodge 9/15
ci
co
S Exp co Exp
abc *
abc
abc
abc
abc
abc
abc
abc
above simply as c.
N. B. Dodge 9/15
N. B. Dodge 9/15
23
N. B. Dodge 9/15
32-Bit Adder
1-digit (2-bit)
full adder
24
May be a
half-adder
N. B. Dodge 9/15
Subtraction
25
N. B. Dodge 9/15
Ci
A
C0
A0
A1
A2
A3
B
Ci
Inputs
If the Add/Sub+
input is high, the
XORs invert the
B input, while if
it is low, the B
input is not
changed.
26
B0
B1
B2
B3
C1
S0
S1
S2
S3
B
Ci
C3
C2
Add-/Sub+
Ci
Outputs
Note that the
Add/Sub+ line
must be XORed
with the C3 line
to be correct for
the subtract case.
B
4-Bit Adder Section
Add/Subtract Selector
Lecture #6: More Complex Combinational Logic Circuits
N. B. Dodge 9/15
N. B. Dodge 9/15
A 1-Bit ALU
2-Bit MUX Select Address
OR
AND
Carry In
1-bit
Full Adder/
Subtractor
Sum
Carry/
Borrow
4-to-1 MUX
The 1-bit ALU provides all the possible results of logic/arithmetical analysis to
the 4-1 MUX. The 2-bit select address (derived from decoding a part of the
computer instruction) selects the desired result and outputs it. For instance,
outputting the borrow signal provides a comparison of a and b.
28
N. B. Dodge 9/15
N. B. Dodge 9/15
Exercise 3
As a special exercise in reviewing the
digital adder plus some of the
principles we learned earlier,
consider the following:
The SOP Boolean expression for a full
adder carry out is:
30
N. B. Dodge 9/15