- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for example:
"56783"seconds turn into the format of "h:m:s" is "15:46:23". I used the method of comparasion,i.e.confirm the hours first, 15*3600 < 56783 < 16*3600,so I confim the hour is 15. Then,comfirm the minutes is 46... But the question is that the "<" or ">" is rather delayed,a long path generated. So ,I want to ask a advice:can I find another way to realize the function ,not using the "<" and ">"? Thank U !Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in what? what language?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
verilog.......
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In vhdl, you can run multiple counters on the 1 sec clock edge:
if(Seconds /= 59) then
Seconds <= Seconds + 1;
else
Seconds <= (others => '0');
if(Minutes /= 59) then
Minutes <= Minutes + 1;
else
Minutes <= (others => '0');
if(Hours /=23) then
Hours <= Hours + 1;
else
Hours <= (others => '0');
end if;
end if;
end if;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We don't expect to use the "/=" ,it causes delay.
when the value of seconds is big,it may need several clocks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is a comparator either way (= checks all bits, /= checks all bits). Any difference in implementation or length of paths is target/tool dependant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok
thank u a lot!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- We don't expect to use the "/=" ,it causes delay. when the value of seconds is big,it may need several clocks. --- Quote End --- There is no big value for seconds. Its counter goes 0 ~ 59. You count on clock edge every 1sec time.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page