EmbDev.net

Forum: FPGA, VHDL & Verilog vcom-1576 error with expecting BEGIN


von SilentRoar (Guest)


Attached files:

Rate this post
useful
not useful
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;

von -gb- (Guest)


Rate this post
useful
not useful
The word "begin" is missing. This is exactly what the error message 
says.

von SilentRoar (Guest)


Rate this post
useful
not useful
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...

von FPGA NOTFALLSEELSORGE (Guest)


Rate this post
useful
not useful
At line 12.

-gb- wrote:
> This is exactly what the error message says.

von FPGA NOTFALLSEELSORGE (Guest)


Rate this post
useful
not useful

von Gustl B. (-gb-)


Attached files:

Rate this post
useful
not useful
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!

: Edited by User

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig