Added comments to Logic Unit (Q2) and added to submission file

This commit is contained in:
TroubleElectrical committed 2026-09-16 12:38:06 +10:00
1 parent 0947f26727
commit 56ade6b426
3 files changed
+87 -8

No files matched your search

+4 -4
View File
@@ -1,13 +1,13 @@
`ifndef LU_H_SV
`define LU_H_SV
module lu #(parameter width = 2) (
input logic [1:0] op,
input logic [2**width-1:0] A,
input logic [1:0] op, // 2 bit operand
input logic [2**width-1:0] A, // width defined as 2^n
input logic [2**width-1:0] B,
output logic [2**width-1:0] Y);
always_comb begin
case (op)
case (op) // different operations of A and B based on operand
2'b00: Y = A & B;
2'b01: Y = A | B;
2'b10: Y = A ^ B;
@@ -16,4 +16,4 @@ module lu #(parameter width = 2) (
endcase
end
endmodule
`endif
`endif