Laboratory Experiment #5: Scalable Multiplexer Ari Mahpour ECE 526 Lab Student ID #: 101146706 Table of Contents Purpose....................................................................................... 3 Test Strategy ............................................................................... 4 Results ........................................................................................ 4 Conclusion .................................................................................. 5 Waveform Diagram .................................................................... 7 Purpose The purpose of this lab was to create a scalable multiplexer. This entailed designing a multiplexer that could be used for any size. Utilizing the techniques we had just learned in the corresponding lecture class, we were to implement the parameter function and use it to its full functionality. We were instructed to design a test bench that would instantiate several multiplexers of ranging sizes. In this laboratory experiment, the sizes varied on the student ID number. In this particular case, the sizes of one, six, and seven were used. When instantiating the multiplexers, the following conditions were to be used: for the multiplexer of size one, it was to be instantiated using the default size (which was to be specified in the scalable multiplexer module itself). For the multiplexer of size six, the “defparam” directive was used to override the original (parameter) size of one. For the largest multiplexer, that of size seven, the instantiation parameter override was to be used over the original size of one. Aside from implementing the parameter override operations into our code, the conditional operator was another important function which was used in our module for this laboratory experiment. It functions just like a multiplexer, hence, the use of it and only it was incorporated into the module’s code. No other code was necessary since the conditional operator did the job quite well. It had compared all the bits (no matter what size) and would output an “x” for any discrepancy between two inputs when the select line was on “x” (see conclusion for more details and answer to laboratory manuals question). Test Strategy The test for this laboratory experiment was rather straight forward. It was necessary to test a very limited amount of vectors since an exhaustive test was performed on a similar (but not completely the same) multiplexer made of primitive gates from a previous lab. The strategy for this test bench was to examine how the conditional operator functioned and to determine why it was better than the original multiplexer constructed in experiment #1. In order to perform this test, a mere five test lines were required. The first two test were to ensure that the select would select the proper input and display that as its output. The second test was to compare two of the same exact inputs with the select line on “x.” The fourth test was to compare to different inputs with the select line on “x.” The last test would check to see what the “z” input would do in the case of the sleect line.Though this is not even close to an exhaustive test, it would serve the purpose of what behaviors needed to be observed in this laboratory experiment. Results The first two tests proved to be a success. When the select line was pointed to the desired input, it would output that same value. This was also the case no matter what size the vector was. Each multiplexer’s input values were scaled down from the maximum inputs and directed towards its own input. For example, the multiplexer of size seven’s input values were seven bits but the multiplexer of size six would not be able to take a seven bit input. Thus, the seven bits were scaled down to six bits (and so on for the other multiplexer), removing the most significant bit (respectively for as many times as needed). The third test was the real test of the conditional operator. Unlike the behavior of the first multiplexer was that implemented in experiment #1, an input of “x” did not necessary produce an output of “x.” In this case it first evaluated the inputs and then determined if the output was truly “x” or not. Since both inputs had equaled each other, it didn’t make a difference which select line was chosen since the output would be the same either way. Therefore, the output was the same as both inputs. When the inputs where different, however, as seen in the fourth test case, the output would produce an “x” (functioning also as a comparator). The last test, “z” on the select line performed exactly like the “x” on the select line did. Conclusion This lab was very important with respect to implementing new concepts learned in the corresponding lecture class. It gave us practice with using the parameter function and also its corresponding override functions. Another important part to this lab was observing the behavior of the conditional operator. As asked in the laboratory manual, it is important to determine how the conditional operator is different from the gate-level multiplexer that was designed in the experiment #1. The multiplexer in experiment #1 would select an input and display it (just like the conditional operator which was implemented in this laboratory experiment). The real difference is when using the texting vector of “x” with respect to the select line input. When the values where the same (and select was “x”) the conditional operator would function as a comparator and determine that no matter which line was selected the output would be the same, therefore, the output would be the same as both inputs. In the case of the gate-level multiplexer, only zero was recognized as a double input and outputted as zero when select was “x.” It also did not compare each value between bits (which is a crucial difference). Waveform Diagram I hereby attest that this lab report is entirely my own work. I have not copied either code or text from anyone, nor have I allowed or will allow anyone to copy my work. Name (printed): ______________________________________ Name (signed): ______________________________________ Date: ___________________