1
\$\begingroup\$

I'm not an electrical engineer, but in reading the documentation of the system I work on, I'm coming across a lot of references to multiplexing. I'm wondering if my understanding of multiplexing is accurate and I've come up with an example. If someone could verify my understanding, I'd really appreciate it.

Assume I am working with a 10Hz, 16 bit message. If I have two quantities, A (12 bits) and B (6 bits), I immediately come across the problem of not having enough "space" (not sure the word) in the message to send A and B. But if I don't really need A and B at 10 Hz and say 2Hz will work, can I convert my 10Hz message into five 2Hz messages?

In other words, can I do this:

Group 1: A, 12 bits
Group 2: B, 6 bits
Group 3: Spare 1, n<=16 bits
Group 4: Spare 2, n<=16 bits
Group 5: Spare 3, n<=16 bits

Where each group is a 2 Hz message. I'm assuming that by splitting a 10 Hz message into five 2 Hz messages, I expand my "space" to 16 bits * 5 groups = 80 bits?


Follow-up Question: Here's what confuses me. I'm looking at some work an (ex)-coworker did. They laid out a plan that basically goes like this:

Lets assume I have a bar that has five different super complicated lights on it. I have a two word message that has 16 bits per word that is capable of sending the message at up to 10 Hz.

My coworker dedicated 2 words (16 bits each) to one particular cause --sending three quantities, A (6 bits), B (8 bits), and C (8 bits), at 2 Hz. All five lights are controlled using this same message, so my coworker decided to multiplex these word and have five different mux groups for each word. So each light gets its command update every 0.2 seconds.

My question is this: how can all five commands fit in two 16 bit words?

I know the following:

(1 word/1 message) * (16 bits/1 word) * (1 message/0.1 sec) = 160 bits/second

So if I apply that same logic to my coworkers plan:

(5 words/2 message) * (16 bits/1 word) * (1 message/0.2 sec) = 200 bits/second

So in that case, I am exceeding my allowable bit rate (is this the right term?).

Could you point out the flaw in my logic? I'm pretty confident that he was correct, I think I'm just misunderstanding.

He ended up with A on one word with 10 spares, and B and C on another word with 0 spares.

\$\endgroup\$
  • 1
    \$\begingroup\$ Yes. One way is to limit the content of each message to (say) 12 bits leaving 4 bits spare. Then you can encode the message type A, B, (C,D,E) into (some of) those 4 bits so that each message can be decoded in isolation (i.e. without referring to other messages) \$\endgroup\$ – Brian Drummond Oct 1 '19 at 12:49
1
\$\begingroup\$

No, that's a bit off track.

Wikipedia's Multiplexing definition sums it up fairly well.

In telecommunications and computer networks, multiplexing is a method by which multiple analog or digital signals are combined into one signal over a shared medium. The aim is to share a scarce resource. For example, in telecommunications, several telephone calls may be carried using one wire.

enter image description here

Figure 1. Time division multiplexing (TDM) is one flavour. Source.


Back to your question:

Assume I am working with a 10 Hz, 16 bit message.

You need to separate the sample rate (how many times a second you need to transmit a value) from the data rate of the carrier (how many bits per second the carrier can handle). The way you have defined this sounds like you want to transmit a 16-bit message 10 times per second. This means that you need to be able to transmit at least 160 bits per second.

If I have two quantities, A (12 bits) and B (6 bits), I immediately come across the problem of not having enough "space" (not sure the word) in the message to send A and B. But if I don't really need A and B at 10 Hz and say 2 Hz will work, can I convert my 10 Hz message into five 2 Hz messages?

You can do this but now you have the problem of adding some sort of markers or identifiers to the data so you can synchronise both ends. This will take up extra bandwidth.

\$\endgroup\$
  • \$\begingroup\$ Thanks for the response. I edited my question with a follow-up question (it was too long to reply to this response with). Could you address that when you get the chance? \$\endgroup\$ – synchh Oct 1 '19 at 17:58
1
\$\begingroup\$

A simpler approach would be to allocate some part of your 16-bit message to indicate which channel the message applies to. If you only have two channels, you just need one of the 16 bits to do that, leaving 15 bits for the "payload" (channel data).

+-- channel number
|
v /------ channel data -------\
0 0 0 0 a a a a a a a a a a a a

1 0 0 0 0 0 0 0 0 0 b b b b b b

You can transmit such words alternately, so that each channel gets updated at 5 Hz. The receiver can always tell which channel a given message applies to, by simply examining the first bit.

\$\endgroup\$
  • \$\begingroup\$ Sorry for the confusion-- I'm not trying to design anything, I'm just trying to understand what an old coworker did. I updated my original question with a more specific example to clarify that. \$\endgroup\$ – synchh Oct 1 '19 at 18:03
  • \$\begingroup\$ I would try to answer your followup question, but I don't understand it. It sounds like your friend was sending a total of 22 bits to each of 5 lamps twice a second, which would be 220 bits/second, which is far too high -- or I'm misunderstanding something. But the last part makes it sound like he was sending 10 words -- 2 words per light -- which means that each lamp was only getting updated once a second. \$\endgroup\$ – Dave Tweed Oct 1 '19 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.