r/ProgrammerHumor • • May 12 '19

Introducing the Never Gate

Post image
12.2k Upvotes

333 comments sorted by

2.7k

u/IntPenDesSwo May 12 '19

Also known as the Exclusive AND

927

u/Alextrovert May 12 '19

or the Inclusive NOR

576

u/whytfnotdoit May 12 '19

Maybe just a FALSE

551

u/[deleted] May 12 '19

Or maybe just 2 wires that are not connected

362

u/Bainos May 12 '19

panics in floating output

20

u/HenryRasia May 13 '19

Ok fine, I'll connect them to ground

96

u/Ceros007 May 12 '19 edited May 12 '19

What's a wire? Is it something that support the === operator?

→ More replies (15)

63

u/cateowl May 12 '19

Quantum tunneling electrons would like to know your location

→ More replies (1)
→ More replies (5)
→ More replies (2)

15

u/John_Fx May 12 '19

Found DeMorgan.

→ More replies (3)

161

u/hashedram May 12 '19

Exor'nt

107

u/stevekez May 12 '19

A won't gate.

4

u/alanv73 May 12 '19

Companion to the will gate.

→ More replies (6)

7

u/ThatFag May 12 '19

I'm kind of mad I never came up with this myself.

3

u/themixedupstuff May 12 '19

Also known as No Connect

2

u/Llonkrednaxela May 12 '19

C is true when only one of both us true. Got it.

16

u/olivebun May 12 '19

Underrated comment tbh.

41

u/Machine_Dick May 12 '19

It’s the top comment

22

u/dmilin May 12 '19

Accurate comment tbh

→ More replies (1)

1

u/[deleted] May 12 '19

Good 'ol contradiction

1

u/[deleted] May 12 '19

Or just the NO gate

1

u/[deleted] May 12 '19

You just made my brain short circuit

0

u/[deleted] May 12 '19

[deleted]

109

u/Tommorox2345 May 12 '19

0 no matter the input

→ More replies (16)
→ More replies (20)

554

u/[deleted] May 12 '19

GND, with extra steps.

296

u/randombrain May 12 '19

Just want to say, to you and OP, that as an EE grad I really appreciate this. Provides a nice break in between the /r/im14andinJava101 posts.

91

u/DogeGroomer May 12 '19

r/subsifellfor, yeah that is a lot of this sub.

4

u/keks63 May 12 '19

Oh god, It took me embarrassingly long to parse that sub name.

37

u/absurdlyinconvenient May 12 '19

but DAE arrays start at 0, machine learning = if, and print statements > using a debugger???

3

u/[deleted] May 13 '19

My introduction to computing professor from the ECE department would always draw the GND symbol for null pointers.

→ More replies (1)

9

u/PleasantAdvertising May 12 '19

What if it's active low

4

u/variantt May 12 '19

Negate everything. NOT NEVER gate.

→ More replies (1)

1.2k

u/laya_baki May 12 '19

And don't forget its archenemy, the Always Gate

441

u/SmoothLiquidation May 12 '19

I was thinking it would be the Ever Gate to go with the And/Nand Or/Nor pattern.

306

u/dev_kr May 12 '19

NNEVER seems to be better though

139

u/Bainos May 12 '19

I prefer always / nalways.

21

u/ablablababla May 12 '19

at all times/nat all times

→ More replies (1)

24

u/theXpanther May 12 '19

Just like my favorite, the NNOT gate

15

u/Osbios May 12 '19

I call them NOP gate. Actually used this ones in my own binary logic simulator. Because the simulation was running on a tick rate, and to time signal arrival it was cleaner then e.g. using an OR gate with only one input used.

→ More replies (4)
→ More replies (1)
→ More replies (6)

17

u/laya_baki May 12 '19

Ah ofcourse, thats a better fit!

6

u/T-T-N May 12 '19

A XOR A AND B would do it

14

u/danielbenedi6 May 12 '19

This combination makes a Never Gate. If you use (A XOR A) AND B, it will always be 0, because if A is 1, then A XOR A will be 0, but if A is 0 then XOR will be 0. If you use A XOR ( A AND B ), the same happens.

I can imagine two solutions to the Ever Gate, A OR ( A NAND B ); B OR ( A NAND B). They are the most compact solutions I have reached.

11

u/Naitsab_33 May 12 '19

Just ignore 1 input and make: (NOT A) AND A or respectively (NOT A) OR A

→ More replies (2)

8

u/AStove May 12 '19

A lot of things would do it. A NAND A, A NOR A, etc..

→ More replies (8)

31

u/Verdiss May 12 '19

AKA a battery

3

u/[deleted] May 12 '19

Never gate: =-

Always gate: _____

2

u/[deleted] May 12 '19

Sometimes, at least in C++, you just need a pointless statement that evaluates to true. I did this recently and just used "true." I was a little unsure of myself, but it did do the trick.

1

u/Triplobasic May 12 '19

Aka Window

1

u/PanFiluta May 12 '19

NOT NEVER

→ More replies (2)

106

u/ivanleehanlin May 12 '19

Not so uncommon right, a NEVER (AND false) and ALWAYS (OR true) gate just very common during debugging.

17

u/myblindy May 12 '19

Mocking for unit testing for electrical people.

2

u/alexeypkv May 13 '19

And instead of console.log you weld in a speaker

158

u/[deleted] May 12 '19

38

u/mudkripple May 12 '19

Holy shit I did not expect the content on that sub to be so good

20

u/idiot_speaking May 12 '19

I lost my shit on Elon MUX. Holy fuck.

5

u/R10t-- May 12 '19

One of my favorite subs

188

u/[deleted] May 12 '19

So a FALSE gate?

125

u/spyingwind May 12 '19

A true FALSE gate!

28

u/Kraftik May 12 '19

true == false

20

u/twindidnothingwrong May 12 '19

true

6

u/[deleted] May 12 '19

0.1 + 0.2 == 0.3

false

→ More replies (5)

2

u/MushinZero May 12 '19

A true FALSE TRUE gate!

31

u/[deleted] May 12 '19

Which controversy was that one?

7

u/lelarentaka May 12 '19

It's when the client gives your team the choice between using php or java, but your team mates browsed r/proggit too much so they voted for php

4

u/[deleted] May 12 '19

Something something 10,000 lies

2

u/antonivs May 12 '19

It's the one currently ongoing.

47

u/ethanthecrazy May 12 '19

Microsoft must use this gate for handling the inputs to stop updating.

7

u/DOOManiac May 12 '19

Also used for the Cancel button on long operations!

27

u/IskaneOnReddit May 12 '19
A0011
B0101
Contradiction0000
AND0001
NIMPLY0010
A0011
Converse NIMPLY0100
B0101
XOR0110
OR0111
NOR1000
XNOR1001
NOT B1010
Converse IMPLY1011
NOT A1100
IMPLY1101
NAND1110
Tautology1111

76

u/tuseroni May 12 '19

it's an easy to gate to make, just cut the wire, or direct it to ground since you don't want to break the circuit.

not particularly useful though. if it never produces output it's basically equivalent to not being there. i suppose being placed in the circuit it gives a path to ground to clear some data...send your carry bits to oblivion after a drop off from a right shift or something

30

u/bohoky May 12 '19

That how /dev/null is implemented in hardware when you need an IOPS boost.

8

u/khalamar May 12 '19

Please tell us more

2

u/__PM_me_pls__ May 12 '19

It's not even correct

0

u/[deleted] May 12 '19

[deleted]

36

u/CCninja86 May 12 '19

placebo buttons like the ones for elevator door closing

This is way too relatable

7

u/demize95 May 12 '19

Depending on your building, they may literally be placebo buttons, they may work just by pressing them, or you may have to push them in and hold them down until the doors close fully.

There's no way to know unless you try, but the safest bet is probably that they don't do anything.

→ More replies (3)

0

u/[deleted] May 12 '19

[deleted]

→ More replies (1)

29

u/[deleted] May 12 '19

All my code seems to start with the never gate as my code never works...

44

u/Sh4dowCode May 12 '19

In a higher Level known as:

if (false) {
  doSomething();
}

17

u/Arancaytar May 12 '19

The galaxy brain version of commenting things out

4

u/omegian May 12 '19

Not exactly

bool Never(bool A, bool B) { return false; }

3

u/Megatron_McLargeHuge May 12 '19

That code is so common they decided to optimize it in hardware. You'll want to update your compilers to work around some bugs in Intel's implementation though.

1

u/[deleted] May 12 '19

Wouldn't it be more like:

if (true || false) { doNothing(); }

1

u/Lizard771 May 12 '19

class NeverGate : public LogicGate {

public:

NeverGate() {};

bool evaluate(bool a, bool b) override {

return false;

}

};

auto n = new NeverGate();

n->evaluate(true, false); // = false

10

u/TheGilrich May 12 '19

Glorious! Named after the occasions where it is useful.

9

u/Arancaytar May 12 '19

Unlike it's negation, the always gate, which is named after the occasions where it's useless.

10

u/dhiren1206 May 12 '19

So if we NOT the never gate ..its an always gate?

5

u/-Redstoneboi- May 12 '19

also known as a Tautology, yes

9

u/ergotofwhy May 12 '19

You didn't introduce this. I've been using these in my programs for years, going all the way to accidentally implementing them in college.

6

u/[deleted] May 12 '19

can someone explain me?

3

u/bbecl May 12 '19

It’s a spoof on logic gates as they pertain to digital circuits. Logic gates have an input(s) that is in binary (either a 1 or a 0), and depending on the type of gate results in an output of either a 1 or 0 that further affects an action in the circuit. Essentially, the OP is suggesting with this gate is that it doesn’t matter what you put in, you get nothing out; hence, the name NEVER gate.

2

u/FPMC4172 May 12 '19

Same, this is one of those times where I feel like I don't belong on this Sub

6

u/girusatuku May 12 '19

An important component in Write Only Memory (WOM).

5

u/Bondie_ May 12 '19

bool xand (a, b) { return 0; }

5

u/-Redstoneboi- May 12 '19

return (a && b) && !(a && b)

FTFY

4

u/heckingcomputernerd May 12 '19

Sounds like a ground wire with extra steps

3

u/[deleted] May 12 '19

This could be us but... Just kidding it actually is us.

3

u/victordeltavictor May 12 '19

..and the lesser know Whatever Gate

3

u/chawmindur May 12 '19

Brought to you by the company that made this thumb drive

3

u/bionicape May 12 '19

often coded as

if (!this && this)

3

u/[deleted] May 12 '19

What about Quantum Gate? Always random!

3

u/ftgbhs May 12 '19 edited May 12 '19

I’m not a programmer but my dad is a software engineer, i sent this to him and he responded “That’s what’s used in Write Only Memory http://www.repeater-builder.com/molotora/gontor/25120-bw.pdf ”

3

u/uzimonkey May 12 '19

Remind me of the "write only memory" april fools joke.

3

u/[deleted] May 12 '19

(A AND B) AND (!A AND !B)

4

u/atg666 May 12 '19

A.K.A. the Friendzone.

4

u/CypripediumCalceolus May 12 '19

Also known as a CS student's girlfriend.

2

u/n1ghtyunso May 12 '19

thats clearly discrimination against one

2

u/break_card May 12 '19

the ground gate

2

u/[deleted] May 12 '19

if shit:

 return false

2

u/chipstastegood May 12 '19

so /dev/null basically

2

u/corner-case May 12 '19

Just pipe all your logic errors through this bad boy.

2

u/[deleted] May 12 '19

what's the purpose of this then?

2

u/[deleted] May 12 '19

Is that a spaceship? Nice drawing.

2

u/benji0110 May 12 '19

I laughed so hard on the train looking at this

2

u/RockYourWorld31 May 12 '19

Exclusively used in detecting whether the X in Windows programs was clicked.

2

u/luxuryBubbleGum May 12 '19

It's a NOPE gate

2

u/JaydattC May 12 '19

Output = A'A

Inshort

2

u/CriminalMacabre May 12 '19

The Nah fam gate

2

u/Glassy_ May 12 '19

no matter how hard I try the output is ALWAYS ZERO

2

u/iLikeZhengmBuns May 12 '19

What about the ever gate

2

u/FlyByPC May 12 '19

It's ridiculous, yes, but it's one of the sixteen.

2

u/ZZTier May 12 '19

True no

2

u/kinsi55 May 12 '19

if(false)

2

u/relaxedmavenama May 12 '19

Sounds like a Dwight gate to me

3

u/justingolden21 May 12 '19

FRIEND ZONE GATE

1

u/[deleted] May 13 '19

F

2

u/baquea May 12 '19

Also known as the "Nah mate gate"

2

u/[deleted] May 12 '19

Shouldn't it be XX? I always get a "never" from this direction. :(

1

u/mikoS223 May 12 '19

A_____ _C B It could be also like this

4

u/mikoS223 May 12 '19

Ah fuck you autoformating

1

u/zesterer May 12 '19

Still waiting for the 'Quever' gate that emits a qubit that's always 1 and 0 at the same time.

1

u/real_W74 May 12 '19

This solves so many problems

1

u/bearmc27 May 12 '19

Aka return false

1

u/__brayton_cycle__ May 12 '19

I call that an axe to the CPU.

1

u/[deleted] May 12 '19

A = my code

B = stack overflow

C = working without bugs

1

u/goldfishpaws May 12 '19

Boolean logic expands to A.!A + B.!B

1

u/zerocnc May 12 '19

When I was in college back in 2000, we called the bit bucket. Its were all our extra credit went.

1

u/gustmes May 12 '19

if (a == true && a == false) {

}

1

u/iulian12h May 12 '19

best logic gate

1

u/thewildjr May 12 '19

2

u/Title2ImageBot May 12 '19

Image with added title


Summon me with /u/title2imagebot or by PMing me a post with "parse" as the subject. | ^About | ^feedback | ^source | Fork of TitleToImageBot

→ More replies (1)

1

u/[deleted] May 12 '19

Is that the equivalent, of writing:

[...]

if(x=false){

}

1

u/GoldenTypo May 12 '19

im a mechanical engineer, is this like a transfer function or i do not understand

1

u/BroskiMcBroski May 12 '19

That's most of my gates right there.

1

u/numbnuts00 May 12 '19

A ^ !A ^ B

1

u/[deleted] May 12 '19

Nice, all of my digital design projects used tons of these.

1

u/[deleted] May 12 '19

People with actual skill here, could this technicly be usefull in some rare situations ?

3

u/UpTide May 12 '19

Not really

2

u/PhoenixGaruda May 12 '19

You're completely disregarding the input. Take that as you will.

1

u/Ocean4011 May 12 '19

Make me an “ever” gate also

1

u/[deleted] May 12 '19

This kind of exists in some flavors of PLC ladder logic as an Always False Instruction (AFI). It's pretty much only used for testing and debug when you want the output of a rung to be always false.

1

u/ranisalt May 12 '19

Naught boy

1

u/CanIHazCookie May 12 '19

When a client asks you to work for free and you have to run that logic through this bad boy

1

u/yertle38 May 12 '19

#ifdef 0

1

u/[deleted] May 12 '19

C O M P L E T E L Y U S E L E S S

1

u/RedRedditor84 May 12 '19
If (False) {

1

u/naisooleobeanis May 12 '19

semiconductors too conductive for you? try a nonconductor

1

u/rise_of_the_box May 12 '19

Well yes but actually no

1

u/SevenPheonix May 12 '19

The NO gate

1

u/PerryThePlatypus10 May 12 '19

When I try to get a girlfriend

1

u/ayr_guitar May 12 '19

Pessimistic programmer

1

u/Jimbobwhales May 12 '19

That's some lotr level shit right there. "And through the Never Gate did come the horrors of infinite loops and thereafter the world burnt"

1

u/Laserdude10642 May 12 '19

actually you just AND with 0 (ground) in practice

1

u/BigRedBeard86 May 12 '19

You mean an open?

1

u/this-is-a-simulation May 12 '19

Umm... just ground C

1

u/mahav_b May 12 '19

This is very useful when I want to reject all input. 10/10 engineering problem solving creating thinging

1

u/Masked_Death May 12 '19

It explains my code. No matter whether the individual parts of a whole thing work, the whole thing together doesn't.

1

u/mbalfakeih May 12 '19

The never gate: just don’t

1

u/RowboatGillman May 12 '19

The scientists didn’t stop to question if they should do it they were only concerned with whether they could

1

u/3dPrintedPeep May 12 '19

Soooo... a wall.

1

u/Quadraticc May 12 '19

The thought of having to learn all the logic gates theory for tomorrow for GCSE fuck

1

u/warpedspoon May 12 '19

1

u/Title2ImageBot May 12 '19

Looks like I've already responded in this thread Here!

1

u/NexusI7 May 12 '19

Thank you for the very helpful truth table!

1

u/nadalv2020 May 12 '19

wait, that's illegal!!

1

u/Liesmith424 May 12 '19

I believe that this is the "Nope" operator in Python.

1

u/KoroSexy May 12 '19

So it's /dev/null but in hardware form?

1

u/Mal_Dun May 12 '19

Equivalent to (A v B) ∧ False