cur_x_next <= (others => '0') when ((we = '1' or right_tick = '1') and cur_x_reg = MAX_X-1) or enter_tick = '1' or (cur_x_reg = 0 and cur_y_reg = 0 and bck_spc_tick = '1') or esc_tick='1' or reset = '1' else cur_x_reg + 1 when we = '1' or right_tick = '1' else to_unsigned(MAX_X-1,cur_x_next'length) when (left_tick = '1' or bck_spc_tick = '1') and cur_x_reg = 0 --"001001111" else cur_x_reg - 1 when left_tick = '1' or bck_spc_tick = '1' else cur_x_reg; ---------------------------------------------------------------------------- cur_y_next <= (others => '0') when (down_tick = '1' and cur_y_reg = MAX_Y-1) or (cur_x_reg = 0 and cur_y_reg = 0 and bck_spc_tick = '1') or (cur_y_reg = MAX_Y-1 and enter_tick ='1') or esc_tick = '1' or reset = '1'--or (cur_y_reg = MAX_Y-1) else to_unsigned(MAX_Y-1,cur_y_next'length) when up_tick = '1' and cur_y_reg = 0 else cur_y_reg + 1 when enter_tick = '1' or down_tick = '1' or (we = '1' and cur_x_reg = MAX_X -1) else cur_y_reg - 1 when up_tick = '1' or (bck_spc_tick = '1' and cur_x_reg = 0) else cur_y_reg;