i have been told to use ‘when’ statement to make multiplexer but not use ‘if’ statement as it will cause timing errors…
i don’t understand this …
so what is the difference between ‘if’ and ‘when’ ? and do they map to the same thing in hardware ?
i have been told to use ‘when’ statement to make multiplexer but not use
Share
OK, lets discuss some points at first on the difference between if and when statements:
when statement
if statement
And you know multiplexer is a component don’t need process block, as its behavior doesn’t change with changing its input, so it will be outside process, so you have to write it using when statement as it is concurrent statement.. And if you wrote it with if statement, timing errors may occur. Also all the references and also Xilinx help (if you are using Xilinx) are writing the Multiplexer block using when statement not if statement
Reference: Digital Design Priciples & Practices, John F. Wakerly, 3rd Edition