Would someone help me a bit understanding the function of mux and demux? I understand how it works, but I don't get how it is used. I was going to wait until that chapter when I need it and figure it out then.
Muxes are also called selectors because a common usage is to select between alternative signals.
Demuxes are also called distributors because they can distribute a control signal to one of several locations.
For example (not from Hack) a CPU need to select which of 4 registers to route to the ALU inputs based on bit fields in the current CPU instruction and where to store the result based on another bit field. Out mythical CPU's instruction include the bit fields ...xxyydddw... where xx and yy select the source registers, ddd selects the destination. The w bit controls whether the instruction writes to the destination register. (Sometimes you want to just do a compution and test the result, compare instruction for example.)
Color marks the active paths if the instruction has x=3, y=0, d=2, w=1.
--Mark