An assignment question.
Well you're supposed to work out what the circuit is from the written Verilog. There are many code templates for things on the net.
An assignment question.
Well you're supposed to work out what the circuit is from the written Verilog. There are many code templates for things on the net.
Start off by breaking down the problem into manageable and comprehensible pieces and what is obvious:
We know we have "inputs", "outputs", "an ALU", "some combinatorial logic" that controls the output of the signal.
We *need* to know how to implement the combinatorial logic, to control if the output is from the ALU or is 8'b00000000
A mux will be needed.
Now how to implement the control logic? You can draw a truth table to help figure that out. Also, you can use a Karnaugh Map to reduce the control logic into the minimal number of gates.