Hey guys!
I'm a new university freshman and new to VHDL.
So recently I've given this sort of assignment,
in class,and some clue codes from professor,but nothing really helps.
The picture in the attachment is the subject I been trying to code.
Here's some partial clue codes provided by professor,of course with some
errors need to correct...
Thanks guys for any thoughts and guide me through this.
edit : errors are :
signal ck1hz : STD_LOGIC_VECTOR (24); <-The expression can not be
converted to type STD_LOGIC_VECTOR.
Q <= Q + '1'; <- + can not have such operands in this context.
ck1hz <= Q(24) => Y when DIR = '1' else DIR = '0'; <- Undefined symbol
'ck1hz'. & parse error, unexpected ROW, expecting SEMICOLON
James Y. wrote:> Here's some partial clue codes provided by professor,of course with some> errors need to correct...
What are your suggestions? What error messages does the toolchain
report? What's wrong in the erronous lines?
James Y. wrote:> Thanks guys for any thoughts and guide me through this.
It's your homework, when you give some reasonable suggestions then maybe
someone will help you further on.
Lothar M. wrote:> James Y. wrote:>> Here's some partial clue codes provided by professor,of course with some>> errors need to correct...> What are your suggestions? What error messages does the toolchain> report? What's wrong in the erronous lines?> signal ck1hz : STD_LOGIC_VECTOR (24); <-The expression can not be converted to
type STD_LOGIC_VECTOR.
Q <= Q + '1'; <- + can not have such operands in this context.
ck1hz <= Q(24) => Y when DIR = '1' else DIR = '0'; <- Undefined symbol
'ck1hz'. & parse error, unexpected ROW, expecting SEMICOLON
>> James Y. wrote:>> Thanks guys for any thoughts and guide me through this.> It's your homework, when you give some reasonable suggestions then maybe> someone will help you further on.
I know I supposed to work out my own homework,but I'm honestly out of
ideas,and the clues aren't helping...I can't see the points where I need
to do.
James Y. wrote:> I can't see the points where I need to do.
You have a sketch of a hardware you have to describe with VHDL.
So
1. describe the prescaler for the 1.5 Hz and
2. the 4 bit counter, connect
3. them together and
4. to the 7 segment decoder.
Check with the internet how to code an incrementing counter in VHDL.
It's important to use the approbiate types und libraries and not to be
confused with the differences beetwenn 1 and '1'.
James Y. wrote:> signal ck1hz : STD_LOGIC_VECTOR (24);
Looks like this should be an alias of Q(24)
> process (CLK,Q)
There are too much sichals in the sensitivity list here.
clk is enough.
> Undefined symbol 'ck1hz'.
Define it in a proper way. And define its name in a way that it matches
the real world: you do not want a 1 Hz clock, you want 1.5 Hz.
BTW: are 1.562 Hz close enough to the 1.5 Hz you want? Then maybe you
can head on with your "2^24 prescaler clock divider", although you
should not use such a "clock-divider-prescaler" design strategy in
modern FPGAs.
Do you have to use as much as you can from that very old fashioned
example? Or can you write code thats more up to date? Code with clock
enables and so on?
All in all my attempt would look like this:
Lothar M. wrote:> Do you have to use as much as you can from that very old fashioned> example? Or can you write code thats more up to date? Code with clock> enables and so on?
I can't be sure,but I don't think there is any limitation.
C. A. Rotwang wrote:> Check with the internet how to code an incrementing counter in VHDL.> It's important to use the approbiate types und libraries and not to be> confused with the differences beetwenn 1 and '1'.
Ok,I'll try to google more information about it as possible.
Lothar M. wrote:> All in all that coding style is far more read- and understandable for> humans. And thats the style I'm teaching my students...
And may I ask,can you recommend a book for me to study VHDL?(I'm using
Xilinx ISE)