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

Reply

VHDL - newbie question

 
Thread Tools Search this Thread
Old 05-15-2004, 12:05 AM   #1
Default newbie question


Dear Comp.lang.vhdl,

I've been trying to write a simple free running 8 bit counter. Here's
the source I got so far:

// Module Declaration
module counter
(
clk, out
);
// Port Declaration
input clk;
output [7:0] out;
reg [7:0] counter;

always @(posedge clk)
begin
counter = counter + 1;
out = counter;
end

endmodule

The Quartus compiler tells me that there's an
"Error: Verilog HDL Procedural Assignment error at counter.v(21):
illegal Procedural Assignment to nonregister data type out"

What am I doing wrong?

Thanx in advance,

Florian



Florian Student
  Reply With Quote
Old 05-15-2004, 12:31 AM   #2
paris
 
Posts: n/a
Default Re: newbie question

"Florian Student" <> escribió en
el mensaje news:c83jec$6d9$...
> Dear Comp.lang.vhdl,
>
> I've been trying to write a simple free running 8 bit counter. Here's
> the source I got so far:
>
> // Module Declaration
> module counter
> (
> clk, out
> );
> // Port Declaration
> input clk;
> output [7:0] out;
> reg [7:0] counter;
>
> always @(posedge clk)
> begin
> counter = counter + 1;
> out = counter;
> end
>
> endmodule
>
> The Quartus compiler tells me that there's an
> "Error: Verilog HDL Procedural Assignment error at counter.v(21):
> illegal Procedural Assignment to nonregister data type out"
>
> What am I doing wrong?
>
> Thanx in advance,
>
> Florian
>


well, like you said, this is comp.lang.VHDL and your code is in Verilog
if you dont get the answers here you could try comp.lang.verilog
just in case, Verilog and VHDL (VHSIC HDL) are different HDLs





paris
  Reply With Quote
Old 05-15-2004, 07:14 AM   #3
Dave Townsend
 
Posts: n/a
Default Re: newbie question
I believe you need to declare the output port as a register. It is
not legal in verilog to assign in a always block to a wire ( plain old
port).

dave


"paris" <> wrote in message
news:c83ksv$nol$...
>
> "Florian Student" <> escribió en
> el mensaje news:c83jec$6d9$...
> > Dear Comp.lang.vhdl,
> >
> > I've been trying to write a simple free running 8 bit counter. Here's
> > the source I got so far:
> >
> > // Module Declaration
> > module counter
> > (
> > clk, out
> > );
> > // Port Declaration
> > input clk;
> > output [7:0] out;
> > reg [7:0] counter;
> >
> > always @(posedge clk)
> > begin
> > counter = counter + 1;
> > out = counter;
> > end
> >
> > endmodule
> >
> > The Quartus compiler tells me that there's an
> > "Error: Verilog HDL Procedural Assignment error at counter.v(21):
> > illegal Procedural Assignment to nonregister data type out"
> >
> > What am I doing wrong?
> >
> > Thanx in advance,
> >
> > Florian
> >

>
> well, like you said, this is comp.lang.VHDL and your code is in Verilog
> if you dont get the answers here you could try comp.lang.verilog
> just in case, Verilog and VHDL (VHSIC HDL) are different HDLs
>
>
>





Dave Townsend
  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
Sorry for the painfully newbie question Chip L DVD Video 2 03-20-2007 03:25 PM
Newbie PC DVD region question Geoff B DVD Video 8 03-11-2006 05:48 AM
Another newbie question Jerold Pearson DVD Video 1 12-11-2004 02:25 AM
Newbie Question: DVD Capacities Chris Kotchey DVD Video 3 09-29-2004 03:49 PM
Newbie Question Jeff Turl A+ Certification 6 10-18-2003 10:16 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