EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

Clock Edge notation

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - VHDL Language - Clock Edge notation

Goto page Previous  1, 2, 3, ... 104, 105, 106  Next

Kevin Neilson
Guest

Wed Sep 29, 2004 1:37 pm   



"Ray Andraka" <ray_at_andraka.com> wrote in message
news:3F134720.D19A8BCA_at_andraka.com...
Quote:
Mine used a barrel shift in the feedback to get a gain that increased with
the
size of the error. Had to do that to get a quick lock and still be able
to
chase the reference. The reference was derived from a quad encoder on the
mechanical media path. The PLL had to adjust a process to keep a certain
number
of events between encoder pulses. All in all, it was a pretty nasty
problem
because of the dynamics and limited resolution of the encoder.

Kevin Neilson wrote:


I like that idea. Actually, I recalled that mine had a time-varying gain,
but it was much simpler. The gain was high before lock, and after locking,
the gain switched to something lower. The gain was just implemented by
left-shifting the output from the loop filter (which was just a comb or
moving-average filter), so the gain could only be powers of two. Does the
barrel shifter you describe increase the order of the loop? That probably
makes it a lot harder to describe mathematically. I would have liked to do
an analysis of mine, but of course I didn't have time, and for my
application stability was much more important than lock time so I didn't
really have to optimize it.
-Kevin

Kevin Neilson
Guest

Wed Sep 29, 2004 1:37 pm   



"Ray Andraka" <ray_at_andraka.com> wrote in message
news:3F134720.D19A8BCA_at_andraka.com...
Quote:
Mine used a barrel shift in the feedback to get a gain that increased with
the
size of the error. Had to do that to get a quick lock and still be able
to
chase the reference. The reference was derived from a quad encoder on the
mechanical media path. The PLL had to adjust a process to keep a certain
number
of events between encoder pulses. All in all, it was a pretty nasty
problem
because of the dynamics and limited resolution of the encoder.

Kevin Neilson wrote:


I like that idea. Actually, I recalled that mine had a time-varying gain,
but it was much simpler. The gain was high before lock, and after locking,
the gain switched to something lower. The gain was just implemented by
left-shifting the output from the loop filter (which was just a comb or
moving-average filter), so the gain could only be powers of two. Does the
barrel shifter you describe increase the order of the loop? That probably
makes it a lot harder to describe mathematically. I would have liked to do
an analysis of mine, but of course I didn't have time, and for my
application stability was much more important than lock time so I didn't
really have to optimize it.
-Kevin

Kevin Neilson
Guest

Wed Sep 29, 2004 1:37 pm   



"Ray Andraka" <ray_at_andraka.com> wrote in message
news:3F134720.D19A8BCA_at_andraka.com...
Quote:
Mine used a barrel shift in the feedback to get a gain that increased with
the
size of the error. Had to do that to get a quick lock and still be able
to
chase the reference. The reference was derived from a quad encoder on the
mechanical media path. The PLL had to adjust a process to keep a certain
number
of events between encoder pulses. All in all, it was a pretty nasty
problem
because of the dynamics and limited resolution of the encoder.

Kevin Neilson wrote:


I like that idea. Actually, I recalled that mine had a time-varying gain,
but it was much simpler. The gain was high before lock, and after locking,
the gain switched to something lower. The gain was just implemented by
left-shifting the output from the loop filter (which was just a comb or
moving-average filter), so the gain could only be powers of two. Does the
barrel shifter you describe increase the order of the loop? That probably
makes it a lot harder to describe mathematically. I would have liked to do
an analysis of mine, but of course I didn't have time, and for my
application stability was much more important than lock time so I didn't
really have to optimize it.
-Kevin

Kevin Neilson
Guest

Wed Sep 29, 2004 1:37 pm   



"Ray Andraka" <ray_at_andraka.com> wrote in message
news:3F134720.D19A8BCA_at_andraka.com...
Quote:
Mine used a barrel shift in the feedback to get a gain that increased with
the
size of the error. Had to do that to get a quick lock and still be able
to
chase the reference. The reference was derived from a quad encoder on the
mechanical media path. The PLL had to adjust a process to keep a certain
number
of events between encoder pulses. All in all, it was a pretty nasty
problem
because of the dynamics and limited resolution of the encoder.

Kevin Neilson wrote:


I like that idea. Actually, I recalled that mine had a time-varying gain,
but it was much simpler. The gain was high before lock, and after locking,
the gain switched to something lower. The gain was just implemented by
left-shifting the output from the loop filter (which was just a comb or
moving-average filter), so the gain could only be powers of two. Does the
barrel shifter you describe increase the order of the loop? That probably
makes it a lot harder to describe mathematically. I would have liked to do
an analysis of mine, but of course I didn't have time, and for my
application stability was much more important than lock time so I didn't
really have to optimize it.
-Kevin

Kevin Neilson
Guest

Wed Sep 29, 2004 1:37 pm   



"Ray Andraka" <ray_at_andraka.com> wrote in message
news:3F134720.D19A8BCA_at_andraka.com...
Quote:
Mine used a barrel shift in the feedback to get a gain that increased with
the
size of the error. Had to do that to get a quick lock and still be able
to
chase the reference. The reference was derived from a quad encoder on the
mechanical media path. The PLL had to adjust a process to keep a certain
number
of events between encoder pulses. All in all, it was a pretty nasty
problem
because of the dynamics and limited resolution of the encoder.

Kevin Neilson wrote:


I like that idea. Actually, I recalled that mine had a time-varying gain,
but it was much simpler. The gain was high before lock, and after locking,
the gain switched to something lower. The gain was just implemented by
left-shifting the output from the loop filter (which was just a comb or
moving-average filter), so the gain could only be powers of two. Does the
barrel shifter you describe increase the order of the loop? That probably
makes it a lot harder to describe mathematically. I would have liked to do
an analysis of mine, but of course I didn't have time, and for my
application stability was much more important than lock time so I didn't
really have to optimize it.
-Kevin

Jay
Guest

Wed Sep 29, 2004 1:37 pm   



In article se10110_at_yahoo.com says...
Quote:
Hi all.

I was actually thinking about digital PLLs recently when I was doing
investigation on analog PLLs.

Can someone describe the basic parts and operation of a DPLL?
Essentially these are the components I figured would be needed and this
is how the operation might work, I'd appreciate comments....

Just wondering, I never got any responses to my original (and slightly
off-topic) post. Was I off in my design insights? I'm actually thinking
about using my aforementioned design in a project, I would like to know
if it's a good starting point or not...

One thing I was particularly curious about, when thinking about my own
design, do I have to worry about synchronizing / clock domain problems
between the two reference inputs to the loop or does the standard two-
DFF design actually take care of that?

I'm guessing that the *outputs* (Up/Down) from the DFF loop should be
put through a de-metastablizer (two DFF in series or something) since
those outputs could change irrespective of my system clock. Comments?

Oh, finally, is there a better frequency/phase detector than the
standard two-DFF one? I know that the two-DFF one hunts when the
phase/frequency are close to being locked.

Thanks!

-- Jay.

Rudolf Usselmann
Guest

Wed Sep 29, 2004 1:37 pm   



Jasson,

take a look at out free USB 1.1 PHY IP core. It includes
a very simple DPLL. It is written in Verilog however.

Best Regards,
rudi
--------------------------------------------------------
www.asics.ws --- Solutions for your ASIC/FPGA needs ---
----------------- FPGAs * Full Custom ICs * IP Cores ---
FREE IP Cores --> http://www.asics.ws/ <-- FREE IP Cores

Charles M. Elias
Guest

Wed Sep 29, 2004 1:37 pm   



"Brad Smallridge" <bsmallridge_at_dslextreme.com> wrote in message news:<vhav5viql77dbc_at_corp.supernews.com>...
Quote:
It would appear, however, that I can get the Global Signals to work as
inputs. But when I do, then I loose an I/O. That doesn't seem right. Like
buying a three input OR gate and only being able to use two of the inputs at
any one time.

Brad

Brad,

I can't explain the loss of other I/O pins when the global signals are
used. This could be a fitter problem. If it is, I wish you the best
of luck trying to get Cypress to fix it.

We are having a number of difficulties with the 39K device fitter.
One of the scariest ones is this: We successfully fitted a design and
then wished to make a change that involved adding a pin. Since the
prototype board is already wired, we "fixed" the previously fitted
pins prior to fitting the design with the added pin. The design does
not fit. As a sanity check, we removed the new signal from the design
and tried to fit it with the pins "fixed" as the fitter previously
assigned them. The design will not fit. If we remove the compiler
directive that keeps the pinout from changing, the design will fit and
has the same pinout that we instructed it to keep. This does not bode
well for future designs where one wants to make a change without
changing the pin assignments previously made.

I am sorry to report that Cypress seems unwilling to fix this and
several other problems with the 39K fitter.

Best regards,

Charles

Ray Andraka
Guest

Wed Sep 29, 2004 1:37 pm   



No it was a fixed second order loop. The barrel shifts just increased the
gain.

Kevin Neilson wrote:

Quote:
"Ray Andraka" <ray_at_andraka.com> wrote in message
news:3F134720.D19A8BCA_at_andraka.com...
Mine used a barrel shift in the feedback to get a gain that increased with
the
size of the error. Had to do that to get a quick lock and still be able
to
chase the reference. The reference was derived from a quad encoder on the
mechanical media path. The PLL had to adjust a process to keep a certain
number
of events between encoder pulses. All in all, it was a pretty nasty
problem
because of the dynamics and limited resolution of the encoder.

Kevin Neilson wrote:


I like that idea. Actually, I recalled that mine had a time-varying gain,
but it was much simpler. The gain was high before lock, and after locking,
the gain switched to something lower. The gain was just implemented by
left-shifting the output from the loop filter (which was just a comb or
moving-average filter), so the gain could only be powers of two. Does the
barrel shifter you describe increase the order of the loop? That probably
makes it a lot harder to describe mathematically. I would have liked to do
an analysis of mine, but of course I didn't have time, and for my
application stability was much more important than lock time so I didn't
really have to optimize it.
-Kevin

--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
401/884-7930 Fax 401/884-7950
email ray_at_andraka.com
http://www.andraka.com

"They that give up essential liberty to obtain a little
temporary safety deserve neither liberty nor safety."
-Benjamin Franklin, 1759

Glen Herrmannsfeldt
Guest

Wed Sep 29, 2004 1:37 pm   



"Jason Berringer" <look_at_bottom_of_at_email.com> wrote in message
news:kJCVa.3413$Cx4.543634_at_news20.bellglobal.com...
Quote:
Hello, I have attached a portion of code for a binary to bcd counter, 20
bits parallel input, and a 24 bit BCD output parallel. Although internally
it converts it to serial to go through the conversion. I'm attempting the
shift and add three (if greater than or equal to 5) method, but I am
having
some problems. It works great on the simulator (Aldec Active HDL) and I
can
synthesize it but when I put it on the chip I'm getting some odd things. I
am using 16 input toggle switches and i debounced pb switch as a load
switch, and my outputs are LEDs. When I set this up on the board my
outputs
go as follows:

The attachment didn't come through. Can you just include some of the code
in the body, instead of an attachment?

-- glen

Glen Herrmannsfeldt
Guest

Wed Sep 29, 2004 1:37 pm   



"Glen Herrmannsfeldt" <gah_at_ugcs.caltech.edu> wrote in message
news:MzFVa.9078$cF.2637_at_rwcrnsc53...
Quote:

"Jason Berringer" <look_at_bottom_of_at_email.com> wrote in message
news:kJCVa.3413$Cx4.543634_at_news20.bellglobal.com...
Hello, I have attached a portion of code for a binary to bcd counter, 20
bits parallel input, and a 24 bit BCD output parallel. Although
internally
it converts it to serial to go through the conversion. I'm attempting
the
shift and add three (if greater than or equal to 5) method, but I am
having
some problems. It works great on the simulator (Aldec Active HDL) and I
can
synthesize it but when I put it on the chip I'm getting some odd things.
I
am using 16 input toggle switches and i debounced pb switch as a load
switch, and my outputs are LEDs. When I set this up on the board my
outputs
go as follows:

The attachment didn't come through. Can you just include some of the code
in the body, instead of an attachment?

OK, it did come through but I was looking in the wrong place. Still, it is
often easier just to include it.

I am much better at reading verilog than VHDL, but it doesn't look right to
me. Though I think I don't understand the algorithm, I think it needs to be
more complicated than that, though if you do an iterative algorithm it might
not be so hard. How many clock cycles does it take to get the data from
input to output? How many different values did you put through the
simulator in testing?

-- glen

Glen Herrmannsfeldt
Guest

Wed Sep 29, 2004 1:37 pm   



"Jason Berringer" <look_at_bottom_of_at_email.com> wrote in message
news:IlGVa.3393$mv6.617644_at_news20.bellglobal.com...
Quote:
Here is the code (after my text) instead of an attachment in case others
cannot read it.

It takes (or should take) 20 to 21 clock cycles to get the data from the
input to the output. I put a few numbers through the simulation the only
correct values are 0 and 1, all other tested were incorrect. I'm pretty
sure
it's a simple error that I'm not catching, I just can't see it at present.
Most of the stuff that I have done has been a bit more simple than this.
The
algorithm works from a sample I've seen (no code just an explanation).
Start
by shifting the most significant bit of your binary number into the least
significant bit of your "units" bcd value, when the number in the "units"
value is 5 or greater add 3 to it. Shift again, if the value is 5 or
greater
add 3 to it, the values will continue to spill over to the "tens",
"hundreds", "thousands", etc. You must add 3 to each of the bcd digits if
any is five or greater, by the last shift (same number of shifts as your
input binary value (in my case 20 bits)) you'll have the bcd
representation.
The example I mentioned above was for a microcontroller.

As I said, I read Verilog much better than VHDL. I didn't even notice the
loop yesterday, which is why I didn't think it was complicated enough. OK,
thought for today:



(snip)

Quote:
elsif rising_edge(clk) then

Does the following generate a gated clock?

Quote:
if shift_en_s = '1' then

The following statement must be done before the rest. While simulators may
execute them in order, synthesized logic tends to execute them all at the
same time.

Quote:
bcd_value := bcd_value(22 downto 0) & ser_out_s;
bcd_out_s <= bcd_value;

Does this generate a gated clock? Can you do it in traditional synchronous
logic form, where either the previous contents, or the contents with "0011"
added are loaded back in? (Also with the shift_en_s enable.)

Quote:
if bcd_value(3 downto 0) >= "0101" then
bcd_value(3 downto 0) := bcd_value(3 downto 0) + "0011";
end if;

(snip)

Gated clocks are especially hard in FPGA's.

-- glen

Mike Treseler
Guest

Wed Sep 29, 2004 1:37 pm   



Glen Herrmannsfeldt wrote:

Quote:
Does the following generate a gated clock?
if shift_en_s = '1' then

Not if it follows the line

elsif rising_edge(clk) then

in a synchronous process.

It's the process template that
gives you a synchronous clock, not
any single sequential statement.

Quote:
The following statement must be done before the rest. While simulators may
execute them in order, synthesized logic tends to execute them all at the
same time.


bcd_value := bcd_value(22 downto 0) & ser_out_s;
bcd_out_s <= bcd_value;

Actually, the synth will give you a netlist that simulates
the same as that code, executed in order.

Sequential statements execute in zero sim time.
The only delay is for rising_edge(clk).

Your code is a hardware specification that can only
be completely understood in the context of simulation. There is
usually no one-to-one correspondence between code statements
and the synthesis netlist components.

Quote:
Does this generate a gated clock? Can you do it in traditional synchronous
logic form, where either the previous contents, or the contents with "0011"
added are loaded back in? (Also with the shift_en_s enable.)


if bcd_value(3 downto 0) >= "0101" then
bcd_value(3 downto 0) := bcd_value(3 downto 0) + "0011";
end if;

This synthesizes nothing unless bcd_value is assigned
directly or indirectly to an entity port.

If this assignment occurs within a synchronous process,
the output will be registered by clk.

Quote:
Gated clocks are especially hard in FPGA's.

If you stick to the synchronous process template, you
will never have one to worry about.

-- Mike Treseler

Mike Treseler
Guest

Wed Sep 29, 2004 1:37 pm   



Paul Leventis wrote:
Quote:
Hi Jason,

First off, that's a pretty cool little algorithm... had to prove to myself
that it worked. ...

I'm not sure that I've found the problem with your code, ...

The best and quickest way to do both is to write a testbench an run a sim.
This quickly resolves all questions about how the langage works
and how the logic functions.

Quote:
(0) I think the first problem is a lack of comments... uncommented code is
always wrong Smile

My favorite comments are a plain text description at the top of each
process about function and handshake protocols.
These can be collected at the top of the architecture after the
sim is working.

Detail comments at the end of line, can often be replaced by
by well-named statement labels, constants and variables.


Quote:
(1) Process #3. I hate variables. Especially variables mixed with
signals...

Signals are the only way in and out of a process.

Quote:
you must be very disciplined when using variables (I only use
them in for loops...). So I honestly don't know what the code will
translate into, as you are assigning a value to variable, then assigning to
the variable to a signal, then changing the value of the variable.

In the case referenced, the first value is exported to the signal at
the next clk and the second value is held by the variable until the next clk, if
it is needed.

This is not as complex as you think. Variables are stuck inside the process.
They only reach the entity ports if you make a signal assignment inside
the process. Synthesis will use a register to save the variable's *final* value.
only if this value is needed at the next clk.

Run a sim sometime, and watch the variables as you trace code.

-- Mike Treseler

Peter Alfke
Guest

Wed Sep 29, 2004 1:37 pm   



Here is a time-proven hardware design for bit-serial binary to parallel
BCD conversion. (I published this in 1973 in the Fairchild TTL
Applications Handbook).

Implement a bunch of 4-bit loadable shift register, but do not
interconnect them.
For each shift register drive a 4-bit adder (without carry in, but with
carry output) from the 4 shift register outputs. Put a binary eleven (B)
as other input on the adder.
Connect the adder outputs to the shift register load inputs, but skewed
one position downstream ( bit 0 of the adder drives bit 1 of the shift
register ).
Then use the carry output as load enable for "its" shift register, and
also as input for the LSB of the downstream shift register ( both as
shift- and as load- input)
The S3 output ( most significant sum) goes nowhere. That's it.

Shifting in binary data (MSB first) doubles the binary value on every
shift. The adder monitors this and, on its carry output, signals that
there is a value 5 or larger, which needs intervention: add 3 before the
next shift ( which is equivalent to adding 6 after having shifted it)
and load a carry into the next higher bit position.
The neat trick is that the 4-bit adder simultaneously adds eleven to
create a carry that detects the need for modification, and also adds
three to do the modification.

Shift in binary data, MSB first, and watch the BCD develop on the
parallel shift register outputs. Note that BCD needs more bit positions
than binary, so leave some headroom.
Works like a champ, flawlessly since 30 years ago.

Peter Alfke, no longer at Fairchild (but it was an interesting 10 years)
====================

Mike Treseler wrote:
Quote:

Paul Leventis wrote:
Hi Jason,

First off, that's a pretty cool little algorithm... had to prove to myself
that it worked. ...

I'm not sure that I've found the problem with your code, ...

The best and quickest way to do both is to write a testbench an run a sim.
This quickly resolves all questions about how the langage works
and how the logic functions.

(0) I think the first problem is a lack of comments... uncommented code is
always wrong :-)

My favorite comments are a plain text description at the top of each
process about function and handshake protocols.
These can be collected at the top of the architecture after the
sim is working.

Detail comments at the end of line, can often be replaced by
by well-named statement labels, constants and variables.

(1) Process #3. I hate variables. Especially variables mixed with
signals...

Signals are the only way in and out of a process.

you must be very disciplined when using variables (I only use
them in for loops...). So I honestly don't know what the code will
translate into, as you are assigning a value to variable, then assigning to
the variable to a signal, then changing the value of the variable.

In the case referenced, the first value is exported to the signal at
the next clk and the second value is held by the variable until the next clk, if
it is needed.

This is not as complex as you think. Variables are stuck inside the process.
They only reach the entity ports if you make a signal assignment inside
the process. Synthesis will use a register to save the variable's *final* value.
only if this value is needed at the next clk.

Run a sim sometime, and watch the variables as you trace code.

-- Mike Treseler


Goto page Previous  1, 2, 3, ... 104, 105, 106  Next

elektroda.net NewsGroups Forum Index - VHDL Language - Clock Edge notation

Ask a question - edaboard.com

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony