Working with raw binary digits.

Jorge Godoy godoy at metalab.unc.edu
Thu Feb 27 19:32:55 CET 2003


Steven Taschuk <staschuk at telusplanet.net> writes:

> 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.

This is what I've been doing for a while. I was just checking if there
was some different way to do that. 

I'm using bit strings and manipulating them to have the shift left and
shift right operations as well (these will be done with some
registers...).  

> If you want to simulate hardware, that might be a different story.

I'm not willing to do that. I'm simulating some algorithms that will
be implemented in hardware later.

> Am I missing something?

I guess I was. :-) I was thinking if there was any module that had a
bit/byte datatype and some common operations defined. 


-- 
Godoy.     <godoy at metalab.unc.edu>




More information about the Python-list mailing list