How to input ands save data in register of 16 bit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eng elaph
    New Member
    • Dec 2010
    • 2

    How to input ands save data in register of 16 bit

    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
  • donbock
    Recognized Expert Top Contributor
    • Mar 2008
    • 2427

    #2
    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.

    Comment

    • eng elaph
      New Member
      • Dec 2010
      • 2

      #3
      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

      Comment

      Working...