Complete the code to declare a 4-bit std_logic_vector signal named 'data'.
signal data : std_logic_vector([1] downto 0);
The signal 'data' is declared as a 4-bit vector, which means indices from 3 down to 0.
Complete the code to assign the value "1010" to the signal 'data'.
data <= "[1]";
The value "1010" is assigned as a string of bits to the signal 'data'.
Fix the error in the process sensitivity list to include the signal 'clk'.
process([1]) begin if rising_edge(clk) then -- process body end if; end process;
The process must be sensitive to 'clk' to detect clock edges properly.
Fill both blanks to create a conditional assignment that sets 'out' to '1' when 'enable' is high and 'data' equals "1010".
out <= '1' when (enable = '[1]') and (data = "[2]") else '0';
The condition checks if 'enable' is '1' and 'data' equals "1010" to set 'out' to '1'.
Fill all three blanks to complete the process that resets 'out' to '0' on 'reset' and sets 'out' to '1' on rising edge of 'clk' when 'enable' is '1'.
process([1], [2]) begin if [3] = '1' then out <= '0'; elsif rising_edge(clk) then if enable = '1' then out <= '1'; end if; end if; end process;
The process is sensitive to 'reset' and 'clk'. It checks if 'reset' is '1' to clear 'out', else on rising edge of 'clk' and 'enable' high, sets 'out' to '1'.
