12
2
Below is a (schematic) Digital timing diagram, for the XNOR logic gate.
┌─┐ ┌─┐ ┌─────┐ ┌─┐ ┌─┐ ┌───┐
A ──┘ └─┘ └─┘ └─┘ └─┘ └─┘ └──
┌───┐ ┌───┐ ┌─┐ ┌─────┐ ┌─┐ ┌─┐
B ┘ └─┘ └─┘ └─┘ └───┘ └─┘ └
┌─────┐ ┌─┐ ┌─┐ ┌───┐
X ──┘ └───┘ └───┘ └───┘ └────
Your goal is to reproduce it exactly as depicted.
Rules:
You can either print it or return a multiline string;
Arbitrary number of traling and/or leading newlines are allowed;
Trailing (but not leading !) whitespace is allowed;
If you can not use the extended ASCII box-drawing characters, you may substitute them for the unicode equivalents (at no byte penalty).
This is code-golf so the shortest answer in bytes wins.
Binary Representation
For your convenience, binary representation of the diagram above is as follows:
INP A=0101011101010110
INP B=1101101011100101
___
X=A⊕B=0111001001001100
Sample Output
Sidenote
While working on this question, I've implemented two different bash solutions for it, one is 122 characters/bytes long (as depicted above), and another one is exactly 100 bytes long.
I do not have plans to post them (as I don't normally post answers to my own questions), so that is just for reference.
I also believe that at least some sub-100 byte solutions are possible.
2That's an XNOR gate, isn't it... – clismique – 2017-01-06T13:33:35.823
@Qwerp-Derp Yep, maybe it is :) – zeppelin – 2017-01-06T13:52:12.777
2Instead of suggesting (0==0)==0 shan't either B or X start and end at 1? – Roman Czyborra – 2017-01-06T14:11:33.667
@Roman Czyborra Not sure I understand the idea, could you elaborate on this a bit ? – zeppelin – 2017-01-09T10:14:25.830
1@zeppelin Look right at the beginning of the pattern - the first couple pixels. A, B and X are all low there. The same is true at the end. Why is this the case? (I believe this is Roman's question). – isaacg – 2017-01-09T11:19:13.470
@isaacg, only A and X are low, B is high, but as it starts with "light up and left" - ┘, it makes it look like it transitions from low. This is a peculiarity of using ASCII art to represent the diagram. Starting with all 1es, would have probably made it look nicer, but that is too late for this kind of change. – zeppelin – 2017-01-09T13:23:37.437
@xnor how'd he get your selfie? – Magic Octopus Urn – 2017-01-12T20:44:12.253