473,387 Members | 1,757 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,387 software developers and data experts.

How to input ands save data in register of 16 bit

eng elaph
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
2 2068
donbock
2,426 Expert 2GB
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
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

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

Similar topics

2
by: Abby | last post by:
Hi all, I need advice on how to concatenate bits value. I have 2 bytes of Hex value: Byte1 = 0x33 --> 00110011 Byte2 = 0x90 --> 10010000 I want 10 bits value which compose of 2 bits(7th...
53
by: Zhiqiang Ye | last post by:
Hi, All I am reading FAQ of this group. I have a question about this: http://www.eskimo.com/~scs/C-faq/q7.31.html It says: " p = malloc(m * n); memset(p, 0, m * n); The zero fill is...
11
by: Steve | last post by:
Hi, i know this is an old question (sorry) but its a different problem, i need to write a binary file as follows 00000011 00000000 00000000 00000101 00000000 11111111
4
by: felixnielsen | last post by:
imagine a hollow cube. every wall can have one of two states: open or closed. This would take 6 bits to represent. Now, i allso neew to know whitch way i entered the room, this could be...
48
by: Frederick Gotham | last post by:
The "toupper" function takes an int as an argument. That's not too irrational given that a character literal is of type "int" in C. (Although why it isn't of type "char" escapes me... ) The...
23
by: Umesh | last post by:
This is a basic thing. Say A=0100 0001 in ASCII which deals with 256 characters(you know better than me!) But we deal with only four characters and 2 bits are enough to encode them. I want to...
89
by: Tubular Technician | last post by:
Hello, World! Reading this group for some time I came to the conclusion that people here are split into several fractions regarding size_t, including, but not limited to, * size_t is the...
6
by: John Messenger | last post by:
I notice that the C standard allows padding bits in both unsigned and signed integer types. Does anyone know of any real-world examples of compilers that use padding bits? -- John
16
by: Dom Fulton | last post by:
Has anyone got a mechanism for finding the number of bits in floats, doubles, and long doubles? I need this to communicate with some hardware. I guess I could try to deduce this from float.h,...
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 =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...

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.