bits

J

jeffkqst

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
 
N

Noah Roberts

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
 
H

Howard

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
 
M

Michiel Salters

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top