1
Day 4
NOT SUBMITTED

Day 4

Design and verify a 8-bit ALU which supports the following encoded operations:

EncodingOperationComment
3'b000ADD-
3'b001SUB-
3'b010SLLVector a should left shift using bits 2:0 of vector b
3'b011LSRVector a should right shift using bits 2:0 of vector b
3'b100AND-
3'b101OR-
3'b110XOR-
3'b111EQLOutput should be 1 when equal otherwise 0

Interface Definition

The module should have the following interface:

input     logic [7:0]   a_i,  - First 8-bit input vector
input     logic [7:0]   b_i,  - Second 8-bit input vector
input     logic [2:0]   op_i, - Encoded operation

output    logic [7:0]   alu_o - ALU output

Coding Exercise

You're expected to code both the RTL and testbench for the problem. Your testbench should include the stimulus and checkers.

NOTE

The testcase will show PASSED as long as the RTL and testbench compile, but it doesn't imply that the implemented logic is correct.

If you're interested in learning more about RTL Design and don't want to worry about implementing the checks or the testbench code then I'd recommend the Hands-on RTL Design course. The course contains 25 RTL Design problems to help improve your design skills and comes with a 2-part video solution for every problem.

Challenge

Try solving this problem which deals with designing the ALU for a RISC-V Processor.

PS: Get a sweet 10% off on using my referral code: QS-RF-CFUNHYOW

initializing...

Code editor is disabled. Please use desktop version of the site for a better hands on experience.

Day 4

Design and verify a 8-bit ALU which supports the following encoded operations:

EncodingOperationComment
3'b000ADD-
3'b001SUB-
3'b010SLLVector a should left shift using bits 2:0 of vector b
3'b011LSRVector a should right shift using bits 2:0 of vector b
3'b100AND-
3'b101OR-
3'b110XOR-
3'b111EQLOutput should be 1 when equal otherwise 0

Interface Definition

The module should have the following interface:

input     logic [7:0]   a_i,  - First 8-bit input vector
input     logic [7:0]   b_i,  - Second 8-bit input vector
input     logic [2:0]   op_i, - Encoded operation

output    logic [7:0]   alu_o - ALU output

Coding Exercise

You're expected to code both the RTL and testbench for the problem. Your testbench should include the stimulus and checkers.

NOTE

The testcase will show PASSED as long as the RTL and testbench compile, but it doesn't imply that the implemented logic is correct.

If you're interested in learning more about RTL Design and don't want to worry about implementing the checks or the testbench code then I'd recommend the Hands-on RTL Design course. The course contains 25 RTL Design problems to help improve your design skills and comes with a 2-part video solution for every problem.

Challenge

Try solving this problem which deals with designing the ALU for a RISC-V Processor.

PS: Get a sweet 10% off on using my referral code: QS-RF-CFUNHYOW