siva_7517
Full Member level 2
hi ,
I am tyring to write a code for floating point in verilog, but facing a problem when synthesis. The multiplication is:
data_out = 0.707 x data_in
My coding is written below:
module multiply (data_in, clk, data_out);
input [7:0] data_in;
input clk;
output [7:0] data_out;
reg [7:0] data_out;
reg [9:0] state1;
reg [14:0] temp;
parameter state1 = 10'b 1010011011;
always (@posedge clk)
begin
temp <= data_in * state1;
data_out <= temp << 10;
end
endmodule
Plz correct me if there is error in my coding.
Thanx
I am tyring to write a code for floating point in verilog, but facing a problem when synthesis. The multiplication is:
data_out = 0.707 x data_in
My coding is written below:
module multiply (data_in, clk, data_out);
input [7:0] data_in;
input clk;
output [7:0] data_out;
reg [7:0] data_out;
reg [9:0] state1;
reg [14:0] temp;
parameter state1 = 10'b 1010011011;
always (@posedge clk)
begin
temp <= data_in * state1;
data_out <= temp << 10;
end
endmodule
Plz correct me if there is error in my coding.
Thanx