Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - I am having trouble editing a signal in a sub program in vhdl

 
Thread Tools Search this Thread
Old 08-28-2007, 03:03 PM   #1
Exclamation I am having trouble editing a signal in a sub program in vhdl


I declared a signal called reg_A. I then want to edit the signal in another subprogram. I basically want reg_A to be one of my inputs to a sub program (ALU_test) edit reg_A in the subprogram and then I want the output of my subprogram to change reg_A in the main program(test). When I tried to do this an error occurred ("Signal reg_A has multiple sources"). I am not sure what to do could some one please help me.

library ieee;
use ieee.std_logic_1164.all;

entity test is
port ( clk : in std_logic;
choze : in std_logic_vector(3 downto 0);
data_t : in std_logic_vector(7 downto 0);
Outw : out std_logic_vector(7 downto 0));
end entity test;

architecture no1 of test is
------------------------------------------------------------
component ALU_test is
port ( clk : in std_logic;
choose : in std_logic_vector(3 downto 0);
vlaggieIN : in std_logic_vector(7 downto 0);
vlaggie : out std_logic_vector(7 downto 0));
end component ALU_test;
------------------------------------------------------------
signal reg_A : std_logic_vector(7 downto 0);
------------------------------------------------------------
begin
process (clk)
begin
if rising_edge(clk) then
reg_A <= "11111111";
end if;--if rising_edge(clk) then
end process;

r1: ALU_toets4 port map (clk,choze,reg_A,reg_A);

Outw <= reg_A;

end architecture no1;
--------------------------------------------------------------------------
================================================== =======
--------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity ALU_test is
port ( clk : in std_logic;
choose : in std_logic_vector(3 downto 0);
vlaggieIN : in std_logic_vector(7 downto 0);
vlaggie : out std_logic_vector(7 downto 0));
end entity ALU_test;

architecture alu1 of ALU_test is

begin
process (clk)
begin
if rising_edge(clk) then
case choose is
-----------------------------------
-- add
-----------------------------------
when "1000" =>
vlaggie <= "10101011" + vlaggieIN;
-----------------------------------
-- sub
-----------------------------------
when "0100" =>
vlaggie <= "10100100";
-----------------------------------
-- maal
-----------------------------------
when "0010" =>
vlaggie <= vlaggieIN;
-----------------------------------
when others =>
vlaggie <= "00000000";
-----------------------------------
end case;--case kies is

end if;--if rising_edge(clk) then
end process;
end architecture alu1;


Haai
Haai is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
vhdl program to use lcd with wilinx demopanel LemuPT Hardware 0 10-30-2007 06:31 AM
I am having trouble editing a signal in a sub program. Haai Hardware 0 08-28-2007 02:58 PM
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46