We propose a generalization of the cellular automaton model introduced recently by Lai, Jia and Chan [Phys. Rev. Lett. 79 (1997) 4994] for simulating friction induced segregation in a rotating drum. We use our model to investigate geometrical properties of mixing and segregation. Simulations of the model reproduce recent experimental results on mixing efficiency and spontaneous stratification. We also make two predictions – for the dependence of the mixing rate on the speed of rotation and for the stratification of granular system in the drum which is less than half filled.