**Problem statement: Given an 8:1 multiplexer such that the input connected to 5th input is the most setup timing critical and other inputs are timing critical in the order D0 > D1 > D2 > D3 > D4 > D6 > D7. Restructure the logic accordingly.**

**Solution:**We know that the most setup timing critical signal should have least logic in the data path. So, we need to prioritize 5th input such that it has least logic out of all the inputs. In other words, this is a problem of converting an ordinary multiplexer to a priority multiplexer. Let us first discuss how we can convert a multiplexer to priority mux.

Figure 1 below shows a multiplexer with 8-inputs D0 - D7 and selects S2,S1,S0.

Figure 1: 8:1 multiplexer |

The equation for output is given as below:

O = S2.S1.S0.D7 + S2.S1.S0’.D6 +
S2.S1’.S0.D5 + S2.S1’.S0’.D4 + S2’.S1.S0.D3 + S2’.S1.S0’.D2 + S2’.S1’.S0.D1 +
S2’.S1’.S0’.D0

This multiplexer can be represented in the form of a priority multiplexer as required is as shown in figure 2 below.

We can start from the equation of the priority multiplexer and prove that it is actually equivalent to 8:1 mux.

The equation of the priority multiplexer is given as:

**O = (S0.S1'.S2).D5 + (S0.S1'.S2)'.(S0'.S1'.S2').D0 +**

**(S0.S1'.S2)'.(S0'.S1'.S2').**

**(S0.S1'.S2').D1 +**

**(S0.S1'.S2)'.(S0'.S1'.S2').**

**(S0.S1'.S2')'.(S0'.S1.S2').D2 +**

**(S0.S1'.S2)'.(S0'.S1'.S2').**

**(S0.S1'.S2')'.(S0'.S1.S2')'.(S0.S1.S2').D3 +**

**(S0.S1'.S2)'.(S0'.S1'.S2').**

**(S0.S1'.S2')'.(S0'.S1.S2')'.(S0.S1.S2')'.(S0'.S1.S2).D4 +**

**(S0.S1'.S2)'.(S0'.S1'.S2').**

**(S0.S1'.S2')'.(S0'.S1.S2')'.(S0.S1.S2')'.(S0'.S1.S2)'.(S0'.S1.S2).D6 +**

**(S0.S1'.S2)'.(S0'.S1'.S2').**

**(S0.S1'.S2')'.(S0'.S1.S2')'.(S0.S1.S2')'.(S0'.S1.S2)'.(S0'.S1.S2)'.(S0.S1.S2).D7**

Simplifying the above equation leads us to the equation of ordinary multiplexer.