From 062c1aefb313548d71e47127988cb66da6ab588e Mon Sep 17 00:00:00 2001 From: Erick Date: Tue, 8 Mar 2022 13:53:49 +0100 Subject: [PATCH] minor fixes on alu --- cpu/alu/alu.sv | 1 + cpu/alu/lookahead.sv | 14 +++++++------- cpu/cpu.sv | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cpu/alu/alu.sv b/cpu/alu/alu.sv index bcb9abf..08ec301 100644 --- a/cpu/alu/alu.sv +++ b/cpu/alu/alu.sv @@ -47,6 +47,7 @@ always @(*) begin alu_out = tmpOut; end + //TODO: improve this part using increment/decrement logic if (alu_out < 0) flag = 0; // negative flag else if (alu_out = 0) diff --git a/cpu/alu/lookahead.sv b/cpu/alu/lookahead.sv index 617f131..8c141f2 100644 --- a/cpu/alu/lookahead.sv +++ b/cpu/alu/lookahead.sv @@ -4,14 +4,14 @@ package lookahead ( input [15:0]b, ); - res = and16(y, a, b); +res = and16(y, a, b); - for (i=0; i<15 ; i=i+1) - if (res[i] = 0) - carry_bit[i] = 0; - else - carry_bit[i] = 1; - end +for (i=0; i<15 ; i=i+1) + if (res[i] = 0) + carry_bit[i] = 0; + else + carry_bit[i] = 1; end +end endpackage \ No newline at end of file diff --git a/cpu/cpu.sv b/cpu/cpu.sv index e69de29..2b05f67 100644 --- a/cpu/cpu.sv +++ b/cpu/cpu.sv @@ -0,0 +1 @@ +import alu::*; \ No newline at end of file