Just applying these on numbers is already implemented: In [17]: bin(14) Out[17]: 0b1110
In [18]: bin(14 << 1) Out[18]: 0b11100 In [19]: 14 << 1 Out[19]: 28 It might be useful to define these things symbolically, so that you could say x << y, and it would give you a symbolic result (and stuff like x & 0 would simplify to 0). By the way, except for shifts, you can pretty much just use regular logic and assume that the expression is repeated eight times per byte. Aaron Meurer On Sun, Apr 1, 2012 at 8:45 AM, Nirmit <9nirm...@gmail.com> wrote: > Greetings , > > I had this idea in mind and I thought I'd share it with you . > > I wanted to know the feasibility of integrating support for bitwise > operators ( AND(&),OR(|),NOT(~),shifts(<< and >> ) in symPy . > I guess showing step by step evaluation in case of shifts and rotates > would also be useful, something along this line : http://i.imgur.com/W7UAl.png > . > This is very basic, no-frills program I have implemented. It can be > extended to show output in hex and octal too. > > Also, I guess this feature can be extended to cover most of the x86 > asm instruction set. It would help users to see behind-the-scene > working of each instruction and how each operator affects the value. I > haven't come across any implementation yet and I believe it could be a > good addition to symPy. > > Your feedback is appreciated. > > Regards, > Nirmit Desai > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.