My father was a great believer in having as many parts assortments on hand as possible. Having an assortment of nuts/o-rings/washers/bolts/spade lugs/wire/screws/rivets/string/glue/nails/tape/hose/woodscrap/metalscrap on hand saved us many hours and many trips to the hardware store. It allows you to be creative and build off-the-cuff, and shortens your idea-design-build-test cycle considerably.
I have inherited this SPAD (small parts acquisition disease) and so I tend to frequent various surplus stores. A few days ago I struck gold at my local college surplus. A 45 drawer cabinet filled with hundreds 74xx series logic in dip packages! Needless to say I could barley contain my excitement until I got home and could look up what all I had.
Most of the parts were familiar to me; flip-flops, SRAMs, logic gates, PALs. Then I came across SN74ALS679 which I had never seen before. This part is the SN74ALS679 12-Bit Address Comparator.
This is a chip that monitors 12 input lines and when a specific binary number is set, it toggles its output low. This target number is hard-coded with only four pins, which is the part that caught my interest. How do you spec a 12bit address match using only 4 bits? The trick is the order in wich the 12 address input pins are connected. The four bits specify the number of pins that are high(Nhigh) and the number that are low (Nlow). You then connect the address bus so that the low bits are connected to pins 1..N low and the high pins are connected to N high ..12.
We can use this chip and 3 hex dip switches to make an electronic combniation lock. Lets set the combo to “FAB”. If you convert F,A,B to binary and then count the 1s you get 9 1s and three zeros. Therefore we set the P pins to look for 9 high bits and then hook all the one address lines to A1-A9 and connect the zero address lines to A10-A12.
Here is a gif of the lock in action (Combo Set To “FAD”):