本文介绍了基本位操作问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我得到了一个非常基本的问题,我在这里:


假设我有11001 11010位是真的10位。现在我想

地址,所以如果它是零,我会加一个,如果是一个

那么我将加零。人们说这是曼彻斯特的编码。


请注意,左手边只需接受一下每一次

操作。


如何做到这一点,谢谢。

Hi every one,

I got very basic question, here i go:

Say i have 11001 11010 bits which are infact 10 bits. Now i want to
address every bit so if it is zero i would add one and if it is one
then i would be adding zero. Folks say it manchester coding.

Please note that left hand side just accept a single bit for every
operation.

how to do this , thanks.

推荐答案




我会帮忙,而不是为你工作。


unsigned long ManCode(unsigned long const x )

{

unsigned long result = x;


for(unsigned i = 0; i< 10; ++ i)

{

if(!GetBit(x,i))++ result;

}


返回结果;

}


-Tomás



I''ll give a hand, rather than do the work for you.

unsigned long ManCode(unsigned long const x)
{
unsigned long result = x;

for(unsigned i = 0; i < 10; ++i)
{
if ( ! GetBit(x,i) ) ++result;
}

return result;
}

-Tomás





我不太确定你要做什么。你是想尝试1'的

赞美比特流吗?

11001 11010变为00110 00101?简单或与1.


0 | 1 = 1

1 | 1 = 0


或者你想做一些与众不同的事情吗?



I''m not quite sure what you''re trying to do. Are you trying to 1''s
compliment the bit stream?
11001 11010 becomes 00110 00101 ? Simply or the bits with 1.

0 | 1 = 1
1 | 1 = 0

Or are you trying to do something different?



这篇关于基本位操作问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 12:48