I swore to myself that I would never have to use Boolean Algebra but it seems that my computer science teacher was right. What I'm writing is the windows software componet to control a DAQ/2000 that will control 16 printed circut boards for testing. This project is not going to be written in PB/DLL 6.0 but I think I might write some functions in it like the math functions. What I need help with is bit-masking. It just seems that I can't grasp the idea good enough. right now I have a test circut board that is set up with 48 LEDs and and it has 6 ports on it and each port is 8 bits. Let me explain the problem I'm having:
ok we have 8 leds and each leds is controlled by a boolean value true or false
10001000 <--- led 1 & 5 is on
lets turn led 8 on too so I would do this:
10001000 <--- Last value entered
or <--- or
00000001 <--- new bit to turn on.
10001001 <--- new bit to send to Daq/2000
now this is the problem I having... lets say I want to turn OFF bits 1 and 8, how would I do that?
The other question is I understand the differences between or/xor but when would I want to use one over the other? I am finding that sometimes if I use xor I get the same result?
the main problem that I'm having so fair is that I have this arrangement:
11100000 <---- bits 1 & 2 & 3 are on
11111000 <---- bit 4 & 5 are added
11100000 <---- how would I remove bits 4 & 5 without messing up anything with bits 1-3?
Thanks
------------------
-Greg
ok we have 8 leds and each leds is controlled by a boolean value true or false
10001000 <--- led 1 & 5 is on
lets turn led 8 on too so I would do this:
10001000 <--- Last value entered
or <--- or
00000001 <--- new bit to turn on.
10001001 <--- new bit to send to Daq/2000
now this is the problem I having... lets say I want to turn OFF bits 1 and 8, how would I do that?
The other question is I understand the differences between or/xor but when would I want to use one over the other? I am finding that sometimes if I use xor I get the same result?
the main problem that I'm having so fair is that I have this arrangement:
11100000 <---- bits 1 & 2 & 3 are on
11111000 <---- bit 4 & 5 are added
11100000 <---- how would I remove bits 4 & 5 without messing up anything with bits 1-3?
Thanks
------------------
-Greg
Comment