Bitwise not working


Results 1 to 15 of 15

Threaded View

  1. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Hi Ioannis,

    Here I made it clear to see.
    But, as you said, it should not provide 0000.

    Code:
    Ignore high nibble on Portb. PORTB is just an example here.
    .
    .
    i=240 to 250	11110000	11110001	11110010	11110011	11110100	11110101	11110110	11110111	11111000	11111001	11111010
    PORTB (example)	11110000	11110001	11110011	11110111	11111111	11111110	11111100	11111000	11111010	11110101	11111101
    Temp=PORTB	11110000	11110001	11110011	11110111	11111111	11111110	11111100	11111000	11111010	11110101	11111101
    PORTB=Temp & i	11110000	11110001	11110010	11110011	11110100	11110100	11110100	11110000	11111000	11110001	11111000
    
    
    
    
    .
    .
    .

    Note:
    The & (bitwise AND) operator compares each bit of its first operand to the corresponding bit of the second operand. If both bits are 1's, the corresponding bit of the result is set to 1. Otherwise, it sets the corresponding result bit to 0.


    ---------------------------
    Last edited by sayzer; - 18th October 2006 at 12:14.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. 16F877A with 20MHz XTAL not working?
    By ustredna in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th August 2011, 15:04
  2. 2x16 lcd not working with pic16f72
    By vu2iia in forum Schematics
    Replies: 4
    Last Post: - 16th February 2011, 14:59
  3. Blink.Bas on 18f45k20 Newbie seeks working example.
    By DiscoEd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th December 2009, 03:36
  4. Pic 16 F628A not working
    By turkuaz in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th March 2009, 12:26
  5. Hserin not working...
    By robert0 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd August 2005, 12:25

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts