For a university project, I have to design and construct a very simple CPU including the ALU. In order to select between different data lines that go into the ALU(32-bit data line), I have thought of two different approaches.
Basically, the first method is using a multiplexer, For example, it takes in input from register file and instruction register and gives out the output. This was the method recommended to me by the professor, however this method seems to get very complex very quickly based on the size of the data buses, and the number of operations needed to be performed.
The second method I found was to use tri-state buffers along with a decoder. Rather than use a huge multiplexer, it only requires a decoder large enough for the number of operations. However, with this solution, I was warned that there could be timing issues, where during the transition of the decoder, two tri-state buffers could be simultaneously activated, which would cause a short-circuit. Is there any truth to this, and can it be avoided? This was the method that I thought was used inside most modern architectures, but I could be incorrect.
Also, how is there no timing violation in case of multiplexers