Prev Problem
Next Problem

51. Opcode Decoder

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

simply using a left shift operator, or using a case statement 

 

Code

module alu_decoder (
    input  [1:0] opcode,
    output [3:0] alu_op
);
    assign alu_op = 4'b0001 << opcode;
endmodule

// can also be written using case statement

 

Was this helpful?
Upvote
Downvote