Saw this Binary Marble Adding Machine on the Nuts and Volts site I posted about recently. I've watched the video several times now and am fascinated by the mechanical action.
Fun to show in a math class or a programming class. The author had this to say about how he designed the rockers.
"Also tricky was getting the rockers to consistently work. I spent a lot of time figuring out what dimensions to make them so that they would correctly work, even if two marbles arrive onto the rocker right on top of each other. I knew it was physically possible to build such a rocker, because the lego rockers I built into the original Lego marble machine had this property by a fluke. The trick turned out to be to make peak of the rocker, which divides the marbles, short enough, and the rocker shallow enough. That way, if a marble arrives before the rocker has had a chance to flip, the previous marble, which is still on the rocker, will deflect the next marble onto the other side, even if the rocker has not yet flipped. "The web page has lots of closeup photos and design explanations.
[Image captured from http://woodgears.ca/marbleadd/]