Piedmont Airlines said it is installing a sophisticated computer system aboard its fleet of planes--the first carrier in the world to do so--that will warn pilots of impending midair collisions. Piedmont, a subsidiary of USAir group, announced in Washington that it has purchased the first of 81 airborne traffic alert and collision avoidance systems, called TCAS II. The multimillion-dollar purchase initially will enable Piedmont to equip 45% of its existing fleet with the safety devices, the airline said. A Piedmont spokesman said installation of the system will begin on Boeing 737-300 aircraft about mid-1989 and that all of the 81 units will be flying aboard the 737-300 and 737-400 fleets by 1991. TCAS II informs pilots of the location of another aircraft in their vicinity, alerts them to any threats and issues recommendations for climb or descent escape maneuvers to prevent a collision. The system is independent of ground stations.