Two employes of separate giant computer firms were arrested by the FBI at a Prince George's County motel last night and charged with fraud and conspiracy in the attempted sale of secret company data related to pending bids on a $40 million Defense Department computer contract.

FBI agents, posing as employes of a Bethesda computer concern, arrested the men shortly before 9 p.m. at the Ramada Inn in Lanham after the two men turned over "valuable material" dealing with the contract in exchange for an estimated $150,000 in "cash and negotiable instruments," according to the FBI.

Edward D. Hegerty, special agent in charge of the FBI field office in Baltimore, identified the men as Porter John Ward, 43, of Sterling, Va., a computer scientist with Computer Sciences Corp. of Arlington and El Segundo, Calif., and Ronald George Barry, 36, of San Jose, Calif., an employe of a division of the National Semiconductor Corp. of Mount View, Calif. They were charged with wire fraud, submitting false bids to defraud the government, and conspiracy.

The FBI said the investigation began last Friday when officials of Electronic Data Systems, a Dallas-based firm with offices in Bethesda, contacted the FBI and said that individuals claiming to be with Computer Sciences, a major competitor, had telephoned and offered to sell the company detailed information about Computer Sciences' bid on a lucrative defense department contract that both firms are seeking.

The contract involved computer hardware and software to be supplied to the U.S. Military Personnel Center in Alexandria, according to the FBI.

FBI agents for several days negotiated with the callers, who initially sought a 1 percent cut of the entire contract--about $400,000--for the information but later settled on a figure of $150,000, the FBI said.

According to sources familiar with the investigation, inside bidding information from a firm like Computer Sciences could have enabled another company to win the bid and, in the process, learn valuable industrial secrets about another firm's methods.

William R. Hoover, chief executive of the firm, refused to comment on last night's arrests.

A spokesman for National Semiconductor, a major computer supplier, said he had no knowledge of the case and was not familiar with any possible connection between his firm and Computer Sciences.