From c02ce963b2c1bf9ae3c7247895e6eea467b7fb79 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 8 Jan 2017 20:08:35 -0600 Subject: Remove redundant otherResult in shifter The barrel shifter result handles this just as well. --- shifter.v | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'shifter.v') 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 -- cgit v1.2.3