By using tri-state logic, the matrix can theoretically be expanded to any size, as long as pins are available. For "n" pins, "n"("n" − 1) LEDs can be in the matrix. Any LED can be lit by applying 5 V and 0 V to its corresponding pins and setting all of the other pins connected to the matrix to input mode. Under the same constraints as discussed above up to "n" − 1 LEDs sharing a common positive or negative path can be lit in parallel.