chenghaibo
Newbie level 2
hi,everybody.
i need the follow code to be writen in vhdl.
//function:convert gray code to binary
module gray2bin (gray, bin);
parameter SIZE = 4;
input [SIZE-1:0] gray;
output [SIZE-1:0] bin;
reg [SIZE-1:0] bin;
integer i;
always @(gray) for (i=0;i<SIZE;i=i+1) bin = ^(gray >> i);
endmodule
//
i know the code's meanings in verilog ,but my project is in vhdl,so i have to convert it to vhdl.
problem is that i don't know how to deal with the >> operation in vhdl.
can anybody help me?
i need the follow code to be writen in vhdl.
//function:convert gray code to binary
module gray2bin (gray, bin);
parameter SIZE = 4;
input [SIZE-1:0] gray;
output [SIZE-1:0] bin;
reg [SIZE-1:0] bin;
integer i;
always @(gray) for (i=0;i<SIZE;i=i+1) bin = ^(gray >> i);
endmodule
//
i know the code's meanings in verilog ,but my project is in vhdl,so i have to convert it to vhdl.
problem is that i don't know how to deal with the >> operation in vhdl.
can anybody help me?