Complete the code to declare a 4-bit down counter signal.
signal counter : std_logic_vector([1] downto 0);
The counter is 4 bits wide, so the highest index is 3 (0 to 3).
Complete the process sensitivity list to trigger on clock and reset signals.
process([1])The process should be sensitive to both clock and reset signals, listed as clk, reset.
Fix the error in the if statement checking for reset being active high.
if [1] = '1' then
The reset signal is active high, so the condition should check if reset = '1'.
Fill both blanks to correctly decrement the counter and reset it to 15 when it reaches 0.
if counter = [1] then counter <= [2]; else counter <= counter - 1; end if;
The counter resets to 15 ("1111") when it reaches 0 ("0000").
Fill all three blanks to complete the process that updates the counter on the rising edge of the clock and handles reset.
process(clk, reset)
begin
if [1] = '1' then
counter <= [2];
elsif rising_edge([3]) then
counter <= counter - 1;
end if;
end process;The process resets the counter to 15 when reset is high, and decrements on the rising edge of clk.
