Free BDD based Computer-aided Design of Compact Memristor Crossbars for in-Memory Computing