Stack and binary conversion implementation