When Hewlett-Packard Co. ditched the J. Walter Thompson advertising agency last month, it was looking for more than a new face for its personal computer ads.

What Hewlett-Packard needs is a stronger public personality -- an identity that could help the company stand out in the cutthroat personal computer market and make the company as well known among business executives as it is now among engineers and scientists.

And while it tries to explain to the public what it really is, the Silicon Valley company has also been obliged to ask that same question inside its own walls.

Along with many other major American manufacturers, Hewlett-Packard has been forced to rethink what it is, what it does and how it expects to continue prospering in the far tougher competitive environment that stretches ahead. For Hewlett-Packard, that means it must begin to define and sell its products with as much precision as it has mustered in inventing and building them.

To change its public identity, Hewlett-Packard has turned to the Leo Burnett Co., the Chicago-based agency that created the Marlboro man, the crystal-shattering Memorex cassette tape ads, the Keebler elves and Maytag's lonely repairman.

Hewlett-Packard wants an image equally strong for itself, says William J. Murphy, HP's Personal Computer Group marketing manager.

"We're trying to develop more of a franchise for Hewlett-Packard as a computer company -- something we can build on," Murphy said in an interview. "They Burnett seem to specialize in a message about a company's product line that you can keep banging away at." If Hewlett-Packard likes the results, it may hire Burnett to design a campaign to deliver the message, said Murphy.

The company had no problems with J. Walter Thompson's scheme for introducing the Hewlett-Packard personal computer. Those ads featured a butterfly alighting on the computer's distinctive "touchscreen," showing how a customer can run the computer by pointing at symbols and words on the screen, rather than entering commands on a keyboard.

"We got off to a good start last fall," said Murphy. But now, he added, there is an urgent need for a more meat-and-potatoes message about what the HP computers can do, both the desk-top versions and the newer portable, a lap-size model with a thin, flip-top screen.

And more fundamentally, Hewlett-Packard is looking for a way to say something basic about the company, its scientific and technical strengths and its ability to survive in the computer wars, said Murphy. "We need help in pushing Hewlett-Packard as a personal computer company that is in it for the long haul," said Murphy.

With smaller computer companies dropping in their tracks or cutting back operations drastically, customers are worried about staying power and that has to be addressed, he said.

The hard focus on the company's new, but growing line of computers recognizes that these are very special products that cast a long shadow over the entire company. In his book, "The Coming Computer Industry Shakeout," industry analyst Stephen T. McClellen says Hewlett-Packard is pinning its hopes for future growth on personal computers.

He quotes HP Executive Vice President Paul C. Ely Jr. as saying that the personal computer market is "a necessity, not just an incremental opportunity."

The personal computer is becoming the basic data processing workstation in offices and factories, used alone for word processing or accounting, or linked to a central computer's data files and programs. Hewlett-Packard has to secure a strong position to maintain its growth, said Murphy.

But it has a steep climb ahead. A survey of corporate computer users by Datamation and Cowen & Co. this summer, asking which products they intend to buy in the next 18 months, showed IBM far out in front with a 55 percent preference, followed by Apple Computer Co. at 8 percent, Digital Equipment Corp. at 7, and Hewlett-Packard fourth with 5 percent.

(Hewlett-Packard says it is third in retail personal computer sales, an achievement it celebrated recently by mailing pecan pies and pie charts of market shares to the media.)

It has the resources -- in its 1983 fiscal year, it sold $4.7 billion worth of computers, computer printers and other peripheral devices, calculators, electronic components and various scientific instruments.

But HP concluded the old structures for making decisions and doing business within the company were no longer adequate. "In recent months, we've been taking a long look at the HP organization," president John Young told employes in a newsletter this summer. "Our goal has been to answer a fundamental question . . . Is there a better way to organize ourselves to ensure that our focus is on the customer and understanding, supplying and supporting needed solutions?"

The answer was yes, Hewlett-Packard concluded. The result is a basic change in the company's organization, abolishing the old alignment by product groups in favor of a new makeup intended to strengthen the exchange of technology throughout the company and to centralize sales of all computers and instruments in a powerful new marketing group.

"Our goal is to serve our customers as a single company and to avoid many of the coupling problems inherent in being organized along product lines," said Young. In the past, Hewlett-Packard's products were typically based on what the engineers could deliver, says one close observer of the company. Now HP has to pay at least as much attention to what would-be customers want.