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

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

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

endmodule

 

Was this helpful?
Upvote
Downvote