This study investigates entropy generation resulting from natural convective heat transfer in square enclosures with local heating of the bottom and symmetrical cooling of the sidewalls. This analysis tends to optimize heat transfer of two pieces of semiconductor in a square electronic package. In this simulation, heaters are modeled as isoflux heat sources and sidewalls of the enclosure are isothermal heat sinks. The top wall and the non-heated portions of the bottom wall are adiabatic. Flow and temperature fields are obtained by numerical simulation of conservation equations of mass, momentum and energy in laminar, steady and two dimensional flows. With constant heat energy into the cavity, effect of Rayleigh number, heater length, heater strength ratios and heater position is evaluated on flow and temperature fields and local entropy generation. The results show that a minimum entropy generation rate is obtained under the same condition in which a minimum peak heater temperature is obtained.