Bus Interfaces
8-Bit Address Range Hit
Combinational module for 8-bit address range matching using base and mask inputs.
About this block
Simulate it in the Verilog IDE
8-Bit Address Range Hit is a Verilog reference block in the Bus Interfaces catalog. AXI, APB, Wishbone, and other on-chip bus interface adapters. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.
This IP implements a combinational logic block for 8-bit address range matching. It supports configurable base addresses and bitmasks for flexible range definition. The module outputs a hit signal when the masked address matches the masked base.
The addr_hit_range_8 module performs bitwise AND operations on the input address and base. It compares the results against a provided mask to determine a hit condition. An enable input allows the module to be disabled without affecting downstream logic.
This IP provides a simple and efficient way to check address ranges in 8-bit systems. It is suitable for memory decoding or peripheral selection logic. The design is fully combinational with no internal state. All test cases passed successfully during simulation.
- Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Address Range Hit.
- Read the Verilog module in the editor. The catalog line for this block: Combinational module for 8-bit address range matching using base and mask inputs.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- 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.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
addr | Input | [7:0] | The address signal to check. |
base | Input | [7:0] | The base address for comparison. |
mask | Input | [7:0] | Bitmask defining significant bits. |
enable | Input | 1 | Active-high enable signal. |
hit | Output | 1 | High when address matches base within mask. |
Verification
The testbench verifies four key scenarios for correctness:
- TC1: Exact match with full mask and enable asserted.
- TC2: Masked matching where lower bits are ignored.
- TC3: Output is low when enable is deasserted.
- TC4: No hit when addresses mismatch under full mask.
### Expected Results
After Run Simulation, the Log panel should show:
INFO: TC1 PASS exact matchINFO: TC2 PASS masked matchINFO: TC3 PASS enable=0INFO: TC4 PASS mismatchINFO: PASS
More in Bus Interfaces
- 2-Bit Read/Write Command Decode
- 4-Slot Address Chip-Select Decoder
- 8-Bit Hold-on-Stall Register
- 8-Bit Valid/Ready Register Slice
- 8-Bit Write Merge with Byte Mask
- AHB-Lite Simple Master
- AHB-Lite Single-Beat Master
- AHB-Lite Slave Interface
- APB3 Master (Single-Transaction Pipeline)
- APB3 Master with Burst Support and Backpressure Handling
- APB3 Slave Register Interface
- AXI-Lite 4-Register Bank
- AXI-Lite Read-Only Slave 4 Regs
- AXI-Lite Write-Only Slave 4 Regs
- AXI-Stream 1-to-2 Demux
- AXI-Stream Broadcast 1-to-2