MELBOURNE — Harris Corp. chairman Joseph Boyd announced Friday that he will relinquish his post as chief executive in April, turning over day-to-day control of the Melbourne high-technology company to president John Hartley.

Boyd, who turns 65 next year, will remain as chairman.

In assuming control of the $2.3 billion computer and communications manufacturer, Hartley will supervise 31,000 employees working at 35 factories in the United States and abroad. More than 12,000 of those workers are in Florida, primarily in Palm Bay and Melbourne.

Hartley, 55, a 30-year veteran of Harris, was elected Harris president in 1978. He formerly headed the company's semiconductor and electronics manufacturing operations. As president last year he was paid $566,481 in salary and additional compensation.

Boyd became chief executive in 1978 after having served for six years as president. He came to Harris from Radiation Inc. in 1967 after the two companies merged, and he is generally credited with making Harris into the company it is today.

As chairman of Florida's largest industrial company, Boyd was paid $861,589 last year in salary and additional compensation.

Hartley takes over at Harris as the company is struggling to fend off foreign competition and remain a leader in the hotly competitive computer industry.

Although sales have risen steadily -- from $490 million in 1976 to $2.3 billion in the fiscal year ended June 30 -- profits have taken a more modest path. In fiscal 1976 Harris earned $25.9 million; in 1981, $105.7 million; and in the year just ended, $80.3 million.

More troubling for the company's shareholders has been the continued drubbing Harris has taken on the New York Stock Exchange. The stock has been trading recently at between $25 and $27 a share, not far from its book value of $21.56. The slump in Harris stock brought a shareholder motion at the company's annual meeting Thursday to liquidate Harris and sell its divisions to the highest bidders. The idea, pushed by Harris shareholder Howard Lipsitz, was defeated overwhelmingly, but it brought a spirited defense of management from Harris director Richard Tullis.

''I do not believe he seriously wishes the company be broken off and sold in parts,'' Tullis said. ''We cannot, however, stand by and disregard the realities of what's happening in the financial world today.''

Both Boyd and Hartley offered little hope that earnings would improve dramatically at Harris in the near future.

''Earnings for the year are going to be somewhat below last year,'' Boyd said. ''But we have to believe we are reaching somewhat of a bottom in this thing.''

Hartley said Harris management is examining its entire product line to see whether it needs to withdraw from markets in which it cannot remain competitive. He said Harris likely would continue its new policy of using foreign suppliers for some of its products, a move he said will lead to a reduction in the number of Harris employees working in the United States.

The one note of promise, Hartley said, was in the government-business division, which supplies equipment to the military. That business has been increasing steadily and accounted for more than 50 percent of Harris' profit in the latest fiscal year.