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

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.