Complete the code to declare a FIFO memory array of 16 elements, each 8 bits wide.
type fifo_mem is array (0 to 15) of std_logic_vector([1] downto 0);
The FIFO stores 8-bit data, so the index goes from 7 downto 0.
Complete the code to increment the write pointer with wrap-around in a 4-bit pointer.
write_ptr <= (write_ptr + 1) mod [1];
The FIFO depth is 16, so the pointer wraps around modulo 16.
Fix the error in the FIFO full condition check.
fifo_full <= '1' when (write_ptr = [1]) else '0';
The FIFO is full when the write pointer is one less than the read pointer (with wrap-around).
Fill both blanks to complete the process sensitivity list and reset condition.
process([1], [2]) begin if reset = '1' then write_ptr <= (others => '0'); end if; end process;
The process must be sensitive to clock and reset signals.
Fill all three blanks to complete the FIFO write operation inside the clocked process.
if rising_edge([1]) then if write_enable = '1' and fifo_full = '0' then fifo_mem([2]) <= [3]; end if; end if;
The write operation happens on clock rising edge, writing data_in to fifo_mem at write_ptr.
