Practical approach to programmable analog circuits with memristors