4.1.17 error

andrewpro

New Member
Bah! I read it wrong. Ignore my now edited away post <img src="smile.gif" width=15 height=15 align=middle>

--Andy P

Edited by - andypro on 30/06/2006 04:30:37
 

hippy

Ex-Staff (retired)
In what way does &quot;NOT&quot; not work ?

For

- b0 = NOT b1

the compiler generates the code ...

- b0 = b1 ^ $FFFF

Providing the variables on both sides of the '=' are of the same size ( bit/pin, byte/pins or word ), the operation will invert all bits of that variable.

Where the variables are of different sizes, the normal expand to 16-bits, do 16-bit arithmatic then truncate to fit destination applies which may give slightly odd or unexpected results, for example ...

- b0 = NOT pin0

will set b0 to $FE or $FF, not $00 or $01.

Edited by - hippy on 30/06/2006 13:45:06
 

tarzan

Senior Member
let b0 = b1 NAND b2

let b0 = b1 NOR b2

let b0 = b1 OR b2

let b0 = b1 ORNOT b2

let b0 = b1 AND b2

let b0 = b1 ANDNOT b2

let b0 = b1 XOR b2

let b0 = b1 XNOR b2

let b0 = B1 NOT B2 'Error in this line
 

hippy

Ex-Staff (retired)
NOT operates in the same was as negation, so &quot;b1 NOT b2&quot; is not meaningful.

Perhaps you need to be looking at XOR / '^' ?
 

tarzan

Senior Member
I was thinking and <b>NOT </b> very well about a double inversion with a centre tap,
but this would not apply to a Picaxe chip.

Anyway you are right my mistake.

Invertion example:

'invert inputs onto outputs 28X &amp; 40X

let pins = NOT pins

'input %11111111 = output %00000000
'input %00000000 = output %11111111
'input %00001111 = output %11110000

Here are some boolean logic GUI programs. I like the BOOLEAN LOGIC V1.2 for those
who are interested.
<A href='http://www.winsite.com/bin/Search?id=6000000037662' Target=_Blank>External Web Link</a>
 

tarzan

Senior Member
Just thinking aloud this is what I said you couldn't do with Picaxe.
What I really meant you can't do this as a buffered I/0.

let bit8 = pin0
let bit0 = NOT bit8
let pin1 = bit0
let pin0 = bit8


<code><pre><font size=2 face='Courier'>
______ output 1
|
input 0__|\__|__|\__ output 0
|/ |/
</font></pre></code>
 
Top