SAN JOSE, Calif. (AP) _ Hewlett-Packard Co., expanding its already broad product line, said Thursday it is buying Convex Computer Corp., a Texas maker of supercomputers, for about $150 million in stock.

The deal, in which Convex will become a subsidiary of Hewlett-Packard, is a natural outgrowth of the companies' 3-year-old alliance in which Convex adopted HP's chip technology, executives said.

``We view this as a very synergistic merger of people, products and technologies,'' said Willem P. Roelandts, general manager of HP's computer division.

Convex, which has suffered from losses and falling revenues, will gain from HP's financial stability, greater marketing power and continued technological development, said Robert J. Paluck, Convex's co-founder, chairman and chief executive officer.

``It was very, very clear this was the best way to improve shareholder value, no doubt, for the long term,'' he said. ``The No. 1 limiting factor that we've been having from a sales standpoint has been fear, uncertainty and doubt about our future, and this totally takes care of that.''

Under the agreement, Convex shares will be exchanged for HP shares valued at $4.83. The companies put the value of about $150 million, which does not include the 5 percent stake HP already has in Convex.

The deal was announced after financial market closed. HP's stock closed at $83.25, down 62 1/2 cents, on the New York Stock Exchange while Convex rose 40 cents to $5.62 1/2 cents.

Roelandts said it was too early to tell what changes might take place at Convex once it becomes HP's Convex Technology Center or if any of Convex's 850 employees would lose their jobs. HP has 99,900 employees.

But he and Paluck said the companies should fit together well and knew of no overlap.

``The announcement makes too much sense for it not to happen,'' said Robert G. Herwick, president of Herwick Capital Management in San Francisco. ``It was inevitable because of Convex's dependence on HP.''

Hewlett-Packard, based in Palo Alto, Calif., is one of the nation's biggest makers of computers, ranging from notebook and desktop models to powerful machines for many users. It also is a leading maker of computer printers and test and measurement equipment.

Convex, based in Richardson, Texas, produces supercomputers, high-end machines designed to carry out complex calculations very quickly. They are typically used for scientific research and for such tasks as predicting weather or making economic forecasts.

But demand for such big machines has fallen in recent years with the rise of workstations, powerful desktop machines linked in networks. Convex lost $61 million on sales of $144 million in fiscal 1994 while HP, earned $1.6 billion on sales of $25 billion.

In 1992 Convex HP bought 5 percent of Convex, which adopted HP's speedy microprocessors, which the smaller company used in computer systems based on HP workstations and Convex software. HP last year began selling Convex systems.

Paluck said his company needed cash and had to consider how it was going to compete over the long term.

``In order to increase our competitiveness ... it takes a closer and closer interaction with HP, and being two companies makes it difficult to be agile,'' he said.