"Amit" <> wrote in message
news: ps.com...
> On Oct 9, 11:26 am, KJ <Kevin.Jenni...@Unisys.com> wrote:
>> <Snip>
>>
>> You may want to consider putting a bit more thought into the question
>> that you'd like the group to answer before just posting code and
>> simply asking 'Any comments?'.
>>
>> My comments
>> 1. Your design works exactly as written.
>> 2. Your design may not work as you intended (but without any
>> description from you it's not clear what your intended design should
>> be).
>> 3. I'll bet signal 'q' has trouble getting out of the 'U' state.
>>
>> KJ
>
>
> Thanks I had no idea.
>
That much is clear
Going back to the opening paragraphs of your original post....
> I'm working on project (basic) to learn VHDL and the purpose of
> process (which had made so confused and mad).
Since you're trying to learn VHDL, it won't help much if anyone here gives
you the answer but I suppose a little guidance can't hurt.
> Anyway, I have question
> and need to know how I can create a toggle flipflop using D f/f.
>
Fair enough...but first you have to have the entity/architecture code for a
D flip flop. I'm not saying it's difficult to create but you do need to
have it to do your assignment and the first thing you'll need to do is
decide on the interface to that entity. Your basic run of the mill D flip
flop has only 'Clock' and 'D' as inputs and 'Q' as an output, that's it.
Fancier ones may have a 'Qbar' output and a 'Reset' input but they don't
have to. Anyway, decide on the interface you want for your D flip flop and
then code up the entity and then the architecture. Debug it to make sure it
is correct.
Now that the D flip flop is done, you have to USE it to create a toggle flip
flop. Using something does not mean changing it, it means to create an
instance of it and connect it up appropriately for you usage. What this
means is that when you finally get to the architecture code for the toggle
flip flop you will
- Instantiate the previously created D flip flop. (Ex: My_Dff : entity
work.D_FF port map(.....);
- Do not change ANY of the code for the D flip flop itself...you've debugged
it, it's working, leave it alone.
But first you again need to decide on what the interface is to your toggle
flip flop. Your basic run of the mill toggle flip flop has 'T', 'Clock' and
'Reset' inputs and a 'Q' output (again fancier ones may have 'Qbar' if you
feel it is appropriate). You'll notice that I list 'Reset' as one of the
'must have' inputs but I'll leave it to you to work out why a toggle flip
flop should always have a reset but a D flip flop does not.
Just like before with the D flip flop, work out what you want the interface
to be to your toggle flip flop and now you'll have the entity code for your
toggle flip flop. To do the architecture of the toggle flip flop, first
instanitate the D flip flop using the example above (since that is part of
the assignment). Now work out the logic you need to connect the input and
outputs appropriately.
The assignment is (I'm guessing) supposed to get you to think about
hierarchical design, breaking down a 'big' problem into a number of 'small'
problems, tying them together appropriately with wires and additional logic
if necessary. In this case, you've been told the hierarchy (toggle flip
flop made out of a D flip flop), you may also have been told the interfaces
(i.e. the VHDL entity) and it's up to you to work out the details in the
architecture body.
> This is what that I think it should be but don't know how to get a
> confirm so I will appreciate it if somebody could tell me if I'm on a
> right track or no (the same as process);
You don't need people in a newsgroup to confirm that you're on the right
track. You simply need to read the assignment definition and then test your
design with a simulator.
Good luck on your studies
KJ
|