Do you need a lesson in binary arithmetic?
Some rules:
For now, the sign bit gets in the way.
I already told you about shifting multiplying and dividing. Sometimes there is a carry bit to deal with.
To clear a bit, you do an x=x and (not 2^n)
To set a bit , you do an x=x or (2^n)
Endian is basically how the processor labels bits or which comes first MSD or LSD (Least significant digit)
I think you have BCD figured out.
There is an operation called "sign extend" which can basically make an 8 bit -1 into a 16 bit -1.
Then there is 2's complement where 16 bits yields -32768 to 32767 and unipolar which is 0-65535, There is also a value+sign which can have two representations for zero.
A port is 8 bits and you really don;t want to read a random bit from every port and make a BCD number out of it. You want to group things together in the right endian order.
==
So, take the output of one of the ULN2003 channels and connect it to the common pin of the BCD switch after removing the connection to ground.
The ULN2003 chip is a bit wierd if you never used one. Just think of it as 7 transistors with an integral base resistor. It does not have to be powered by a +V supply. The COM is just where all of the flyback diodes come together and that pin isn't needed in this application.
So, to read this BCD switch now, you have to SELECT it with a high on the corresponding input,
Your going to have like 5 or 6 diodes commoned at the processor's 4 bit input. The free end of the diode will go to the BCD switch (1,2,4,8).
Then, the common terminal of the BCD switch will go to the output of one of the ULN2003's. So, assuming it;s done intellegently, you;ll have to provide a 10000, 01000, 00100, and a 00010 and 00001 to read each of 5 switches. 00000 is no switch selected.
We can reduce 5 bits to 3 if necessary. And up to 7 switches to 3 bits. (0-7) and 4 bits could address up to 15 switches with some external logic.
That's where your heading,
==
Notes:
DS 2560,
#219
Pressure sensor datasheet: MPX2010DP