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

Reply

VHDL - serial clock generation

 
Thread Tools Search this Thread
Old 08-21-2006, 10:27 PM   #1
Default serial clock generation


Hello,

I've just very recently started VHDL coding, and still unfamiliar with
the proper style of the language.

I am trying to create a serial interface that receives a serial clock
(seperate from system clock), and inverts this clock to make a transmit
clock. What would be the best method to do this? I would appreciate a
snippet of code if possible.

Thank you for your help. So far I have this:

========
-
-

-- into module
ser_clkr <= ser_clkr_i;
ser_clkr_q <= ser_clkr; -- previous val of clkr

--new serial clock to be generated from input of CLKR.
new_clk_gen: process(ser_clkr, ser_clkr_q)
begin
if (ser_clkr_q = '0' and ser_clkr_q = '1') then
ser_clkx <= not ser_clkx;
else
ser_clkx <= ser_clkx;
end process;



vu
  Reply With Quote
Old 08-22-2006, 12:24 AM   #2
Jerrie85
Junior Member
 
Join Date: Aug 2006
Posts: 7
Default
why dont u just transmit_clk <= ~receive_serial_clock;
this is just straight inverter, combination logic


Jerrie85
Jerrie85 is offline   Reply With Quote
Old 08-27-2006, 05:25 PM   #3
Benjamin Todd
 
Posts: n/a
Default Re: serial clock generation
IMHO I think you've got a bit of work to do... The grass roots of VHDL is
good synchronous design practice. Ok, of course it can be much more
complicated that that, but you should start with the idea that you have a
global system reset, and a global system clock, everything that happens in
your design is initialised with the reset, and synchronous to the clock.
every process can then be written as a flip-flop, with combinational logic
behind it.

To give you a head-start with what you wrote...

someprocess : process (clk, rst)
begin
if rst = '1' then
-- here you initialise your signals
elsif rising_edge (clk) then
-- here something happens every rising edge of the clock
end if;
end process;

Use this kind of structure to describe your circuit!

> if (ser_clkr_q = '0' and ser_clkr_q = '1') then


I'm sure you don't mean this!!

> ser_clkx <= not ser_clkx;
> else
> ser_clkx <= ser_clkx;


And this creates a latch... not good!

Go back to basics and consider what is good synchronous design...!!
A good question to start with is how would you make the circuit if you had a
drawer full of 7400s, not an FPGA/CPLD?
Good luck!
Ben




Benjamin Todd
  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
New releases: Game Plan, Daddy Day Camp & Curb Your Enthusiasm: Updated complete R1 DVD DB & info lists Doug MacLean DVD Video 0 11-13-2007 09:52 PM
=> Professional Software CAD CAM CFD GIS ! FTP-Download! UnlockSofts General Help Related Topics 2 07-17-2007 11:44 AM
As growth slows, Hollywood faces a DVD standoff. Allan DVD Video 0 07-11-2005 02:10 PM
New Releases: Revelations, The Librarian & My Left Foot: Updated complete downloadable R1 DVD DB & Info lists Doug MacLean DVD Video 0 05-17-2005 06:57 AM
Hollywood Detective - The Buried Clock David Marsh DVD Video 1 09-27-2004 11:26 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