diff options
Diffstat (limited to 'alu.v')
-rw-r--r-- | alu.v | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -33,7 +33,7 @@ module alu ( wire [15:0] ored; wire [15:0] xored; wire [15:0] shifted; - + assign sum = x + y; assign diff = x - y; assign prod = x * y; @@ -41,7 +41,7 @@ module alu ( assign anded = x & y; assign ored = x | y; assign xored = x ^ y; - + shifter shifter_inst ( .v(x), .by(y), @@ -49,7 +49,7 @@ module alu ( .extend(op[1:0]), .result(shifted) ); - + assign result = op == 4'b0000 ? sum[15:0] : op == 4'b0001 ? diff[15:0] : @@ -60,7 +60,7 @@ module alu ( op == 4'b0110 ? xored : op == 4'b0111 ? x : shifted; - + assign zero = ~(|result); assign carry = op == 4'b0000 ? sum[16] : |