Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

Comparison with 0 or 1, to detect high impedence

$
0
0
Hi,


I know that its not allowed to compare with 'X' or 'Z' in a synthesizable VHDL code. But is it allowed to write a code in which I compare a signal to '0' or '1' to detect an 'Z' and suspend the operation? The code is as follows:

process(clk)
begin
if rising_edge(clk ) then
if(rst = '0') then
reg_0 <= (others => 'Z');
elsif(btf_start = '1') then
reg_0 <= "ZZ" & frame_in;
elsif(t_btf_finish = '1') then
reg_0 <= (others => 'Z');
end if;
end if;
end process;


process(clk)
begin
if rising_edge(clk) then
if(reg_0(0) = '0' or reg_0(0) = '1') then
-- DO SOME OPERATIONS
else
-- DO NOTHING
end if;
end if;
end process;

Viewing all articles
Browse latest Browse all 19390


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>