One of the primary goals of biped locomotion is to generate and execute joint trajectories on a corresponding step plan that takes the robot from a start point to a goal while avoiding obstacles and consuming as little energy as possible. Past researchers have studied trajectory generation and step planning independently, mainly because optimal generation of robot gait using dynamic formulation cannot be done in real time. Also, most step-planning studies are for flat terrain guided by search heuristics. In the proposed method, a framework for generating trajectories as well as an overall step plan for navigation of a 12 degrees of freedom biped on an uneven terrain with obstacles is presented. In order to accomplish this, a dynamic model of the robot is developed and a trajectory generation program is integrated with it using gait variables. The variables are determined using a genetic algorithm based optimization program with the objective of minimizing energy consumption subject to balance and kinematic constraints of the biped. A database of these variables for various terrain angles and walking motions is used to train two neural networks, one for real-time trajectory generation and another for energy estimation. To develop a global navigation strategy, a weighted A* search is used to generate the footstep plan with energy considerations in sight. The efficacy of the approach is exhibited through simulation-based results on a variety of terrains.