EmbDev.net

Forum: FPGA, VHDL & Verilog Tri state buffer


von vhdl n. (Company: none) (pranoy)


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

von Schlumpf (Guest)


Rate this post
useful
not useful
Vectors: "ZZZZZZ" and not `ZZZZZZ´
Single Signals: '1' and not `1´

von vhdl n. (Company: none) (pranoy)


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

von vhdl n. (Company: none) (pranoy)


Rate this post
useful
not useful
THANKS

Got it.

The high impedence should be Z instead of z. :)

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.