A Binary Counter Based on Stacking and Sorting