]> Joshua Wise's Git repositories - fpgaboy.git/commitdiff
explicitly specified widths of comparisons
authorChristopher Zihao Lu <czl@gurgle.weh.andrew.cmu.edu>
Fri, 9 May 2008 06:38:46 +0000 (02:38 -0400)
committerChristopher Zihao Lu <czl@gurgle.weh.andrew.cmu.edu>
Fri, 9 May 2008 06:38:46 +0000 (02:38 -0400)
insn_alu8.v

index b6d4c636820f8c95c337a81a439ae5dd9831fa48..2921b1858a3e9fdffe1b001557e3527a8e3886c4 100644 (file)
@@ -30,7 +30,7 @@
                        case (opcode[5:3])
                        `INSN_alu_ADD: begin
                                `_A <= `_A + tmp;
                        case (opcode[5:3])
                        `INSN_alu_ADD: begin
                                `_A <= `_A + tmp;
-                               `_F <=  { /* Z */ ((`_A + tmp) == 0) ? 1'b1 : 1'b0,
+                               `_F <=  { /* Z */ ((`_A + tmp) == 8'b0) ? 1'b1 : 1'b0,
                                          /* N */ 1'b0,
                                          /* H */ (({1'b0,`_A[3:0]} + {1'b0,tmp[3:0]}) >> 4 == 1) ? 1'b1 : 1'b0,
                                          /* C */ (({1'b0,`_A} + {1'b0,tmp}) >> 8 == 1) ? 1'b1 : 1'b0,
                                          /* N */ 1'b0,
                                          /* H */ (({1'b0,`_A[3:0]} + {1'b0,tmp[3:0]}) >> 4 == 1) ? 1'b1 : 1'b0,
                                          /* C */ (({1'b0,`_A} + {1'b0,tmp}) >> 8 == 1) ? 1'b1 : 1'b0,
@@ -39,7 +39,7 @@
                        end
                        `INSN_alu_ADC: begin
                                `_A <= `_A + tmp + {7'b0,`_F[4]};
                        end
                        `INSN_alu_ADC: begin
                                `_A <= `_A + tmp + {7'b0,`_F[4]};
-                               `_F <=  { /* Z */ ((`_A + tmp + {7'b0,`_F[4]}) == 0) ? 1'b1 : 1'b0,
+                               `_F <=  { /* Z */ ((`_A + tmp + {7'b0,`_F[4]}) == 8'b0) ? 1'b1 : 1'b0,
                                          /* N */ 1'b0,
                                          /* H */ (({1'b0,`_A[3:0]} + {1'b0,tmp[3:0]} + {4'b0,`_F[4]}) >> 4 == 1) ? 1'b1 : 1'b0,
                                          /* C */ (({1'b0,`_A} + {1'b0,tmp} + {8'b0,`_F[4]}) >> 8 == 1) ? 1'b1 : 1'b0,
                                          /* N */ 1'b0,
                                          /* H */ (({1'b0,`_A[3:0]} + {1'b0,tmp[3:0]} + {4'b0,`_F[4]}) >> 4 == 1) ? 1'b1 : 1'b0,
                                          /* C */ (({1'b0,`_A} + {1'b0,tmp} + {8'b0,`_F[4]}) >> 8 == 1) ? 1'b1 : 1'b0,
@@ -57,7 +57,7 @@
                        end
                        `INSN_alu_SBC: begin
                                `_A <= `_A - (tmp + {7'b0,`_F[4]});
                        end
                        `INSN_alu_SBC: begin
                                `_A <= `_A - (tmp + {7'b0,`_F[4]});
-                               `_F <=  { /* Z */ ((`_A - (tmp + {7'b0,`_F[4]})) == 0) ? 1'b1 : 1'b0,
+                               `_F <=  { /* Z */ ((`_A - (tmp + {7'b0,`_F[4]})) == 8'b0) ? 1'b1 : 1'b0,
                                          /* N */ 1'b1,
                                          /* H */ (({1'b0,tmp[3:0]} + {4'b0,`_F[4]}) > {1'b0,`_A[3:0]}) ? 1'b1 : 1'b0,
                                          /* C */ (({1'b0,tmp} + {8'b0,`_F[4]}) > {1'b0,`_A[7:0]}) ? 1'b1 : 1'b0,
                                          /* N */ 1'b1,
                                          /* H */ (({1'b0,tmp[3:0]} + {4'b0,`_F[4]}) > {1'b0,`_A[3:0]}) ? 1'b1 : 1'b0,
                                          /* C */ (({1'b0,tmp} + {8'b0,`_F[4]}) > {1'b0,`_A[7:0]}) ? 1'b1 : 1'b0,
This page took 0.022713 seconds and 4 git commands to generate.