CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

a math problem?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lanyong



Joined: 14 Jan 2004
Posts: 9
Location: Xiamen,Fujian Province, China

View user's profile Send private message Send e-mail ICQ Number

a math problem?
PostPosted: Thu Dec 27, 2007 11:39 pm     Reply with quote

8bit data:
L[8]={L0,L1,L2,,, L7}

how to get

H[8]={H0,H1,H2,,,H7}

more fast?


bit:
L0.7 L0.6 L0.5 L0.4 L0.3 L0.2 L0.1 L0.0
L1.7 L1.6 L1.5 L1.4 L1.3 L1.2 L1.1 L1.0
L2.7 L2.6 L2.5 L2.4 L2.3 L2.2 L2.1 L2.0

,
,
,
L7.7 L7.6 L7.5 L7.4 L7.3 L7.2 L7.1 L7.0



H & L:
H0:L7.0,,,L2.0,L1.0 L0.0
H1:L7.1,,,L2.1,L1.1 L0.1



thanks.


use pic18 or pic24 or dsPIC is ok.
_________________
Lan Yong
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Dec 27, 2007 11:53 pm     Reply with quote

Are you asking how to copy an array ?

http://www.ccsinfo.com/forum/viewtopic.php?t=29519&highlight=copy+array
lanyong



Joined: 14 Jan 2004
Posts: 9
Location: Xiamen,Fujian Province, China

View user's profile Send private message Send e-mail ICQ Number

PostPosted: Fri Dec 28, 2007 12:29 am     Reply with quote

PCM programmer wrote:
Are you asking how to copy an array ?

http://www.ccsinfo.com/forum/viewtopic.php?t=29519&highlight=copy+array


no change array L to array H.

a math change

such as:

H0=L0;
H0|=(L1<<1)&0x02;
H0|=(L2<<2)&0x04;
H0|=(L3<<3)&0x08;
H0|=(L4<<4)&0x10;
H0|=(L5<<5)&0x20;
H0|=(L6<<6)&0x40;
H0|=(L7<<7)&0x80;


i want find a fast way to get array H.
_________________
Lan Yong
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group