I have a table of inputs that needs to output a unique formatted byte. The bytes outputted from the algorithm need to have only 1 bit on, giving 8 unique outputs. The inputs do not have to correlate with a specific output as long as each input has a unique output. The following is a list of all possible inputs and outputs.
Inputs: -00001000 -00001001 -00000001 -00000101 -00000100 -00000110 -00000010 -00001010
Outputs: -10000000 -01000000 -00100000 -00010000 -00001000 -00000100 -00000010 -00000001
I would like to know if there is a logical algorithm which is designed to do this. I'm currently using a lookup table for this which is not very optimized. I have access to all the operations used in 6502 assembly.
I've given my lookup table code as one possible solution in an answer, but I'm looking for something better if it exists.