Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

A High Impedence Shift Register

Hello all,

I'm attempting to modify my code of a serial in parallel out shift register. What I want is a shift register that has a high-impedance instead of a Low. So, for instance, a "normal" shift register would have 01000000 loaded onto it. But I need Z1ZZZZZZ. Here's my attempt:

library ieee; 
use ieee.std_logic_1164.all; 
entity SerialInParallelOut is
	port(CLK, SI, Reset : in std_logic;
						POut : out std_logic_vector(29 downto 0));
end SerialInParallelOut;
architecture shift of SerialInParallelOut is
	signal tmp: std_logic_vector(POut'high downto POut'low);
	begin
		process(CLK,Reset)
			begin
			if Reset = '1' then
				tmp <= "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
			elsif rising_edge(CLK) then
				tmp <= tmp(Pout'high - 1 downto Pout'low) & SI;
			end if;
		end process;
	POut <= tmp;
end shift;

Note the reason I'm attempting to do this are explained in this thread. (http://alteraforums.com/forum/showthread.php?t=32424).

Unfortunately, I get a warning stating that Tri-state node(s) do not directly drive top-level pins. I understand what this warning means: it's stating that tri-state is only available at the output pins. But I'm not quite sure how to modify my code such that only the output pins would have tri-state.

26 Replies