Williams, appearing on CBS' "Late Show with David Letterman" scheduled to air Wednesday, was referring to Letterman's quintuple bypass heart surgery in 2000.
It was the 57-year-old actor's first interview since surgery that replaced an aortic valve.
He joked that "I have one new valve and a repaired valve. I have a cow valve, which is great, and the grazing's been fun."
Williams said he noticed something was wrong with his heart when he was getting short of breath, "code for heart problem."
Williams stars in the film "Night at the Museum 2: Battle of the Smithsonian," which opens May 22.
Slideshow archive | Local events | Contests