Skip to content
Sign upLog in
← Back to Community

Lets learn APL! Part 3

Profile icon
TheForArkLD

Lets learn APL part3!( i dont write more japanese,im japanese but its make tired to me)
Today lesson is Logic gates and boolean.
First,i description the logic gates.
Uh why?
Probably you dont know logic gates.

Please remember this : We have 2 inputs for logic gates,name is A and B
1st is AND Gate,When A and B is 1 to OUT is true.
2nd is OR Gate,When A is 1 or B is 1 or A and B is 1 to OUT is true.
3rd is NOT Gate(Its use one input only,name is IN),When IN is 0 to OUT is true.
NOTE : In NOT Gate,other is false
4th is XOR Gate,When A is 1 and B is 0 or A is 0 and B is 1 to OUT is true.
Note : You can make NAND and NOR and XNOR,but how to?Use NOT Gate and other gate.
Example : NAND is NOT + AND

Ok,Please remember their gates.

Ok lets code APL!
And remember this rules.

   Rule 1.Dont use Not Boolean on Gates,When you use to its return DOMAIN ERROR

1st,Logic Gate is NOT.
Use ~ to Get NOT Gate Data,And you can use array on NOT Gate.
Example:

     ~ 0 1 0 1 1 0 1 0 1 0 0 1

2nd Gate is AND(XNOR) Gate.
(Yay its can use on not Boolean)
Use = to get AND Gate Data,And you can use Array on All Gates.
Example:

     1 0 1 1 0 = 0 1 0 1 0 0 0 0 1 0

3rd Gate is XOR Gate.( I dont know OR Gate code sorry and its can use not boolean.)
Use to get XOR Gate Data.

     1 0 1 0 1 ≠ 0 1 1 0 1 1 1 0 0 0

Next,Boolean.
Its easy,1 is true,0 is false.

Today lesson is end.
Thanks for viewing my lesson :)
When you have questions to ask me :)

Voters
Profile icon
LuizaMazini
Profile icon
programmeruser
Profile icon
glitchish
Profile icon
theangryepicbanana
Profile icon
TheForArkLD
Comments
hotnewtop
Profile icon
CSharpIsGud

I believe you have a typo in the section on and gates
1 0 1 1 0 AND 0 1 0 1 0 should equal 00010 not 00011

Profile icon
TheForArkLD

@CSharpIsGud
sorry type miss...

Profile icon
theangryepicbanana

Hey do you know where I'd find a list of APL operators/functions that describe if they are monadic/dyadic/something else? All I've found is the wikipedia entry, which is kinda outdated.

Profile icon
TheForArkLD

@theangryepicbanana
Here :)
https://aplwiki.com

Profile icon
theangryepicbanana

@TheForArkLD
Thanks that really helped :D I've been working on APL highlighting for repl.it so I needed to know what to highlight

Profile icon
TheForArkLD

@theangryepicbanana
ok :D and You’re welcome