Accelerators · Medium · Verilog, SystemVerilog, VHDL

ReLU with 8-bit Saturation

Implement a hardware activation stage that applies ReLU and saturates positive values to unsigned 8-bit range.

Task

For signed 16-bit x, output 0 when x is negative, x when 0<=x<=255, and 255 when x is greater than 255.

Examples

Constraints

Accelerator verification checklist

Concepts to review

accelerator, relu, quantization, activation

Open ReLU with 8-bit Saturation in the HDLForge interactive editor.

Related problems