diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2017-01-08 21:58:16 -0600 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2017-01-08 23:18:31 -0600 |
commit | 17f5cbe781ae761d86d55fec7d46ba3172167894 (patch) | |
tree | b02d0dc075eb94a56cccd49a471e852a6799c266 /alu_tb.v | |
parent | 47cfb7ba2df247310e2160e4e53d1843d4e4d1c8 (diff) |
Add carry input to ALU
Diffstat (limited to 'alu_tb.v')
-rw-r--r-- | alu_tb.v | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -11,6 +11,7 @@ module alu_tb (); reg expected_zero; wire carry; reg expected_carry; + reg carry_in; reg [3*8:0] opstr; integer file, r; @@ -24,9 +25,12 @@ module alu_tb (); while (!$feof(file)) begin r = $fscanf(file, " 0x%x %3s 0x%x = 0x%x Z=%x C=%x\n", x, opstr, y, expected_result, expected_zero, expected_carry); + carry_in = opstr == "++" || opstr == "--"; case (opstr) - "+" : op = 0; - "-" : op = 1; + "+" : op = 0; + "++" : op = 0; + "-" : op = 1; + "--" : op = 1; "*" : op = 2; "/" : op = 3; "&" : op = 4; @@ -59,6 +63,7 @@ module alu_tb (); .op(op), .x(x), .y(y), + .carry_in(carry_in), .result(result), .zero(zero), .carry(carry) |