Complete the code to declare a 4-bit signal.
signal data_bus : std_logic_vector([1] downto 0);
The signal is 4 bits wide, so the highest index is 3 (0 to 3).
Complete the code to infer a flip-flop with asynchronous reset.
process(clk, reset) begin if reset = '1' then q <= '0'; elsif rising_edge([1]) then q <= d; end if; end process;
The flip-flop triggers on the rising edge of the clock signal.
Fix the error in the combinational process sensitivity list.
process([1]) begin y <= a and b; end process;
For combinational logic, the sensitivity list must include all input signals used inside the process.
Fill both blanks to infer a synchronous process with enable signal.
process(clk) begin if rising_edge([1]) then if [2] = '1' then q <= d; end if; end if; end process;
The process triggers on the rising edge of the clock and updates output only if enable is high.
Fill all three blanks to infer a RAM block with write enable and address.
process(clk) begin if rising_edge([1]) then if [2] = '1' then ram([3]) <= data_in; end if; end if; end process;
The RAM write happens on clock rising edge when write_enable is high, at the given address.
