parallel processing - pyParallel python swapping pins -


So I'm very new with parallel ports and I'm studying this code here - & gt; & Gt;

And I'm confused as to what is happening here

  def reveseout (self, x): r = ((x & (1 & lt; ; 0) and 1)  <4) and 1) <4: 3  \ ((And (1 <- lt; 5) and 1)    

I think this pins have to be reverse, but I do not think of syntax myself and it's really saying.
Any help would be greatly appreciated thanks!

1 < N 1 is the transferred n position on the left, so these values ​​give us 0x01, 0x02, 0x04, 0x08, 0x10, etc., bits in a byte. x & amp; (1 X is masked with that bit, so we get individual bits of x. x & amp; (1 & lt; & lt; n) and 1 is difficult: If the bit is set to X, then it will evaluate as the second argument, and this will be 1. If the bit is not set to X, then it will be zero then x & amp; (1 & lt; & lt; n) and 1 1 if the bits are set to X, 0 if not.

(x & (1 & lt; & lt; n) and 1) & lt; & Lt; M takes that zero or one and takes it to the left places, so it basically copies n'th bit and puts it in mth bit for eight lines 0 and 7 , Then 1 and 6, then 2 and 5, etc., so we get eight values. First is the 0th bit at the 7th place, then the 6th place is 1th and so on. Finally, they all or | .

Comments