Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

binary reversal program

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-8051 code here
View previous topic :: View next topic  
Author Message
sclark24

Bascom Member



Joined: 19 Feb 2007
Posts: 10

uk.gif
PostPosted: Mon Feb 19, 2007 2:45 pm    Post subject: binary reversal program Reply with quote

Hello,
Im trying to write a program for doing a Fast Fourier Transform and at the start I have to do a binary reversal. This means for example, if Im doing an 8 point FFT I will be working with the a three bit binary number, 000, 001, 010 and I need to reverse these values. For instance I want to take an integer value say 3 and change it to a binary value, 011, then reverse this so it would be 110 and change this back to an integer value, which is 5.
I cant get the rotate or shift options to handle the binary in this way, as its the reversal is actually changing the least significant bit into the most significant, then the second least significant bit into the second most significant bit and so on, for example if Im doing a 16 point FFT i will be wrking with binary 4 bit binary values, eg. change 3 to 0011 then reverse to 1100 and change to 12.
this is for my final year project and any help would be more than appreciated. Thanks
scott
Back to top
View user's profile
lpa

Bascom Member



Joined: 12 Dec 2006
Posts: 27
Location: Oreokastro, Greece

greece.gif
PostPosted: Tue Feb 20, 2007 10:57 am    Post subject: Reply with quote

The easiest way is to use an array where you 'll store the reversed values.
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-8051 code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum