RTL Studio Open IDE

Arithmetic & Math

Clamp Signed 8-bit — L1 Upgrade — L2 Upgrade

Registered signed 8-bit clamp with sticky saturation flag and explicit clear.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Clamp Signed 8-bit — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Arithmetic & Math catalog. Adders, multipliers, dividers, ALUs, and arithmetic datapaths. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements a registered signed 8-bit clamp with sticky saturation flag. It passes input data through when within the valid signed 8-bit range. It detects saturation at the exact boundaries of -128 and 127. The saturation flag is sticky until explicitly cleared by the clear_sat signal. The output is registered on the positive clock edge when enabled.

This module provides a simple registered clamp with sticky saturation detection for signed 8-bit data. It is suitable for applications requiring boundary monitoring with explicit flag management.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Clamp Signed 8-bit — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Registered signed 8-bit clamp with sticky saturation flag and explicit clear.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Features

  • Registered 8-bit signed data path.
  • Sticky saturation flag for boundary conditions.
  • Asynchronous active-low reset.
  • Enable control for data holding.
  • Explicit clear for the saturation flag.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low asynchronous reset
enInput1Enable input
data_inInput8Signed 8-bit data input
clear_satInput1Clear saturation flag input
data_outOutput8Registered signed 8-bit data output
sat_flagOutput1Sticky saturation flag output

Verification

The testbench covers reset behavior, normal clamping, saturation detection, and flag control. All eight test cases passed successfully in the simulation log.

Test CaseDescriptionResult
TC1Reset TestPASS
TC2Normal Clamping PositivePASS
TC3Normal Clamping NegativePASS
TC4Saturation Upper BoundPASS
TC5Saturation Lower BoundPASS
TC6Sticky Flag ClearPASS
TC7Enable ControlPASS
TC8Re-enable and New ValuePASS

More in Arithmetic & Math

All Arithmetic & Math blocks