00:00:00.000 Three inputs share one output The collector takes three eight bit words. Code zero zero sends channel A to the output. Code zero one sends channel B. Code one zero sends channel C. The selector changes which word goes out. All three inputs stay wired in place. 00:00:22.660 Set the channel count before a selector can change Parameters set the channel count and the width of each word. Elaboration makes a twenty four bit bus for three eight bit channels and a thirty two bit bus for four. At run time the selector chooses among the existing connections. Changing the selector cannot add a channel. 00:00:45.480 Map the packed bus to unpacked channels On the flat bus, channel zero occupies the low eight bits. Channel one sits above it, then channel two. Below, the same data is arranged as an unpacked array of eight bit words. Choose the channel first, then choose a bit within that channel. 00:01:05.650 The slice start moves while the width stays fixed Selector zero starts at bit zero. Selector one starts at bit eight. Selector two starts at bit sixteen. Multiply the selector by the word width to find the start. The slice always takes eight bits upward from there. Only its start moves. 00:01:25.920 Check the selector before reading the bus Two selector bits give four encodings. The first three have channels; one one has none. Check that the selector is below the channel count before slicing. The invalid branch drives data, valid and parity to zero. The receiver uses valid to tell whether the data can be used. 00:01:48.350 A parity function describes combinational work Once a word is selected, XOR across all its bits. An even count of ones gives zero. In the final vector, channel C gains one bit set to one, so its count becomes odd and parity becomes one. The function reuses the description. Inspect the synthesized circuit to see whether calls share logic. 00:02:14.690 Test the smallest size and unused encodings Test one, three and four channels. With one channel, the selector port still has one bit. With three, one one reports invalid. With four, the same code reads the last word. Run these boundary cases at both word widths to check that the interface still works after elaboration.