ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

How the bitwise math tools work

Available with Spatial Analyst license.

    On a cell-by-cell basis, the bitwise tools evaluate the binary representation of the input values. For each bit in the binary representation, a Boolean operation is performed.

    The logic for how the various bitwise tools operate is illustrated in the following sections. The arrows are used to indicate the flow of operation of how input values are converted to a base2 binary representation, analysed, and returned as a decimal (base10) value.

    Bitwise And, Or and XOr

    • For Bitwise And, for each bit where both inputs are 1, the output is 1. If one or both bits are 0, the output is 0 for the bit.
    • For Bitwise Or, for each bit where one or both inputs are 1, the output is 1. If both bits are 0, the output is 0 for the bit.
    • For Bitwise XOr, for each bit where one input is 1 and the other 0, the output is 1. If both bits are 1 or both are 0, the output is 0 for the bit.

    Bitwise And, Or and XOr example
    Bitwise And, Or and XOr example

    Bitwise Not

    For Bitwise Not, the bitwise complement of the binary representation of an input value is determined.

    This means that for each input bit that is 1, the output is 0. Input bits that are 0 will be output as 1.

    Bitwise Not example
    Bitwise Not example

    Bitwise Left Shift and Bitwise Right Shift

    The arrows in the following illustration demonstrate that the input values are first converted to their binary representation, then the bitwise logic is applied to each pair of bits that represent those values, then the values are finally converted back to a decimal representation.

    • For Bitwise Left Shift, the value for each bit is shifted to the left by the number of bit positions specified in the second input. The value that is assigned to the farthest left bit is lost.

      The effect of a left shift by one bit position is a multiplication by two.

    • For Bitwise Right Shift, the value for each bit is shifted to the right by the number of bit positions specified in the second input. The value that is assigned to the farthest right bit is lost.

      The effect of a right shift by one bit position is a division by two with truncation.

    Bitwise Left and Right Shift example
    Bitwise Left and Right Shift example

    Note:

    If any of the input cell values is NoData, the output value will be NoData.

    Related Topics

    • An overview of the Bitwise Math toolset
    • Bitwise And
    • Bitwise Left Shift
    • Bitwise Not
    • Bitwise Or
    • Bitwise Right Shift
    • Bitwise XOr
    Feedback on this topic?

    ArcGIS for Desktop

    • Home
    • Documentation
    • Pricing
    • Support

    ArcGIS Platform

    • ArcGIS Online
    • ArcGIS for Desktop
    • ArcGIS for Server
    • ArcGIS for Developers
    • ArcGIS Solutions
    • ArcGIS Marketplace

    About Esri

    • About Us
    • Careers
    • Insiders Blog
    • User Conference
    • Developer Summit
    Esri
    © Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal