00:00:00.000 The select line chooses the data path Last time, a decision let data through. Now a decision chooses a path. Start with two eight-bit channels. Select zero routes the first byte. Select one routes the second. The control line chooses the path and the data lines carry the byte. 00:00:20.090 Specify all four selector values Add a third channel and use two select bits. Zero zero picks A, zero one picks B, and one zero picks C. One one has no channel, so this specification sets data and valid to zero. A valid channel can also carry a zero byte. 00:00:40.665 Map if and case onto the mux An if and else can express a two-input mux. For several exact selector values, a plain case also works. Here each branch drives data and valid together. Pick any row, including the default, and you can find both output values. 00:00:59.420 Which request wins when both are high? Separate request signals may both be high. Here A has priority. If A requests service, the first branch wins. Only when A is low do we test B. Include the both-high row, since single requests pass even with the priority reversed. 00:01:21.470 Removing default retains the previous output Remove default and go from zero one to one one. The complete design clears data and valid. The incomplete design keeps the B byte and valid stays high. Try zero zero followed by one one. This time it keeps A. The output now depends on history. 00:01:43.960 Use synthesis to find the unintended latch The tool sees that the uncovered branch needs the old value. In this lab, synthesis diagnoses an inferred latch in the incomplete combinational block. Check the assignment paths with legacy always star as well. Give each output a clear driver. 00:02:06.130 Trace the order of two assignments Both versions assign both variables. On the left, stage the input before copying it to the output. On the right, the first line sees the previous staged value. The block does not rerun just because it wrote that value itself. 00:02:24.455 Drive both versions with the same input Drive zero, then one, then zero. The repaired output follows the input. The bad version reads X initially, then reads the previous zero and previous one. These are the lab simulation samples. The example has no clock, so do not infer a pipeline stage. 00:02:45.375 Check the structure of a feedback loop When enabled, this mistaken circuit drives an output from its own inverse. Follow the path around the loop. There is no storage element in that path. The lab runs a bounded structure check, since simulators can handle zero-delay loops differently. 00:03:02.660 Restore the required branch and verify it Restore default and replay the same stimulus. Reaching one one from either path now gives zero data and valid low. Inspect the synthesized structure for unintended latches. What happens if the downstream block ignores valid and treats zero as a measurement?