Showing posts with label rtl design. Show all posts
Showing posts with label rtl design. Show all posts

Implement 3 and 4 variable function using 8:1 MUX

Three variable  function can be easily implemented using 8:1 multiplexer. connect 3 input lines to select lines of mux and connect 8 inputs of mux to logic 0 or 1 according to function output. For example, let us say Function is

                                      F(X,Y,Z) = Σ(0,1,3,6)

then X,Y,Z will be connected to select lines of Mux and I0 , I1, I3 and I6 will be connected to logic 1(VDD) and other will be connected to logic 0


The output will select an input based upon the values provided at S0, S1 and S2


For a 4 variable function, there are 16 possible combinations. To implement 4 variable function using 8:1 MUX, use 3 input as select lines of MUX and remaining 4th input and function will determine ith input of mux . Let us demonstrate it with an example :

                                  F(A,B,C,D) = Σ(1,5,7,9,10,11,12)

A
B
C
D
Decimal Equivalent
F
0
0
0
0
0
0
1
0
0
0
8
0
0
0
0
1
1
1
1
0
0
1
9
1
0
0
1
0
2
0
1
0
1
0
10
1
0
0
1
1
3
0
1
0
1
1
11
1
0
1
0
0
4
0
1
1
0
0
12
1
0
1
0
1
5
1
1
1
0
1
13
0
0
1
1
0
6
0
1
1
1
0
14
0
0
1
1
1
7
1
1
1
1
1
15
0


The function represented using 8:1 mux
The 4 variable function represented using 8:1 mux

                                  ABar = ~A (inverted A)

As shown in figure, B,C,D are used as select lines and A will be used input  of Mux. from Truth table, if B,C,D  are 0 then output F is 0 irrespective of status of A so I0 = 0. For I5(BCD = 101) output depend upon A.

                                     for A = 0,  F  = 1
                                     for A = 1,  F =  0
                          Hence F = ~A (for BCD = 101)
                                    I4, (B = 1, C = 0, D = 0),  F = A
                                    I1, (B = 0, C =  0,D  = 1), F = 1 (irrespective of status of A)

similarly All other inputs can be inferred in the same way.  Thus we can conclude that to implement n variable function, we need 2^(n-1) to 1 MUX and an inverter. n-1 input lines shall be used as select lines and rest one will be used for input of MUX.

Also read: