What will be the value of demux_out[1] (the second output of Demux)?
medium
A. 3
B. Error: Index out of range
C. 5
D. 7
Solution
Step 1: Understand Mux output
Mux combines inputs [3, 7, 5] into a vector: mux_out = [3, 7, 5].
Step 2: Understand Demux output
Demux splits mux_out back into separate outputs: demux_out[0]=3, demux_out[1]=7, demux_out[2]=5.
Final Answer:
7 -> Option D
Quick Check:
Second Demux output = 7 [OK]
Hint: Mux packs inputs; Demux unpacks in same order [OK]
Common Mistakes:
Mixing up output indices (0-based vs 1-based)
Assuming Demux changes order
Expecting error due to indexing
4. You have a Switch block with inputs: Input1=10, Input2=20, and a control signal Control=0. If the Switch block is configured to output Input1 when Control is 0, but the output is always 20, what is the likely error?
medium
A. Control signal logic is inverted or misconfigured
B. Input1 and Input2 are swapped in the block
C. Switch block cannot handle numeric inputs
D. Control signal is not connected
Solution
Step 1: Analyze expected Switch behavior
With Control=0, output should be Input1=10, but output is 20 (Input2).
Step 2: Identify cause of wrong output
This suggests the control logic is inverted or misconfigured, causing the block to select Input2 when Control=0.
Final Answer:
Control signal logic is inverted or misconfigured -> Option A
Quick Check:
Wrong output means control logic error = D [OK]
Hint: Check control logic polarity if Switch output is unexpected [OK]
Common Mistakes:
Assuming inputs are swapped without checking control
Thinking Switch can't handle numbers
Ignoring control signal connection
5. You want to build a Simulink model that takes three sensor signals and selects one to output based on a control signal (0, 1, or 2). Which combination of blocks correctly achieves this?
hard
A. Use a Demux to split sensors, then multiple Switch blocks to select output
B. Use a Mux to combine sensors, then a Multiport Switch block with control signal to select output
C. Use a Mux to combine sensors, then a Switch block with control signal to select output
D. Use three Switch blocks each connected to one sensor, controlled by the same control signal
Solution
Step 1: Understand the requirement
We need to select one of three sensor signals based on a control signal with values 0, 1, or 2.
Step 2: Evaluate block combinations
A Multiport Switch block can select one input from many based on control. Combining sensors with Mux then using Multiport Switch fits this need.
Step 3: Why other options fail
Use a Mux to combine sensors, then a Switch block with control signal to select output uses a simple Switch which only selects between two inputs, not three. Use a Demux to split sensors, then multiple Switch blocks to select output uses Demux incorrectly. Use three Switch blocks each connected to one sensor, controlled by the same control signal uses multiple Switches but control signal can't select one cleanly.
Final Answer:
Use a Mux to combine sensors, then a Multiport Switch block with control signal to select output -> Option B
Quick Check:
Multiport Switch selects among many inputs = A [OK]
Hint: Use Multiport Switch for multiple input selection [OK]
Common Mistakes:
Using simple Switch for more than two inputs
Misusing Demux for selection
Trying multiple Switches with one control signal
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.