MUX

Problem #140

Tags: logic

Who solved this?

Previous:NOR and XNOR Next:DEMUX


Now that we understand how the basic chips work, let's look at something a bit more useful - the Multiplexer Chip.
The MUX chip reads two signals, then relays one of them depending on the state of a third input.

           S           
     ┌─────┴─────┐     
 A ●─┤           │     
     │    MUX    ├─● Y 
 B ●─┤           │     
     └───────────┘     

The MUX chip has 2 input pins A and B, one selector pin S, and 1 output pin Y.
When the S pin reads 0, the signal from A will be routed to Y. Likewise when the S pin reads 1, the signal from IN[1] will be routed to OUT.

 MUX.A │ MUX.B │ MUX.S ║ MUX.Y 
───────│───────│───────║───────
   0   │   0   │   0   ║   0   
   0   │   1   │   0   ║   0   
   1   │   0   │   0   ║   1   
   1   │   1   │   0   ║   1   
   0   │   0   │   1   ║   0   
   0   │   1   │   1   ║   1   
   1   │   0   │   1   ║   0   
   1   │   1   │   1   ║   1   

The circuit board will come pre-installed with INPUT and OUTPUT chips as shown below:

───────┐                                                            
       ├─● A                                               ┌────────
       │                                                   │        
 INPUT ├─● B                                           Y ●─┤ OUTPUT 
       │                                                   │        
       ├─● S                                               └────────
───────┘                                                            

Problem Statement

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.B │ INPUT.S ║ INPUT.Y 
─────────│─────────│─────────║─────────
    0    │    0    │    0    ║    0    
    0    │    1    │    0    ║    0    
    1    │    0    │    0    ║    1    
    1    │    1    │    0    ║    1    
    0    │    0    │    1    ║    0    
    0    │    1    │    1    ║    1    
    1    │    0    │    1    ║    0    
    1    │    1    │    1    ║    1    
You need to login to get test data and submit solution.