Bitwise operations – Casio 330 User Manual

Page 160

Advertising
background image

20060301

Bitwise Operations

The logical operators listed below can be used in calculations.

Operator

Description

and

Returns the result of a bitwise product.

or

Returns the result of a bitwise sum.

xor

Returns the result of a bitwise exclusive logical sum.

not

Returns the result of a complement (bitwise inversion).

Examples 1, 2, and 3 use Bin (binary) as the number system. Example 4 uses Hex
(hexadecimal).

Example 1: 1010

2

and 1100

2

= 1000

2

@?@?N?LBN@@??U

Example 2: 1011

2

or 11010

2

= 11011

2

@?@@NMPN@@?@?U

Example 3: 1010

2

xor 1100

2

= 110

2

@?@?NVMPN@@??U

Example 4: not (FFFF

16

) = FFFF0000

16

LMRDDDDU

Using the baseConvert Function (Number System Transform)

The baseConvert function lets you convert a number in one base (number system) to its
equivalent in another base.

Important!

• The baseConvert function works for positive integers only.

• The baseConvert function cannot be used in a line for which a particular number base is

specified. It can be used in a normal calculation line only.

Syntax: baseConvert (Number, Current base, Expected base)

• Number must be a positive integer consisting of digits 0 to 9 and/or A to F.

• The current base and expected base can be any whole number from 2 to 16.

Examples:

2-7-5

Specifying a Number Base

Advertising