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
@@ -5,12 +5,12 @@ module lu_tb #(parameter W=4)();
logic [W-1:0] A;
logic [W-1:0] B;
logic [W-1:0] C;
logic [W-1:0] C_exp[16];
logic [W-1:0] C_exp[16]; // expected values
lu #(W/2) dut(op, A, B, C);
lu #(W/2) dut(op, A, B, C); // width / 2 as was adapted from width-1 being standard
integer error_count;
initial begin
initial begin // only need to check 1 bit for expected functionality
// AND
C_exp[0] = {{W{1'b0}}, {1'b0}};
C_exp[1] = {{W{1'b0}}, {1'b0}};
@@ -36,7 +36,7 @@ module lu_tb #(parameter W=4)();
op = 0;
A = 0;
B = 0;
$display("Beginning LU tests");
$display("Beginning LU tests"); // find difference between calculated and excpected
for (integer N = 0; N < 4; ++N) begin
for (integer M = 0; M < 2; ++M) begin
for (integer K = 0; K < 2; ++K) begin