Mon, 19 Sep 2011, 03:38
Before I get to the student's question involving Problem 13: I do not know how many of you are obsessed with muxes to the point that the answer to every question is "tweak a mux." If muxes are still problematic, perhaps the first step is to read Section 3.3.2 in the book. Muxes have a well known purpose in our design of computers. They can also be used as logic building blocks if desired, but that is not their primary purpose. I am going to be very unhappy with myself that I assigned problem 6B if you end up thinking mux is the answer, independent of the question! Problem 6B was assigned simply to stretch your brain in a non-standard way, and NOT to provide you with a universal tool. Problem 13 asks you to design the combinational logic to satisfy a particular situation we discussed in class: what floor do we ask the elevator to take us to. As we discussed in several examples in class (the full adder circuit, the fancy alarm clock circuit, etc.) such a problem can be described with a truth table, and the logic circuit to implement that truth table is a column of AND gates whose outputs are inputs to a column of OR gates. A student writes: > Dr. Patt, > > For the elevator question, do we just modify a mux to output a floor? (Such > as changing it so that it will check whether the inputs are adjacent > floors.) > Are there any hints you can give? > > <<name withheld to protect the student preoccupied with muxes>> The problem can be described as a box (in engineering, we often refer to such a box as a "black box," indicating that we are simply observing its input/output behavior), as follows: ---------- | | current floor ---->| | | |----> floor to go to floor requested ---->| | | | ---------- What will the truth table look like? Recall I need to know the current floor and the floor being requested. How many rows in the truth table? How many output columns do I need? Recall I need to know the floor that will be requested. Once you correctly specify the truth table, the logic implemenation should be a piece of cake. Just connect the correct outputs of AND gates to inputs of OR gates and we are done! Incidentally, in answer to a student question, we specified that if the floor requested was one above or one below the current floor, the output would be the current floor. That is, we do not allow the elevator to move. OK? ps. For those of you that would enjoy a more sophisticated problem, we could allow the inputs to be the floors pushed, and the outputs be the floors the elevator will stop at. For those of you who would NOT enjoy the more sophisticated elevator problem, feel free to stop reading here! The black box would then look like this: ------------- going up ------>| | current floor -->| |---> stop at 1 request 1 ------>| |---> stop at 2 request 2 ------>| |---> stop at 3 request 3 ------>| |---> stop at 4 request 4 ------>| |---> change direction 1 already req -->| | 2 already req -->| | 3 already req -->| | 4 already req -->| | ------------- The current floor is a 2-bit input. the other nine inputs are 1 bit each. All five outputs are 1 bit each. We can assume that if the button you request is below your current floor and you are going up, it will not register. (Similarly, for going down.) With such an elevator, some of the 2048 input combinations can never happen. For example, if the elevator is going up and you are on floor 2, you can not have 1 already requested. Why? Because if the elevator had stopped at 1 before moving to 2, that button would have been cleared. If you feel inclined to spend time on this problem, please do so ONLY if you are solid on everything else in 306, 302, your math course, AND you have already telephoned your parents to tell them Dr. Patt may be working you too hard, but you are okay! Yale Patt