EXHIBIT 5.1 PILLSBURY MADISON & SUTRO LLP 2250 Hanover Street Palo Alto, California 94304 May 1, 2000 Cardima, Inc. 47266 Benicia Street Fremont, CA 94538 Re: Registration Statement on Form S-3 Ladies and Gentlemen: We are acting as counsel for Cardima, Inc., a Delaware corporation (the "Company"), in connection with the registration under the Securities Act of 1933, as amended, of 6,066,111 shares of Common Stock, par value $.001 per share (the "Common Stock"), of the Company. In this regard we have participated in the preparation of a Registration Statement on Form S-3 relating to such shares of Common Stock. Such Registration Statement, as amended, is herein referred to as the "Registration Statement." We are of the opinion that 4,899,856 shares of the Common Stock has been duly authorized and issued by the Company and is fully paid and nonassessable. The remaining 1,166,255 shares of the Common Stock have been duly authorized and, when issued by the Company and paid for, will be legally issued, fully paid and nonassessable. We hereby consent to the filing of this opinion as Exhibit 5.1 to the Registration Statement and to the use of our name under the caption "Legal Matters" in the Registration Statement and in the Prospectus included therein. Very truly yours, /s/ Pillsbury Madison & Sutro LLP