summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-01-08 20:08:35 -0600
committerBobby Bingham <koorogi@koorogi.info>2017-01-08 22:02:28 -0600
commitc02ce963b2c1bf9ae3c7247895e6eea467b7fb79 (patch)
treed7ff6d1730c5a2fd66f99c82366cf18fc893a51c
parent21442e752f6198f6343755c05a95b8dbdf87a234 (diff)
Remove redundant otherResult in shifter
The barrel shifter result handles this just as well.
-rw-r--r--shifter.v10
1 files changed, 1 insertions, 9 deletions
diff --git a/shifter.v b/shifter.v
index 4d7b6b6..01fa40c 100644
--- a/shifter.v
+++ b/shifter.v
@@ -16,13 +16,10 @@ module shifter (
extend == 2'b10 ? {16{v[dir == 1'b0 ? 0 : 15]}} : v
};
- wire [15:0] barrelResult;
- wire [15:0] otherResult;
-
wire [4:0] dirAndAmount;
assign dirAndAmount = {dir, by[3:0]};
- assign barrelResult =
+ assign result =
|(by[15:4]) ? x[15:0] :
dirAndAmount == 5'h1F ? {x[14:0], x[31 ]} :
dirAndAmount == 5'h1E ? {x[13:0], x[31:30]} :
@@ -56,9 +53,4 @@ module shifter (
dirAndAmount == 5'h0E ? x[17: 2] :
dirAndAmount == 5'h0F ? x[16: 1] :
x[31:16];
-
- assign otherResult =
- |(by[15:4]) ? x[15:0] : barrelResult;
-
- assign result = extend == 2'b11 ? barrelResult : otherResult;
endmodule