The counterpart to the Multiplexer is the Demultiplexer, which works a bit like a MUX chip in reverse.
The DEMUX chip reads a signal, then routes that signal to two possible outputs, depending on the state of a second input.
S
┌─────┴─────┐
│ ├─● X
A ●─┤ DEMUX │
│ ├─● Y
└───────────┘
The DEMUX chip has 1 input pins A, one selector pin S, and 2 output pins X and Y.
When the S pin reads 0, the signal from A will be routed to X.
Likewise when the S pin reads 1, the signal from A will be routed to Y.
DEMUX.A │ DEMUX.S ║ DEMUX.X │ DEMUX.Y
─────────│─────────║─────────│─────────
0 │ 0 ║ 0 │ 0
0 │ 1 ║ 0 │ 0
1 │ 0 ║ 1 │ 0
1 │ 1 ║ 0 │ 1
The circuit board will come pre-installed with INPUT and OUTPUT chips as shown below:
───────┐ ┌────────
├─● S IN[0] ●─┤
INPUT │ │ OUTPUT
├─● OUT IN[1] ●─┤
───────┘ └────────
Digital Logic Circuit Interface
For these Digital Logic Circuits tasks, you will not be providing an answer string you would for other tasks.
Instead, your Solution Code will be interpreted directly to place chips onto the circuitboard and connect them with wires.
Click here to learn the Digital Logic Circuit Syntax used on this site.
After the chips have been placed and connected, the server will run a series of tests, randomly assigning values to the input pin(s) and checking to see if the output pins read the corresponding expected values. If all tests produce the expected outputs, then the circuitboard is considered a success.
Even though we won't be using the "Your answer" box, you'll still need to put something in that box to submit your solution. Just put anything - it will not be passed to the interpreter.
Truth Table
Design a circuit board which satisfies the following Truth Table:
INPUT.A │ INPUT.S ║ OUTPUT.X │ OUTPUT.Y
─────────│─────────║──────────│──────────
0 │ 0 ║ 0 │ 0
0 │ 1 ║ 0 │ 0
1 │ 0 ║ 1 │ 0
1 │ 1 ║ 0 │ 1