If you are familiar with python here is a simplified version of address computing.
the sdr is basically an ordered list of 1 bits.
See below if all bits from 0 to 6 are 1, then the resulting addresses fill the space from 0 to 20 (21 address pairs)
def address(sdr):
for y in range(1,len(sdr)):
for x in range(y):
yield (sdr[y]*(sdr[y]-1)//2+sdr[x])
[a for a in address([0,1,2,3,4,5,6])]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
To be more clear how bits are paired:
def bit_pairs(sdr):
for y in range(1,len(sdr)):
for x in range(y):
print(sdr[x],sdr[y])
bit_pairs([4,5,6])
In my implementations I need to make sure the SDRs are ordered.