vcom-1576 error with expecting BEGIN

Guest #6708321
Hello!

I'm newbie in this topic, so sorry if I say something dumb. I have the 
following code, which always comeback with a 'vcom-1576 error expecting 
BEGIN at line 12 in ModelSim. What I'm missing from the code?

Thanks for the help in advance!
1
library IEEE;
2
use IEEE.std_logic_1164.all;
3
entity MODULE is
4
port ( X,Y,BIN : in std_logic_vector(3 downto 0);
5
  D  : out std_logic_vector(3 downto 0);
6
  BOUT : out std_logic_vector
7
  );
8
end MODULE;
9

10

11
architecture behavioral of MODULE is
12
p1: process(X, Y,BIN);
13
variable var_D, var_BIN : std_logic_vector(3 downto 0);
14
begin
15
var_BIN := BIN;
16
for j in 0 to 3 loop
17
var_D(j) := X(j) xor Y(j) xor var_BIN;
18
var_BOUT(j) := (not X(j) and Y(j)) or (not X(j) and var_BIN(j)) or (Y(j) and var_BIN(j));
19
end loop;
20
D<=var_D;
21
BOUT<=var_BOUT;
22
end process p1;
23
end behavioral;
Attached files:
Guest #6708653
von -gb-, thank you for understanding the error message, but my problem 
is, where is the begin missing? Because in my code there is the begin at 
line 14, and I don't understand why the program says it's missing...
#6708673
Formatting helps to finde errors. I attatched a formatted version. The 
";" in
p1: process(X, Y,BIN);
is a bug.

There is also no need for variables. So you process boils down to

process (X, Y,BIN) begin
  for j in 0 to 3 loop
    D(j)    := X(j) xor Y(j) xor BIN;
    BOUT(j) := (not X(j) and Y(j)) or (not X(j) and BIN(j)) or (Y(j) and 
BIN(j));
  end loop;
end process;

EDIT: REMOVED VHDL TAGS BECAUSE THEY BREAK FORMATTING !!!!!!1111elf!
Attached files:

Reply

A question of your own? This thread is over 5 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

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.