Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Good practices to handle Empty/Null values in RTL

Joined
Nov 29, 2023
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
32
Hi,

I am designing a module, which operates on an array of integers. The module is designed for a maximum array size of 16 integers, however, it can be less than 16 as well.

I was thinking that when an array of size lesser than 16 is fed to the module, the rest of the positions would assume 'Z' (high impedance/tristate) value.

I would like to ask if there's any better approach, or popular good practices to handle such situations.
 
Solution
I cannot say Z is a good solution for this. Technically, you could make your input look like a tristate bus of sorts, but this is odd. A better solution is to have a little protocol in mind, so the number of expected integers is known in advance. Use an additional port or a FIFO with empty signal utilized to mark there are no more integer values coming.
Consider that 'Z' is no value that can be used for signals in synthesized logic. A separate length value would be a straightforward solution.
 
I cannot say Z is a good solution for this. Technically, you could make your input look like a tristate bus of sorts, but this is odd. A better solution is to have a little protocol in mind, so the number of expected integers is known in advance. Use an additional port or a FIFO with empty signal utilized to mark there are no more integer values coming.
 
Solution
Thanks a lot for the tips! I have added a new port to accept the number of integers, and an internal signal to keep track of the first empty position.
I cannot use FIFO because my logic requires going back and forth across the array.
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top