In this paper, a strategy for recognition of human walking activities and prediction of gait periods using wearable sensors is presented. First, a Convolutional Neural Network (CNN) is developed for the recognition of three walking activities (level-ground walking, ramp ascent and descent) and recognition of gait periods. Second, a first-order Markov Chain (MC) is employed for the prediction of gait periods, based on the observation of decisions made by the CNN for each walking activity. The validation of the proposed methods is performed using data from three inertial measurement units (IMU) attached to the lower limbs of participants. The results show that the CNN, together with the first-order MC, achieves mean accuracies of 100% and 98.32% for recognition of walking activities and gait periods, respectively. Prediction of gait periods are achieved with mean accuracies of 99.78%, 97.56% and 97.35% during level-ground walking, ramp ascent and descent, respectively. Overall, the benefits of our work for accurate recognition and prediction of walking activity and gait periods, make it a suitable high-level method for the development of intelligent assistive robots.