Tri state buffer

OP (Company: none) #3417911
Rate this post
useful
not useful
1
library ieee;
2
use ieee.std_logic_1164.all;
3

4
entity tristate_buffer is 
5
port (enable: in std_logic;
6
d_in: in std_logic_vector ( 7 downto 0 ) ;
7
d_out: out std_logic_vector (7 downto 0 )) ;
8
end tristate_buffer;
9

10
architecture behavioral of tristate_buffer is
11
begin
12
process (enable,d_in)
13
begin
14
if (enable = 1) then
15
d_out <= d_in;
16
else
17
d_out <= (zzzzzzzz);
18
end if;
19
end process;
20
end behavioral;

what is the error in this program?
i get the following errors when i compile it in modelsim

tri_state_buffer.vhd(14): near "?": syntax error
tri_state_buffer.vhd(17): near "?": syntax error
OP (Company: none) #3418177
Rate this post
useful
not useful
Thanks
1
library ieee;
2
use ieee.std_logic_1164.all;
3

4

5
entity tristate_buffer is 
6
port (enable: in std_logic;
7
d_in: in std_logic_vector ( 7 downto 0 ) ;
8
d_out: out std_logic_vector (7 downto 0 )) ;
9
end tristate_buffer;
10

11
architecture behavioral of tristate_buffer is
12
begin
13
process (enable,d_in)
14
begin
15
if (enable = '1') then
16
d_out <= d_in;
17
else
18
d_out <= ("zzzzzzzz");
19
end if;
20
end process;
21
end behavioral;

now the program is like this.
but new errors are coming like

tri_state_buffer.vhd(19): String literal has a character 'z' not in the 
enumeration type ieee.std_logic_1164.std_logic.

tri_state_buffer.vhd(22): VHDL Compiler exiting

pls help

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now