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

Reply

VHDL - Beginner: Simple D latch

 
Thread Tools Search this Thread
Old 08-19-2004, 10:50 AM   #1
Default Beginner: Simple D latch


HI,

I was solving the following question and came up with a solution. I
am a beginner and sloving the exercises from Ashenden's "Designer's
guide for VHDL".
DEVELOP A BEHAVIORAL MODEL FOR A D LATCH WITH A CLOCK-TO-OUTPUT
PROPAGATION DELAY OF 3NS AND DATA-TO-OUTPUT PROPAGATION DELAY OF 4NS.

What I worte is ......
Entity D_latch IS
Port(d,clk : in std_ulogic;
q : out std_ulogic);
End entity D_latch;
Architecture behave of D_latch is
Begin
latch: Process is
Begin
if(clk='1') then
q<=d after 4ns;
end if;
wait on clk,d;
end process latch;
End architecture behave;
I am not able to incorporate clock-to-output delay of 3 ns. Where
should I insert this delay to emulate this .

Thanks in advance.

Regards,
akfami.


M.A.Khader
  Reply With Quote
Old 08-19-2004, 12:21 PM   #2
Niels Bakker
 
Posts: n/a
Default Re: Beginner: Simple D latch
M.A.Khader wrote:
> HI,
>
> I was solving the following question and came up with a solution. I
> am a beginner and sloving the exercises from Ashenden's "Designer's
> guide for VHDL".
> DEVELOP A BEHAVIORAL MODEL FOR A D LATCH WITH A CLOCK-TO-OUTPUT
> PROPAGATION DELAY OF 3NS AND DATA-TO-OUTPUT PROPAGATION DELAY OF 4NS.
>
> What I worte is ......
> Entity D_latch IS
> Port(d,clk : in std_ulogic;
> q : out std_ulogic);
> End entity D_latch;
> Architecture behave of D_latch is
> Begin
> latch: Process is
> Begin
> if(clk='1') then
> q<=d after 4ns;
> end if;
> wait on clk,d;
> end process latch;
> End architecture behave;
> I am not able to incorporate clock-to-output delay of 3 ns. Where
> should I insert this delay to emulate this .
>
> Thanks in advance.
>
> Regards,
> akfami.


Might this be something?

--Niels Bakker

library ieee;
use ieee.std_logic_1164.all;

Entity D_latch IS
Port(d,clk : in std_ulogic;
q : out std_ulogic);
End entity D_latch;

Architecture behave of D_latch is
Begin
latch: Process is
Begin
if clk='1' then
if d'event then -- latch transparent and change of data
q<=d after 4 ns;
elsif clk'event then -- latch is being enabled
q<=d after 3 ns;
end if;
end if;
wait on clk,d;
end process latch;

end architecture behave;


Niels Bakker
  Reply With Quote
Old 08-19-2004, 03:04 PM   #3
Ralf Hildebrandt
 
Posts: n/a
Default Re: Beginner: Simple D latch
M.A.Khader wrote:


> latch: Process is
> Begin
> if(clk='1') then
> q<=d after 4ns;
> end if;
> wait on clk,d;
> end process latch;


> I am not able to incorporate clock-to-output delay of 3 ns. Where
> should I insert this delay to emulate this .


Take the template for synthesizable latches:

process(clk,d)
begin
if(clk='1') then
q<=d;
end if;
end process;

Remember: There is no reset included.
If you want to apply a delay for simulation:

process(clk,d)
begin
if(clk='1') then
q<=d after 3 ns; -- not synthesizable
end if;
end process;


Ralf


Ralf Hildebrandt
  Reply With Quote
Old 08-19-2004, 04:18 PM   #4
ivailokroumov
 
Posts: n/a
Default Re: Beginner: Simple D latch
Hi M.A.Khader
When You Stady delays, you need to understanding at first time that they
are very difficult to be SYNTHESIZEable when you are going to write
complex models. At first time you need to know that on your level you have
three basic types delays.
1. The Internal Delay model
All components in digital circuits have a certain amount of inertia. For
Example, it takes a finit amount of time and a certain amount of energy
for the output of a gate to respond to a change on the input. The VHDL
language uses the propagation delay through the component as the default
pulse rejaction width.
sum <= reject 2 ns inertial (a xor b) after 5 ns;

2. The transport delay model
When we connect devices we use wire to make connection and to send
information. But wire are material elements, and they have resistance.
This can be shown as that:
sum <= transport (a xor b) after 5 ns;

3 Delta delay
Dhis type of delays are unspecifyed. You need just to write:
sum <= (a xor b);

Don't forget to leave space between value and dementions, because they are
Physical type;

You can solve your task in this manner:

entity D_latch IS
port(d,clk : in std_ulogic;
q : out std_ulogic);
end entity D_latch;

architecture behav of D_latch is
Begin
latch: Process is
Begin
if clk='1' then
if d'event then
q<=d after 4 ns;
elsif clk'event then
q<=d after 3 ns;
end if;
end if;
wait on clk,d;
end process latch;

VHDL language is key unsensitive.

Best Regards
Ivaylo Krumov



ivailokroumov
  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
Simple video editor? trs80 DVD Video 7 04-10-2007 05:14 PM
Simple region code question... simple answer?? joseph.greer@gmail.com DVD Video 7 01-26-2007 09:07 PM
DVDs without even a simple menu (suck!) Dennis M DVD Video 18 07-25-2005 05:43 PM
DVD Verdict reviews: DIE! DIE! MY DARLING!, LOOK! PLAYFUL PATTERNS AND SIMPLE SHAPES / GO! EXERCISE WITH THE TELETUBBIES, and more! DVD Verdict DVD Video 0 09-26-2003 10:02 AM
make your KISS DP-450 & 500 REGION FREE with a simple d/l to put on CD-R(W) vincent101 DVD Video 0 08-17-2003 12:12 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