PPT ½½¶óÀ̵å
If/Elsif Example and Rules
1. The first condition found to be true will be executed.2. Conditions can overlap.3. The first condition of an if / elsif will have priority.
process ( A, B, C, D, Sel )beginIf ( Sel = ¡°00¡± ) then Z <= A;elsif ( Sel = ¡°01¡± ) then Z <= B;elsif ( Sel = ¡°10¡± ) then Z <= C; else Z <= D; end if; end process ;
Z <= A when (Sel = ¡°00¡±) else B when (Sel = ¡°01¡±) else C when (Sel = ¡°10¡±) else D ;
Compare with Same Function Code