Prev Problem
Next Problem

14. Logical Shifter

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

 

Code

/*Write your code here*/

module shift8(
    input [7:0] A,
    input [2:0] shamt,
    output [7:0] SHL, SHR
);

    assign SHL = (shamt == 0) ? A : A << shamt;
    assign SHR = (shamt == 0) ? A : A >> shamt;

endmodule

 

Was this helpful?
Upvote
Downvote