ED does not necessarily affect sperm production.  ED is a condition that primarily affects the ability to achieve or maintain an erection. In comparison, sperm is produced in the testes.