Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-cnmwb Total loading time: 0 Render date: 2024-07-23T22:20:35.388Z Has data issue: false hasContentIssue false

Appendix A - An implication relation for the integers in the programming language BASIC

Published online by Cambridge University Press:  05 May 2010

Get access

Summary

The discovery of the following underlying implication relation is due to D. T. Langendoen (private communication).

BASIC implication

In the BASIC programming language available on IBM personal computers (BASIC Compiler 2.00, Fundamentals, Boca Raton, Florida, 1985) there are many numeric functions called “logical operators.” These functions are defined over a finite set of integers that are encoded in binary notation as strings of sixteen bits of 0's and 1's. The first bit is 0 if the integer is positive, and 1 if negative. That leaves fifteen bits for encoding, so that the range of these functions consists of all the integers from −32768 to +32767 (−215 to +215). The representing string for any integer in this range, therefore, consists of an initial 0 or 1 according as it is positive or negative, and a tail end that depends on the binary representation of the integer. If the integer is positive, then the tail end consists of its binary representation; if the integer is negative, then the tail end is determined as follows: If the negative integer is −m, and the binary encoding of m has n digits, then calculate what integer together with −2(n−1) would sum to −m, and let its binary representation be at the tail end on the sixteen-bit string. Thus, 3, being positive, would be represented as 0000000000000011, the initial bit representing the positive character, and the tail end (11) being the binary representation of 3.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 1992

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×