63rrit wrote
regarding the Mux:
Using a Mux4Way16 is like using 3 Mux16. Isn't using 2 Mux16 more efficient because we only have 3 different outputs?
I prefer the Mux4Way16 because it more clearly shows that a choice of 1 of 3 items is being selected by the top two address bits. Modern hardware compilers for FPGAa are highly optimizing, like software compilers. They will discard unused parts of more complex gates.
Also, in real world hardware there is another output state besides TRUE and FALSE. This third state is variously called "high impedance", "tri-state", "3-state" or "open". It is usually called "Z" in truth tables.
3-state outputs work like the have a switch in line with their logic that disconnects the True/False from the output wire. The switch is turned on only if the output is
enabled.
Parts like RAM, ROM, Screen have enables so that only one of them can be turned on at a time. This lets the part outputs be directly connected to the output bus without the need for any multiplexors.
--Mark