music |
OSdata.com |
Boolean NOT
summary
This subchapter looks at Boolean NOT.
free computer programming text book projecttable of contents
|
music |
OSdata.com |
This subchapter looks at Boolean NOT.
free computer programming text book projecttable of contents
|
This subchapter is a stub section. It will be filled in with instructional material later. For now it serves the purpose of a place holder for the order of instruction.
Professors are invited to give feedback on both the proposed contents and the propsed order of this text book. Send commentary to Milo, PO Box 1361, Tustin, California, 92781, USA.
This subchapter looks at Boolean NOT.
Please note the differences between a logical Boolean operation, an integer Boolean operation, and a bit-wise Boolean operation. Note that terminology varies, so you will eventually see references using these terms different than presented here.
In the case of a logical Boolean NOT, a TRUE is changed into a FALSE and a FALSE is changed into a TRUE. Some languages, such as C, do not have a built-in Boolean type. There are several different and incompatible encodings for TRUE and FALSE (see table below).
In the case of an integer Boolean NOT, the result is the integer ones compliment. This works best with -1 and 0 as TURE and FALSE (or vice versa). There are several different and incompatible encodings for TRUE and FALSE (see table below).
some languages | TRUE | FALSE | ||
---|---|---|---|---|
C | 1 | 0 | ||
C | non-zero | zero | ||
negative | zero or positive | |||
-1 | 0 | |||
0 | 1 |
in the case of a bit-wise Boolean NOT, every individual bit is changed (one bits become zero bits and zero bits become one bits).
NOT (also called negation or complement) simply reverses the value of an object, changing true into false and changing false into true.
The truth table for NOT is as follows:
A | result |
---|---|
0 | 1 |
1 | 0 |
The NOT gate (or inverter) in logic circuits looks like:
As in ordinary algebra, in mixed expressions, all ANDs (Boolean multiplication) are performed before ORs (Boolean addition). For example, A+B·C is evaluated by ANDing B with C and then ORing A with the result of the first operation (BC).
Parenthesis can be used to change the ordinary order of evaluation. For example, (A+B)·C is evaluated by ORing A with B and then ANDing C with the result of the first operation (A+B). Parenthesis can be used for clarity.
Negation of a single variable or object is done before using the result in an expression. Negation of an entire expression is done after the expression is evaluated.
Coding example: I am making heavily documented and explained open source code for a method to play music for free almost any song, no subscription fees, no download costs, no advertisements, all completely legal. This is done by building a front-end to YouTube (which checks the copyright permissions for you).
View music player in action: www.musicinpublic.com/.
Create your own copy from the original source code/ (presented for learning programming).
return to table of contents
free downloadable college text book
Because I no longer have the computer and software to make PDFs, the book is available as an HTML file, which you can convert into a PDF.
previous page | next page |
Tweets by @osdata |
free computer programming text book projectBuilding a free downloadable text book on computer programming for university, college, community college, and high school classes in computer programming. If you like the idea of this project, Supporting the entire project: If you have a business or organization that can support the entire cost of this project, please contact Pr Ntr Kmt (my church) free downloadable college text book on computer programming. |
This web site handcrafted on Macintosh computers using Tom Benders Tex-Edit Plus and served using FreeBSD .
UNIX used as a generic term unless specifically used as a trademark (such as in the phrase UNIX certified). UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Ltd.
Names and logos of various OSs are trademarks of their respective owners.
Copyright © 2010 Milo
Created: December 7, 2010
Last Updated: December 7, 2010
return to table of contents
free downloadable college text book
previous page | next page |