user1443778
user1443778

Reputation: 591

Demux simulink (select which block gets input)

I am looking for a block that works as a digital de-muliplexer. I have one input signal and one selector input that determines which line the input gets passed through to.

From wikipedia

I have looked at the demux block in simulink but it does not seem to do this:

"Demux

Split vector signals into scalars or smaller vectors."

I have also looked at "Output Switch" but this only seems to take queues as input.

Upvotes: 0

Views: 3720

Answers (1)

am304
am304

Reputation: 13876

You can probably achieve what you want with 2 multiport switch blocks and one ground block:

  • Configure the multiport switch block to have 2 data inputs
  • Connect your data input in to data input port 1 of the first multiport switch, and data input port 2 of the second multiport switch
  • Connect the ground block to the other two data input ports remaining
  • Connect your selector input sel to the control port of each multiport switch
  • Connect the output of the first multiport switch block to the first of your two outputs (O_0 or O_1), and the output of the second multiport switch block to the second of your two outputs.

You can wrap up everything into a subsystem and even include it in a library if you intend to reuse it in different models. I would obviously test it first to make sure it has the intended behaviour.

Upvotes: 0

Related Questions