Counter

The Counter is a Logic gate that counts up by increment for each pulse on one input, and down by decrement for each pulse on the other. Right clicking the Counter opens a GUI to allow the maximum count, increment, and decrement to be set. Each output is on when the pointer reaches the end of range in that direction.

Uses
The Counter could possibly be used to keep track of people who enter and exit an area. Have the counter go up each time someone goes in, and go down everytime someone exits. That way, if it's negative, someone broke in, and if it's positive, someone's still inside.

In a similar manner, it can be combined with redstone pipes to keep track of the amount of items in a chest; the pipe input to the chest is connected to one input of the counter, and the pipe output is connected to the other input. By setting the maximum count to the maximum amount of items you want in the chest, you can use this to prevent items from popping out of the pipes due to a full chest.