Professional Documents
Culture Documents
7 - Combinational Circuit Building Blocks
7 - Combinational Circuit Building Blocks
7 - Combinational Circuit Building Blocks
Outline
Multiplexers
Combinational Synthesis Using Multiplexers
Circuit Building Decoders
Blocks Synthesis Using Decoders
Encoders
s
s f A multiplexer with n data inputs
w0
w1
0
1
f 0 w0
needs log2n select inputs (or 2n data
1 w1
(b) Truth table
inputs require n select signals)
(a) Graphical symbol
Larger multiplexers can be built using
w0 w0 smaller multiplexers
Example-1: a 4-to-1 multiplexer can
s f s be built with three 2-to-1 multiplexers
w1 w1 Example-2: a 16-to-1 multiplexer can
f
(d) Circuit with transmission gates
be built with five 4-to-1 multiplexers
(c) Sum-of-products circuit
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
4-to-1 Multiplexer 4-to-1 Multiplexer
VOLKAN KURSUN Bilkent University VOLKAN KURSUN Bilkent University
w2 0
w3
w3 1
(c) Circuit
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
16-to-1 Multiplexer 2x2 Crossbar Switch
VOLKAN KURSUN Bilkent University VOLKAN KURSUN Bilkent University
f
capability to connect any x2 y2
select signal s
w11
w12
w15
w0
w3
w4
w7
w8
s0
s1
Encoders 0 0 0
0
0 1 1
1
Code Converter Example 1 0 1 1
f
1 1 0 0
Unsigned Comparators
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
Implementation using a 4-to-1 multiplexer
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
Synthesis of Logic Functions 3-Input Majority Function
VOLKAN KURSUN Bilkent University VOLKAN KURSUN Bilkent University
Example: Consider the following XOR function with Implementation with a 4-to-1 multiplexer:
two inputs f = w1 w2 any two of the three inputs can be applied
A better implementation with only one 2- to the select inputs of the multiplexer
w1 w2 w3 f
to-1 multiplexer: w1 input is applied as 0 0 0 0
w1
0
w2
0 0
f
Can be implemented with two 2-to-1 Can be implemented with one 4-to-1
multiplexers. When w1 = 0, 2 3. multiplexer. Use w1 and w2 to drive the
Alternatively, when w1 = 1, 2 3. select inputs of the 4-to-1 multiplexer
w1 w2 w3 f w2 w1 w2 w3 f w2
0 0 0 0 w1 0 0 0 0
w3
w1
0 0 1 1 0 0 1 1
w2 w3
0
0
1
1
0
1
1
0
w3 2 3
0
0
1
1
0
1
1
0
w3 w3
1 0 0 1 1 0 0 1
1 0 1 0
w2 ⊕ w3 f 1 0 1 0
w3
f
1 1 0 0 1 1 0 0
w3
1 1 1 1 1 1 1 1
Truth table
EEE 102 Introduction to Digital Circuit Design Circuit VOLKAN KURSUN
Truth table
EEE 102 Introduction to Digital Circuit Design Circuit VOLKAN KURSUN
Shannon’s Expansion Theorem
VOLKAN KURSUN Bilkent University VOLKAN KURSUN Bilkent University
1 2 n 1 2 n 1 2 1 2 3 1 2 3 1 2
n 1 2 n 1 2 n 3 1 2 3 1 2 3
1 2 3 1 2 3 1 2 3 1 2
1 2 3
w 2
w 1
1 2 n 1 2 3 n 1 2 3
w 3
n 1 2 3 n 1 2 3
n 1 2 3 n 1 2 3 f
n 1 2 3 n 1 2 3 n 1
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
1 2 3 1 2 3 1 2 3 2 3 2 3 2 2 3 0 0 0 0
1 3 1 2 3) 2 3 2 3 2 3 2 0 0 1 0
w1 w2 w1
0 1 0 0
0 0 1 1 1
w3
1 0 0 0
f f
w3 1 0 1 1
1 1 0 1
w2 1
1 1 1 1
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
Binary Decoder
VOLKAN KURSUN Bilkent University VOLKAN KURSUN Bilkent University
Outline
Multiplexers A binary number applied as input is decoded and the
corresponding output is asserted. Only one output is
Synthesis Using Multiplexers asserted at a time (one-hot encoding) and the asserted
output corresponds to the valuation of the binary input
Decoders
Synthesis Using Decoders
Encoders
Code Converter Example
Unsigned Comparators
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
When Enable = 1, the decoder behaves as before n-to-2n decoder: a binary decoder with n inputs
When Enable = 0, all outputs are forced to 0: when the has 2n outputs
decoder is disabled, no output is asserted regardless of
the values of w0 and w1
Example: a 3-to-8 decoder built from two 2-to-4 decoders Example: a 4-to-16 decoder built w0
deco-0
w0 y0 y0
where the w2 input drives the enable inputs of the two decoders from five 2-to-4 decoders where w1 w1 y1 y1
the first decoder drives the enable y2 y2
w2 = 0 and enable = 1, upper decoder is enabled while the inputs of the four decoders in the y3 y3
En
lower decoder is disabled second stage
w2 = 1 and enable = 1, upper decoder is disabled while the w3w2 = 0b00 and en = 1, deco-0 is deco-1
w0 y0 y4
enabled while the other decoders
w
lower decoder is enabled y in the second stage are disabled
w1 y1 y5
0 w0 y0 0 y2 y6
w1 y1 w3w2 = 0b01 and en = 1, deco-1 is w2 w0 y0 y3 y7
w1 y1 En
enabled while the other decoders w3 w1 y1
y2 y2 y2
w2 in the second stage are disabled deco-2
En y3 y3 En En y3 w0 y0 y8
w3w2 = 0b10 and en = 1, deco-2 is
w1 y1 y9
enabled while the other decoders y2 y10
in the second stage are disabled y3 y11
En
w3w2 = 0b11 and en = 1, deco-3 is
En w0 y0 y4
enabled while the other decoders deco-3
w1 y1 y5 in the second stage are disabled w0 y0 y12
y2 y6 w1 y1 y13
en = 0, all decoders are disabled
y2 y14
En y3 y7 and all outputs are forced to 0
En y3 y15
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
Example: 3-input full adder designed with a 3- The one-hot encoded outputs of a decoder can be used
to-8 decoder and two OR gates to select among the input channels of a multiplexer
ci xi yi ci + 1 si i = En = 1, the circuit behaves as a 4-to-1 multiplexer
w0
En = 0, f = 0
i 1 =
0 0 0 0 0 2-to-4
0 0 1 0 1 decoder w1
0 1 0 0 1 s0 i0 y0
0 1 1 1 0 s1 i1 y1 f
1 0 0 0 1 y2 w2
1 En y3
1 0 1 1 0
1 1 0 1 0
w3
1 1 1 1 1
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
2n-to-n encoder: performs the opposite function Encodes information from 4 inputs into a 2-bit
of a decoder. Encodes information from 2n code: output y1 is 1 when w3 or w2 is 1 and
inputs into an n-bit code output y0 is 1 when w1 or w3 is 1. Therefore, the
Only one input is supposed to have a value of 1 outputs can be generated with two OR gates.
and the outputs present the binary number w3 w2 w1 w0 y 1 y0 w0 Circuit
that identifies which input is asserted
w3 w2 w1 w0 y1 y0 w1
w0 0 0 0 1 0 0 y0
y0
0 0 0 1 0 0 0 0 1 0 0 1
2n n w2
0 0 1 0 0 1 inputs outputs
0 1 0 0 1 0 yn – 1
0 1 0 0 1 0
w2n – 1 y1
1 0 0 0 1 1 1 0 0 0 1 1 w3
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
Case statement must include a WHEN clause for all possible valuations of
the select signal: OTHERS keyword covers all remaining valuations
EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN EEE 102 Introduction to Digital Circuit Design VOLKAN KURSUN
Unsigned Comparator
VOLKAN KURSUN Bilkent University VOLKAN KURSUN Bilkent University
Outline
Multiplexers Compare the values of two unsigned binary
numbers
Synthesis Using Multiplexers Example: design a 4-bit comparator to compare
the values of two unsigned inputs A = a3a2a1a0 and
Decoders B = b3b2b1b0
Define intermediate signals i0, i1, i2, and i3 to
Synthesis Using Decoders determine if the corresponding bit positions are
equal: i0 = 0 0, i1 = 1 1, i2 = 2 2, i3 =
Encoders
3 3
N xgty
Z