Working with raw binary digits.
staschuk at telusplanet.net
Thu Feb 27 19:18:01 CET 2003
Quoth Jorge Godoy:
> Are there modules to work with raw binary digits? I don't want to work
> with hexadecimal digits, but with binary digits. My intention is
> simulating some algorithms before implementing it using the necessary
> gates (AND, OR, NAND, NOR, etc. ICs).
If you want to use individual bits, just use 0 and 1, and the
logical operators 'and', 'or', and 'not'. Roll your own nand,
nor, etc., in terms of these.
If you want to apply such operators to bit strings, use the
bitwise operators &, | and ~. Roll your own nand, nor, etc., in
terms of these.
If you want to simulate hardware, that might be a different story.
Am I missing something?
Steven Taschuk w_w
staschuk at telusplanet.net ,-= U
More information about the Python-list