Antares.
Newbie level 4
- Joined
- Feb 21, 2014
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 33
Hi, I'm working on a verilog code wherein i have to concantenate the results of two operations. Like, the result of first operation is 6 stored in temp1 and the second operation is 25 stored in temp2. I want to concantenate these two to get 625, but when i synthesize the code the numbers are internally processed in hex and concantenated output {temp1,temp2} is not 625....please help me.
Here is the code, its supposed to perform multiplication using Vedic math algorithm. the results of temp1 and temp2 are the LHS and RHS of the final product, so i've to concantenate those two.
Here is the code, its supposed to perform multiplication using Vedic math algorithm. the results of temp1 and temp2 are the LHS and RHS of the final product, so i've to concantenate those two.
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 module M1(a,b,p); input [15:0] a, b; output [31:0] p; reg [31:0] p; reg [15:0] temp1, temp2; always @ (a or b) begin temp1 = (a - 1); temp2 = (b - temp1); p <= {temp1|temp2}; end endmodule
Last edited by a moderator: