0

I have two input vectors

wire [4:0] pow;
wire [12:0] number;

and one output vector

wire [43:0] result;

As a result,

result = number * (2 ^ pow)

in programming it will be equivalent of shifting number pow times left. What could be the fastest and least consuming circuit for this task, and how to describe it in Verilog?

Edit: I want to emphasize that question is not only about how to put what I need into Verilog, but also explain what happens behind in synthesis. If writing result = number << pow; as @dave_59 advised causes allocation of thousands of wires and logic elements, I would probably consider synchronous sequential shifter.

Edit1: What I need may be implemented by barrel shifter explained here, but it does not detail how much resources it will take in addition to second size of data_in.

Community
  • 1
  • 1
Anonymous
  • 561
  • 3
  • 7
  • 24

2 Answers2

1

Use a left shift

result = number << pow;
dave_59
  • 39,096
  • 3
  • 24
  • 63
0

I finished implementation of the clone of shifter using vector part-selects, bus size of 31 bits and shifting part of 9 bits added 83 logic elements and 86 combinational functions. I think it is comparable to putting conditional operator.

Anonymous
  • 561
  • 3
  • 7
  • 24