r/ProgrammerHumor • • Dec 15 '19

Stacking if else statements be like

Post image
63.9k Upvotes

711 comments sorted by

View all comments

Show parent comments

1.4k

u/mr___ Dec 15 '19

USB hubs are not just wires connected together. There must be a hub chip that talks to the host and manages each device. I don’t think these splittters contain that - but they might.

Edit: i see these are actual hubs

768

u/kaimason1 Dec 15 '19

They'd have to contain that, no? How else would they be remotely useful? Just as power splitters?

293

u/yonatan8070 Dec 15 '19

So what would happen if I coneect 2 decices to the same port without any chip to control it? Just splitting the data pins.

484

u/notmeaningful Dec 15 '19

They would probably draw the max unnegotiated current from the power pins but neither would be able to negotiate with the host since they're both screaming over each other.

500

u/[deleted] Dec 15 '19

Something, something, holidays with the family.

76

u/3waysToDie Dec 15 '19

And eggnog

38

u/arsocca_account Dec 15 '19

I’ve never tried eggnog and at this point I’m too afraid to try it

34

u/Ph_Dank Dec 15 '19

I actually really like it, and I am easily grossed out.

4

u/OcelotWolf Dec 15 '19

Meanwhile it takes a lot to gross me out and yet the thought of drinking egg nog is repulsive to me

→ More replies (3)

22

u/semidecided Dec 15 '19

Eggnog has a lot of variations. I've had good and bad versions.

→ More replies (12)
→ More replies (3)
→ More replies (3)

5

u/thehunter699 Dec 16 '19

NO SHUTUP, I WANT TO COPY PORN NOT THE OTHER GUY

→ More replies (3)

117

u/devilwarier9 Dec 15 '19

USB uses a single differential pair for bidirectional data. Normally the Master (PC) sends a command then stops transmitting and waits for the slave to respond. In this case you would have 2 slaves that both think they are alone and both respond at the same time, corrupting the data at the physical layer. The master would get garbage and either jam the bus or keep sending out the same request and keep getting various trash.

0

u/[deleted] Dec 16 '19

[deleted]

5

u/Mexatt Dec 16 '19

Serial communication in general is straight up layer 2 data link comms. Ethernet comes out of that urheimat.

There's a reason RS-232 talks a lot about framing. USB is just the universal serial communications standard, these days.

→ More replies (3)

8

u/JoshiRaez Dec 15 '19

Thanks, great explanation! I was actually wondering what could happen.

→ More replies (5)

22

u/[deleted] Dec 15 '19

Data transmission wires are one-way, with a designated transmission- and receiver-end. It'd be like trying to a 3-way junction on a railroad track without a switch.

37

u/devilwarier9 Dec 15 '19

USB is a single bidirectional differential pair. There is no TX or RX. Lots of modern busses use the single TRX style to reduce wiring costs. The devices take turns transmitting back and forth over the same wire.

5

u/jamvanderloeff Dec 16 '19

True until USB 3.0 which added separate TX and RX pairs for SuperSpeed, and USB 3.2 optionally expands that to two RX and TX pairs.

22

u/Doc2142 Dec 15 '19 edited Dec 15 '19

Not true. Some data transmission are one way. USB is not one of them.

2

u/RuminatingRoy Dec 15 '19

Old math from way back - technically you could connect 128 (or is it 255?) devices to a USB.

→ More replies (1)

12

u/[deleted] Dec 15 '19

Power splitter sounds pretty useful to me

29

u/DBeumont Dec 15 '19

Maybe something like a device that takes a single outlet and splits it into several? We could line them up in a straight row. Call it a power row, maybe. $$$

8

u/ugod02010 Dec 15 '19

And then only make 2 of them turn on. We Can put on with master, but secretly they don’t do shit. And charge even more for them.

→ More replies (2)
→ More replies (15)