more that 40 inputs

hi,
i need something that is the oposite of the sift register. i want to measure if 40 pins are high or low using maximum 4 pins.
the frequency of the sample can be 1Hz or more! its not something that i need time aqurancy, i need just multply inputs!

thanks!

have a look at the centipede shield - Centipede Shield Now Available - News - Arduino Forum -

uses only 2 lines (I2C)

Use shift-in registers vs shift-out registers.
Latch the state of the parallel inputs, then clock the data in.
74HC597