Complete the code to declare a 4-bit shift register signal.
signal shift_reg : std_logic_vector([1] downto 0);
The shift register 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 sensitivity list must include both clock and reset signals separated by comma.
Fix the error in the assignment to shift the register left by one bit.
shift_reg <= shift_reg([1] downto 0) & serial_in;
To shift left by one bit in a 4-bit register (3 downto 0), slice from 2 downto 0.
Fill both blanks to complete the synchronous reset logic for the shift register.
if [1] = '1' then shift_reg <= (others => [2]);
The reset signal is checked for '1' to clear the register to all '0's.
Fill all three blanks to complete the process that shifts the register on rising clock edge with reset.
process([1]) begin if [2] = '1' then shift_reg <= (others => '0'); elsif rising_edge([3]) then shift_reg <= shift_reg(2 downto 0) & serial_in; end if; end process;
The process sensitivity list includes clock and reset. Reset is checked for '1'. The rising edge is detected on clock.
