Bitwise AND


Closed Thread
Results 1 to 2 of 2

Thread: Bitwise AND

  1. #1
    paul.mcallister's Avatar
    paul.mcallister Guest

    Question Bitwise AND

    Hi all,

    Could some one explain the difference between a bitwise AND "$" compared to a conventional AND.

    Thanks, Paul

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    $ mean that you'll test hexadecimal value

    $0f = decimal 15 = 00001111 binary

    binary %
    Hexadecimal $

    Conventional 'AND' is use for condition statements like IF

    IF (PORTB=$FF) AND (PORTA.1=1) then


    Bitwise AND '&' is to process logical stuff

    Let's say PORTB= $F3

    Myvar = PORTB & $0F

    Result of MyVar will be $03
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Logical vs Bitwise ==
    By Archangel in forum General
    Replies: 7
    Last Post: - 19th February 2010, 06:22
  2. Bitwise operations and masks: basics, help?
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 19th April 2008, 00:24
  3. Bitwise Operators
    By SterlingY in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th March 2007, 05:57
  4. Bitwise not working
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 19th October 2006, 07:31
  5. Bitwise Operations
    By rossfree in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th November 2004, 13:58

Members who have read this thread : 2

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