In this paper, a new approach for optimal power distribution in DC/AC microgrids integrated with electric vehicles (EVs) using a Flow Direction Algorithm (FDA) tuned Convolutional Neural Network (CNN) is proposed. The increasing adoption of microgrids and EVs necessitates advanced energy management systems capable of efficiently handling power flow to ensure stability, reliability, and efficiency. Traditional approaches often battle with the difficulty and dynamic nature of power distribution in such systems. Our proposed approach leverages the predictive capabilities of CNNs, tuned by the FDA, to dynamically optimize power flow in DC/AC microgrid. The Flow Direction Algorithm enhances CNN's ability to predict optimal power distribution by learning from historical data, considering factors such as load demand, generation capacity, and EV charging requirements. This integration allows for adaptive and intelligent decision-making, reducing energy losses and improving the overall system. The proposed method is validated through extensive simulations in MATLAB/Simulink, demonstrating significant improvements in power distribution efficiency compared to Fuzzy logic system, Artificial Neural network and conventional CNN. The results indicate that the FDA-tuned CNN effectively balances the power between DC and AC microgrid, loads, and manages EV charging and discharging processes, and mitigates potential grid disturbances. The proposed method has prediction accuracy of 99.4 %, overall efficiency of 99.1 %.