What exactly does "wired-AND function" mean in I²C - Page 1
Forum section: electronics / general

author: EVblog1
author_rank: Contributor
timestamp: September 28, 2025, 10:47:01 am
content: I’ve been looked the I²C specification But I don’t understand what they mean by "wired-AND function."Specificationhttps://www.nxp.com/docs/en/user-guide/UM10204.pdfI know that the bus lines (SDA, SCL) are pulled HIGH when idle, and devices can pull them LOWIs the AND logic actually implemented with a gate, or does it just mean that all the masters’ outputs are connected together, and the resulting ‘ANDed’ signal directly becomes the SCL/SDA line?

author: hans
author_rank: Super Contributor
timestamp: September 28, 2025, 10:54:49 am
content: Open collector/drain means each driver can only pull a line low. The high signal is set by a pull-up.That means that an idle level can only be achieved when all drivers want an idle level. This is the 'wired-AND' bit of the open collector/drain part. So its not actually implemented as a gate, but in binary levels, it would be an AND situation.Personally I think its a bit confusing to talk about I2c like this. If you would apply De Morgan law to this logic, then the logic level idles at high and any open collector/drain can pull it low. In this speak, it would be a wired-OR port if you listen for level lows...

author: ejeffrey
author_rank: Super Contributor
timestamp: September 28, 2025, 03:17:49 pm
content: It means if ANY device on the bus pulls the line low, the signal will be low. If ALL devices leave it high, the signal will be high.This can be called wired-OR or wired-AND depending on whether the logical "1" is low or high. The physical circuit is the same, the difference is just the interpretation of the logic signals.Historically these types of signals were mostly used when the desired operation is OR, such as an interrupt request signals: the host wants to know if any device triggers an interrupt. These used active low logic and the terminology wired-OR is more common. I2C uses active high signalling so it's technically wired-AND, but I have seen it described both ways.

author: Stray Electron
author_rank: Super Contributor
timestamp: September 28, 2025, 03:45:05 pm
content: Take the two input signals and feed each of them into a reverse biased diode (the Cathode, the bar symbol towards the source). Then tie the anodes of the diodes together and that's your output. You will also need to add a pull up resister to the output and connect the other end of it to a logic high source. Your output will be high only if both inputs are high, in other words it's an AND function of the inputs. If any input is low then the output is low. I can't say how they have actually physically implemented it in your device but that is as simple as a Wired AND gets. If you reverse the diodes then the circuit is a Wired OR and a high input on any input will produce a high output. In both circuits you can also parallel as many diodes and inputs as you like.PS: The title "Wired" means that the function is done with passive parts such as diodes and resistors instead of any active parts such as an IC. The AND or OR function can of course be implemented with logic ICs or in a micro-processor but then it's not a "Wired" device. Active parts require their own power and ground (or DC return) line so for simple things "Wired" circuits are frequently used.

author: free_electron
author_rank: Super Contributor
timestamp: September 29, 2025, 04:41:40 pm
content: Just like in a real AND gate, where all inputs need to be high for the output to be high, the SDA line can only go high if all the devices on the bus have their SDA line high (in this case open, the pull-up provides the high level).'Wired' means there is no active component involved. The "gate" lives in the "wiring". Such things are constructed from open collector/emitter/source/drain outputs and either a pull-up or pull-down resistor. In case of bipolar logic ( like TTL) you don't even need the resistor as the inputs of TTL gates are emitters ( you can pull current out of an input. )shameless plug : There's a really good book on I2C :https://www.elektor.com/products/mastering-the-i2c-bus-e-book?srsltid=AfmBOopzpQBUyy3WYQ5NstOGd7fIBE_Tw1QipV3oTV0Ircaue-BeDZyA