By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

How to input ands save data in register of 16 bit

eng elaph
P: 2
how to write a C++ or C code for inputing a data in registor of 16 bit then make a bitwise operations on some bits then shift and input the output of these operations to the register after shifting the data and save the output of that shifted bit in a file
sorry for bad english
thanx for help in advance
eng. elaph al_abasy
Dec 19 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 2,396
Is this a real register that exists in real hardware, or is it a demonstration program? With a real register you have to worry about endianness (that is, the logical organization of bits in a C variable is not necessarily the same as the physical arrangement of bits in a register).

Some real registers are write-only. That is, you cannot simply read the register to see how the bits are currently set. Do you know if that is the case for you?

You will need to use the "bit-wise operators": bit-or (|), bit-and (&), bit-not (~), and bit-exclusive-or (^). Look these up in your C reference or google them.
Dec 19 '10 #2

eng elaph
P: 2
thank you for your response but i want to built a PN generator to generate a pesdue noide and save the data in anthor file to use them later
Dec 19 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.