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.

How to check for invalid data

Status
Not open for further replies.

nesta

Junior Member level 2
Joined
Feb 19, 2010
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,466
Hi VhdlExperts,

Is there a way to check if the vector is uninitialsed 'U' or unknown 'X' as i have a scenario where i need to check for only valid data.

Basically I want to latch only valid data.

----
if(clk ='1' and clk'event) then
if(input = 'U' or input = 'X') then
-- just ignore;
else
-- latch the data;
end if;
end if;


Any suggestion plz,

Thanks in advance.
Nesta
 

You can only do such things in simulation, not when you synthesize logic for real hardware. In real hardware you need another signal to indicate if the data is valid or not.
 
  • Like
Reactions: zel

    zel

    Points: 2
    Helpful Answer Positive Rating
Is there a way to check if the vector is uninitialsed 'U' or unknown 'X' as i have a scenario where i need to check for only valid data.

In software, we need to initialize variables because these values are stored in the program memory which may contain any previously stored values , so the term 'un-initialized' is valid.

In HDL languages it is different, we write code to be transferred to hardware, i.e. when you write a code for 2-input AND gate there is no meaning to initialize the inputs of the gate. You can fix the inputs of the gate to logic '0' or logic '1' but there is nothing that makes the input initially pulled low or high then it accepts normal inputs.

The logical values 'U' and 'X' can be used by simulation to indicate strange connections in your code only...

regards,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top