Efficient organization of digital periphery to support integer datatype for memristor-based cim