473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

bits

incoming data is 12 bit.
ps = (char *)(data).
how ps can pass 12 bit data?.
let's say Acq takes only 8 bit ps.
Acq(ps);
jeff


--
Sent by jeffkqst from yahoo subdomain of com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new
Jul 19 '05 #1
3 2375
je******@yahoo.com wrote:
incoming data is 12 bit.
ps = (char *)(data).
how ps can pass 12 bit data?.
let's say Acq takes only 8 bit ps.
Acq(ps);
jeff


This message is very difficult to make heads or tails of. Please
provide more information. It might also help to use complete sentances
rather than segments that may make sense to you but are gibberish to
others. Right now I have no idea what you are trying to do and so
cannot help in any way.

NR

Jul 19 '05 #2

"je******@yahoo.com" <u1********@spawnkill.ip-mobilphone.net> wrote in
message news:l.*********************@host-66-81-69-117.rev.o1.com...
incoming data is 12 bit.
ps = (char *)(data).
how ps can pass 12 bit data?.
let's say Acq takes only 8 bit ps.
Acq(ps);
jeff


What do you mean that "incoming data is 12 bit"? What data type is that?
How are you getting this "incoming data"? We can't know how to convert the
data unless we can see both data types you're dealing with. But if you've
got 12 bits and want to use only 8 of them, you're going to lose 4 bits of
information. But I don't even have a 12-bit data type on my machine, nor
any way to pass such information, either via hardware or software. The only
way I know of to do that is to use 16-bit data and ignore 4 bits of it.
-Howard
Jul 19 '05 #3
u1********@spawnkill.ip-mobilphone.net (je******@yahoo.com) wrote in message news:<l.*********************@host-66-81-69-117.rev.o1.com>...
incoming data is 12 bit.
ps = (char *)(data).
how ps can pass 12 bit data?.
let's say Acq takes only 8 bit ps.
Acq(ps);
jeff


char* in C and C++ has at least three meanings. It can be a pointer
to a single char (often 8 bits, but check macro CHAR_BIT to be sure),
a pointer to an array of chars whose size is stored separately or
known a priori, or it can be a pointer to a zero-terminated array
(i.e. all chars up to the first (char)0 0.

In your case, you know ps points to 12 bits. My guess would be that
either the bits are packed, in which case you have 2 bytes *(ps) and
*(ps+1), or unpacked when you have 12 bytes *(ps) till *(ps+11).

i.e. your case is the second of three, "array, size known a priori"

Regards,
--
Michiel Salters
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Ben | last post by:
Hi, I need to write some data types into an array of unsigned chars. These are basically "signals" within a message, so each signal will have a start bit and a length. The signals will also...
40
by: aku | last post by:
I'm looking for the absolute fastest way to count the nr of bits that are set to "1" in a string. Presumably I then first need the fastest way to do this in a byte. I think this is it, but...
7
by: sathyashrayan | last post by:
Group, Following function will check weather a bit is set in the given variouble x. int bit_count(long x) { int n = 0; /* ** The loop will execute once for each bit of x set,
6
by: barcaroller | last post by:
I couldn't find a message-digest newsgroup, so I posted here. I have a C function that converts a string of arbitrary length to a 32-bit hash value. I realize this is overkill but I used...
5
by: Oyvind Eriksen | last post by:
Hello. I need to read bits from bytes in a file. I have code that works but it's very slow. Can anybody help me? The code I have is: private bool GetBit(byte b, int pos) { return ((b &...
15
by: steve yee | last post by:
i want to detect if the compile is 32 bits or 64 bits in the source code itself. so different code are compiled respectively. how to do this?
11
by: Mack | last post by:
Hi all, I want to write a program to count number of bits set in a number. The condition is we should not loop through each bit to find whether its set or not. Thanks in advance, -Mukesh
77
by: borophyll | last post by:
As I read it, C99 states that a byte is an: "addressable unit of data storage large enough to hold any member of the basic character set of the execution environment" (3.6) and that a byte...
11
by: JoeC | last post by:
I am working on a graphics program but my question has nothing to do with graphics but trying to get an algorithm to work. I set graphics from a 16x16 grid to bits of a graphic with: bitData =...
11
by: spasmous | last post by:
Just wondering.
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.