>The first thing I want to ask is that do you know how a multiplexer works?
This is because the code that you have pasted shows that you do not fully understand how a multiplexer works.
>if you use "s0,s1,s2" as the control inputs and "a0,a1,a2,a3,a4,a5,a6,a7" as the input pins while "ans"...