Does it simulate correctly? If not, then get that working correctly. Asking about optimization on something that is not functionally correct is a meaningless exercise.
Kevin Jennings
Sir, This is my VHDL code for Triple modular redundant MUX.
Is it correct sir?
_____________________________________________________
entity mux4_1 is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
d : in STD_LOGIC;
s1 : in STD_LOGIC;
s2 : in STD_LOGIC;
o : out STD_LOGIC);
end mux4_1;
architecture Behavioral of mux4_1 is
signal o1,o2,o3:std_logic;
begin
process(a,b,c,d,s1,s2)
begin
o1<=(a and (not s1 and not s2)) or (b and (not s1 and s2))--repeating the hardware;
or (c and (s1 and not s2)) or (d and(s1 and s2));
o2<=(a and (not s1 and not s2)) or (b and (not s1 and s2))
or (c and (s1 and not s2)) or (d and(s1 and s2));
o3<=(a and (not s1 and not s2)) or (b and (not s1 and s2))
or (c and (s1 and not s2)) or (d and(s1 and s2));
o<= (o1 and o2) or(o2 and o3)or (o1 and o3);-- voting mechanism;
end process;
end Behavioral;
______________________________________________________________