Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
Bits[Settings] - set parameters for operations in the Bits package
Calling Sequence
Settings(options)
Parameters
options
-
optional equations (set) or names (display)
Description
The Settings command is provided to control the settings used for operations in the Bits package. The following options are available:
defaultbits = integer: Specifies the number of bits to use for an operation when bits is not explicitly specified for the input. This is useful for emulation of machine logic operations, where one could set defaultbits to 32 or 64. Currently a bits setting is required for all negative numbers, the negated logic operations Not and Nand, and the operations Split and String.
If no bit count is specified, commands that require a bit count use the most significant bit in all inputs by default.
negative = keyword: where keyword is twoscomplement (the default), none or ignore. When set to twoscomplement, all negative numbers are treated in twoscomplement form. When set to none, negative inputs produce an error. When set to ignore, negative inputs are treated simply as though the positive input was provided (signs are ignored).
negativeout = true/false: By default this is false, and when set to true it specifies that negative outputs are desired. For this to be allowed, the bits for the operation must be set and negative must be set to twoscomplement (as otherwise there is no way to represent a negative output).
Note that the negative and negativeout options do not apply to the output of Split or the input of Join, both of which use sequences of positive numbers only.
all: This is a query-only option, and can be used to query all current settings.
Examples
By default, this operates on 0 bits, as the input number has 0 bits
Setting the default tells how many bits to use
Default is overridden by bits specification
Negative input
Also with negative output
See Also
Bits, Nand, Nor, Not, Split, String
Download Help Document