Sperry Corp. yesterday was declared the winner of a unique "computeoff" with Burroughs Corp. when the Air Force awarded the company a $476.2 million contract to replace the basic computers at about 100 bases worldwide.

The contract, known as Phase Four, is believed to be the largest commercial computer order ever placed. Moreover, analysts say the eight-year contract potentially could be worth billions more to Sperry over the next 20 years when optional contract extensions, expansion, service and other factors are included.

Despite the competition, the Air Force said the decision primarily had been made on the basis of cost. It would not elaborate. Planning Research Corp., a McLean company that had been providing systems architecture and management support to Burroughs in the competition, said it understood the Air Force had made its decision "on the basis of a substantial price difference between the proposals."

Sperry, which competed for the contract in tandem with Computer Sciences Corp., a software and systems management company, said it was "delighted" with the contract award and expects to add 2,000 employes as the result.

There was no immediate comment from Burroughs, which had set up a special team of more than 100 persons to handle the contract competition, and hoped to use the contract as a stepping stone to other government data-processing work. PRC said it was disappointed by the Air Force's decision.

All four companies seemed surprised by the timing of the announcement, which had been scheduled for next Tuesday.

Under the contract, Sperry will replace 277 outmoded Air Force computers with 150 new computers and 20,000 computer terminals. The installation of the equipment will begin later this year.

Rather than ask for bids and proposals in the traditional manner, the Air Force gave the two teams about $50 million each to set up prototypes of each system and subject them to several months of "hands-on" tests -- 20,000 tasks in all.

By using such a format, similar to the "flyoffs" held between competing aircraft manufacturers, the service hoped to come up with a system that worked as advertised and to save money by ironing out technical problems before actually purchasing the equipment. Russell D. Hale, assistant secretary of the Air Force for financial management, estimated yesterday that the "computeoff" saved the service $335 million.