SuperMiguel wrote
So i did all of it... but still unsure on how to pick the operation... I know if i wanted to do x|y it would be: 010101 but how do i input that in?
Look at the column labels at the top of the ALU truth table. Those are all INPUTS to the ALU.
From the description in ALU.hdl:
* The ALU operation can be described using the following pseudocode:
* if zx=1 set x = 0 // 16-bit zero constant
* if nx=1 set x = !x // Bit-wise negation
* if zy=1 set y = 0 // 16-bit zero constant
* if ny=1 set y = !y // Bit-wise negation
* if f=1 set out = x + y // Integer 2's complement addition
* else set out = x & y // Bit-wise And
* if no=1 set out = !out // Bit-wise negation
Each of these lines tell you what logic occurs at that step. The first line tells you that you need some logic controlled by zx that either passes x through unchanged or output a zero. The identical logic block is used to process y and zy. The overall circuit looks like this:
Fill in the functions for the unlabeled blocks and design the logic for those blocks, and you'll have the computation part of the ALU.
I'll leave the status bits for you to do. Be sure that you understand that you can connect more than one wire/bus to the outputs of parts used in your chip.
--Mark