Need Some Bit Twiddling Help on File Post Processing

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2008
Posts: 25
Reputation: Niner710 is an unknown quantity at this point 
Solved Threads: 0
Niner710 Niner710 is offline Offline
Light Poster

Need Some Bit Twiddling Help on File Post Processing

 
0
  #1
Jun 20th, 2009
Hi,

I am struggling with the best way to twiddle a large number of bits.

What I have is a large amount of binary files(~100) in my directory that I need to do post processing on. I want to compare all the bytes in each file and see when the bytes have changed and then assign it a value.

For example,
  1. File 1:byte[0] = 0000 0110
  2. File 2:byte[0] = 0000 0010

I see that bit 2 for byte 0 of File 2 flipped bits changed from a 1->0. When this happens I want to note that byte0, bit 2 is assigned the value of File 2. I want to do this for every single byte in all the binary files.

Basically, what I am doing is a current schmoo. So File 1 is the binary dump being read at a specific current, and File 2 is another current and so forth. I want to see when the bits flip to determine what current the bits are at. So if I see a bit flip from 1->0 on File 56 then I know that the bit has a current of the File 56 value.

I was thinking of doing an XOR with the bytes but I thought I heard something about XOR operation being slow, so I was trying to think of some bit shifting technique. I am dealing with a lot of files so I want to find some technique that will process the data quickly. Can anyone help? Thanks!!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 328 | Replies: 0
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC