Skip to main content
added 24 characters in body; edited title
Source Link
toolic
  • 9.8k
  • 9
  • 27
  • 35

Truncate 16-bit number in verilogVerilog

Given [15:0]a [15:0] number (there is no fractional part, only integer). How do I truncate the lower two bits [1:0][1:0] and round it off to the closest possible value.? Consider a case where no overflow happens. NeedI need to do it in verilogVerilog.

input [15:0] A; output [13:0] B;

input [15:0] A;
output [13:0] B;

Truncate in verilog

Given [15:0] number (there is no fractional part, only integer). How do I truncate lower two bits [1:0] and round it off to closest possible value. Consider a case where no overflow happens. Need to do it in verilog.

input [15:0] A; output [13:0] B;

Truncate 16-bit number in Verilog

Given a [15:0] number (there is no fractional part, only integer). How do I truncate the lower two bits [1:0] and round it off to the closest possible value? Consider a case where no overflow happens. I need to do it in Verilog.

input [15:0] A;
output [13:0] B;
Source Link

Truncate in verilog

Given [15:0] number (there is no fractional part, only integer). How do I truncate lower two bits [1:0] and round it off to closest possible value. Consider a case where no overflow happens. Need to do it in verilog.

input [15:0] A; output [13:0] B;