Can someone help me out with a simple BASIC formula for logical NOR? I tried OR then AND255. What would you use?
If you're up for the challenge, what about NAND? XNOR?
NOR in BASIC
Moderator: Moderators
Re: NOR in BASIC
what about NOT (A OR B)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
- Mike
- Herr VC
- Posts: 4842
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: NOR in BASIC
what groepaz wrote, plus:
NAND(A,B) -> NOT(A AND B)
XNOR(A,B) -> A=B ("=" as relational operator, as in IF A=B THEN ...) provided A and B are -1 for true and 0 for false.
NOT(A AND B) also works for bitwise operations (where A and B are not necessarily 0 or -1). XNOR(A,B) would need to be expressed as (A AND B) OR (NOT A AND NOT B) in that case.
NAND(A,B) -> NOT(A AND B)
XNOR(A,B) -> A=B ("=" as relational operator, as in IF A=B THEN ...) provided A and B are -1 for true and 0 for false.
NOT(A AND B) also works for bitwise operations (where A and B are not necessarily 0 or -1). XNOR(A,B) would need to be expressed as (A AND B) OR (NOT A AND NOT B) in that case.
- TRIANGULAR OS
- Vic 20 Dabbler
- Posts: 87
- Joined: Wed Mar 09, 2022 4:53 am
- Website: https://www.youtube.com/@triangular_uos
- Location: Cracow, Poland
Re: NOR in BASIC
If you want have this in 0 or 1 form use ABS() function in BASIC. So for example XNOR(A,B) would be ABS(A=B), if you want 0,1 answer.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352
TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
http://www.sleepingelephant.com/ipw-web ... =2&t=10352
TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos