I am looking for some way using discrete logic (TTL) to decrement an 8-bit value by one.
Basically I want to present it with an 8 bit bus with a binary number on it, and have it give an output of the input minus one on its output:
eg:
...I3 I2 I1 I0 | ...Q3 Q2 Q1 Q0
0 0 0 0 | 1 1 1 1
0 0 0 1 | 0 0 0 0
0 0 1 0 | 0 0 0 1
0 0 1 1 | 0 0 1 0
....
1 1 1 1 | 1 1 1 0
I have been googling and drawn a blank for a chip that can do it, and I have been racking my brains of the best way to do it using just normal gates.
Does anyone either know of a chip for this, or have some ideas on how I could construct it from discrete gates?
Best Answer
Have you considered adders? You can subtract with an adder.
You just need to add -1 to the input value. A pair of 7483 4-bit full adders should handle your 8-bit input. Apply the input X to the 'A' inputs, and apply the binary representation of -1 to the 'B' inputs. Fortunately, the 2's complement representation of -1 is all ones; this means that if you just tie the 'B' inputs all high, you're done. What comes out should be X-1.