130-28029 Parallax Inc, 130-28029 Datasheet - Page 93
130-28029
Manufacturer Part Number
130-28029
Description
KIT PARTS SMART SENSORS
Manufacturer
Parallax Inc
Datasheet
1.122-28029.pdf
(340 pages)
Specifications of 130-28029
Accessory Type
Education Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
- Current page: 93 of 340
- Download datasheet (5Mb)
The pattern emerges when you can see an unsigned decimal number compared next to its
signed decimal and binary equivalents.
' Smart Sensors and Applications - SignedNumbers.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}
x
x = 32768
DEBUG "you entered decimal: ", DEC x, CR
DEBUG "signed decimal: ", SDEC x, CR
DEBUG "16-bit binary: ", BIN16 x, CR
In PBASIC, only word variables can hold signed numbers, so all signed numbers have 16
bits. By looking at the leftmost bit, Bit 15, we can know whether a signed number is
negative or positive. You can use
value
positive. If it is equal to 1, the number is negative.
This is an important hint, because some PBASIC operators only work with positive
integers, such division "
save the sign of a number, perform the operation with its absolute value, then reapply the
sign afterwards. In fact, we will be doing that later in Chapter 4.
VAR
√
√
is a positive or negative number. If
Figure 3-12: Two’s Complement Signed Decimal Number Line
-32768...............-1...0...1...............32767
Try running SignedNumbers.bs2 with different values for
becomes clear to you. Try these
Then try 65535, 65534, 32767, 32768, and 32769. Do you see how it works?
Word
|
|
|
1000000000000000 (DEC 32768)
'<<< Enter new values for x here, and re-run the program
(DEC 1)0000000000000001
/
" and modulus "
(DEC 32767)0111111111111111
value.BIT15
|
1111111111111111(DEC 65535)
x
//
Chapter 3: Tilt with the Memsic Accelerometer · Page 81
values: 0, 1, 2, -1, -2.
". When using these operators, it is handy to
value.BIT15
|
as a variable that tells you whether
is equal to 0, the number is
x
until the pattern
|
|
|
Related parts for 130-28029
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
KIT PROPELLER EDU PROJECT PARTS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
KIT PARTS PROCESS CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: