
<PAGE>   1
 
   
                                                                     EXHIBIT 5.1
    
 
   
                            HEWLETT-PACKARD COMPANY
    
   
                              3000 HANOVER STREET
    
   
                        PALO ALTO, CALIFORNIA 94304-1181
    
 
   
November 7, 1995
    
 
   
  Re: Registration Statement on Form S-4
    
   
      File No. 33-63643
    
 
   
Ladies and Gentlemen:
    
 
   
     I have examined the Registration Statement on Form S-4 filed by
Hewlett-Packard Company ("HP") with the Securities and Exchange Commission on
October 24, 1995 (Registration No. 33-63643) and Amendment No. 1 thereto to be
filed on or about November 7, 1995 (the "Registration Statement"), in connection
with the registration under the Securities Act of 1933, as amended, of shares of
HP Common Stock, $1.00 par value (the "Shares"). The Shares are to be issued in
connection with the merger (the "Merger") of Gemini Project Corporation, a
Delaware corporation and wholly-owned subsidiary of HP ("Subsidiary"), with and
into Convex Computer Corporation, a Delaware corporation ("Convex"), pursuant to
an Agreement and Plan of Merger dated September 21, 1995 among HP, Subsidiary
and Convex (the "Merger Agreement") described in the Registration Statement and
filed as Annex A thereto. As counsel to HP, I have examined the Merger Agreement
and the proceedings proposed to be taken in connection with the Merger and the
issuance of the Shares.
    
 
   
     Based upon the foregoing, I am of the opinion that, upon completion of the
proceedings being taken or contemplated to be taken prior to the issuance of the
Shares, the Shares when issued pursuant to the terms of the Merger Agreement
will be legally and validly issued, fully paid and nonassessable.
    
 
   
     I hereby consent to the use of this opinion as an exhibit to the
Registration Statement and to the reference to me under the caption "Legal
Matters" therein.
    
 
   
                                          Sincerely,
    
 
   
                                          D. CRAIG NORDLUND
    
 
                                          --------------------------------------
   
                                          D. Craig Nordlund
    
   
                                          Associate General Counsel and
                                          Secretary
    
