Selecting the output for the ALU.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Selecting the output for the ALU.

ziddy
I believe I'm on the right track as I have implemented each of the 18 functions and they seem to work. Now I have to select the output, but I'm not quite sure how to do that. The problem is that 6 bits are used to select an output, but there's only 18 outputs that need to be implemented - I could create a 6x64 mux chip out of the smaller ones from project 1, with selection bits 0-5 being zx, nx, zy, ny, f, and no respectively, then manually set the inputs accordingly, but that seems very inefficient. I doubt that is the intended way to do this. I'm fairly certain it will work but I wanted to know if there's a better way to do it before I launch in to that.
Reply | Threaded
Open this post in threaded view
|

Re: Selecting the output for the ALU.

cadet1620
Administrator
ziddy wrote
I believe I'm on the right track as I have implemented each of the 18 functions...
This is a very hard way to do the ALU. You should implement the ALU as described in the pseudocode in Figure 2.5. The functions in Figure 2.6 are computed as a result of the way the simple operations controlled by the zx, nx, etc. control signals combine.

There is a worksheet to help you understand how the simple operations combine to make the complex functions happen.

You don't need any parts that you haven't already built. Do carefully read Appendix A.5.3. Note in particular the example that has more than one "out=".

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Selecting the output for the ALU.

ziddy
Okay that makes a lot more sense. I just used 2-way muxes for each of the control bits and got it working, much less code too. Thanks!