Consider the following VHDL process. What will be the value of y after a changes from '0' to '1'?
process(a, b) begin if a = '1' then y <= '1'; else y <= '0'; end if; end process;
Remember the process sensitivity list triggers the process when any signal in it changes.
The process sensitivity list includes a and b. When a changes, the process runs and sets y to '1' if a is '1'.
Given this process, what will happen if b changes from '0' to '1'?
process(a)
begin
y <= a and b;
end process;Think about what triggers the process to run.
The process sensitivity list only includes a. Changes to b do not trigger the process, so y does not update immediately.
Analyze the following VHDL process. What problem will occur during simulation?
process(clk, reset) begin if reset = '1' then q <= '0'; elsif rising_edge(clk) then q <= d; end if; end process;
Consider which signals cause the process to run and which signals are read inside.
The process sensitivity list includes clk and reset, which is correct for this sequential D flip-flop with asynchronous reset. The signal d does not need to be included because it is sampled only on clock edges. The process triggers correctly and updates q as expected.
Which statement best explains why all signals read inside a process must be in its sensitivity list?
Think about how the process knows when to run.
Including all read signals in the sensitivity list ensures the process runs whenever any input changes, so outputs reflect the current inputs.
Given the following process and signal changes, how many times will the process run?
process(a, b, c) begin x <= a or b and c; end process; -- Signal changes in order: a changes once b changes twice c changes once
Count how many times any signal in the sensitivity list changes.
The process triggers once for each change in any signal in the sensitivity list. Here, a changes once, b twice, and c once, totaling 4 triggers.
