music

# Boolean NOT

## summary

This subchapter looks at Boolean NOT.

## free computer programming text book project

If you like the idea of this project,

### stub section

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.

# Boolean NOT

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 one’s 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).

somelanguages TRUE FALSE C 1 0 C non-zero zero negative zero orpositive -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

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:

NOT
Aresult
01
10

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.

# free music player coding example

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).

## view text bookHTML file

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 project

Building 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,

send donations to:
Milo
PO Box 1361
Tustin, California 92781

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)

Some or all of the material on this web page appears in the

This web site handcrafted on Macintosh computers using Tom Bender’s 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.