Compact Model for the Major and Minor Hysteretic I–V Loops in Nonlinear Memristive Devices