![]() |
|
|
|
#1 |
|
I know this is a VHDL group, however, since there is no AHDL group and
I read more than one post in which people talked about using or having used AHDL I suppose I can find some help in here. This is the code: SUBDESIGN FlipD ( D,LE,CL,PS :INPUT; Q :OUTPUT; ) VARIABLE tmp[1..0] :NODE; %store latches outputs% en,out :NODE; %Enable of slave latch and master-latch output% %prep[1..0] :NODE; %Array of preparatory states% BEGIN tmp[0]=out; %copies MASTER-output% tmp[1]=Q; %copies SLAVE-output% en=!LE; %SLAVE latch-enable (negation of LE)% prep[]=(PS,CL); IF(LE==VCC) THEN %Latch-Enable on% CASE prep[] IS WHEN b"01"=>% CL activated, out goes to GND% out=GND; WHEN b"10"=>%PS activated, out goes to VCC% out=VCC; WHEN OTHERS=>%any other combination: transparent latch% out=D; END CASE; END IF; ELSE out=tmp[0]; %MASTER-output remains the same% END IF; IF(en==VCC) THEN %if slave is enabled% Q=out; %update output value by copying MASTER output% ELSE Q=tmp[1];%SLAVE output remains the same% END IF; END; What I'm trying to do with this code is a D type Flip-Flop. The funny thing is that if I remove the CASE block (which analices CL and PS inputs), the thing works just right, but when I try to simulate the whole program (with CL and PS set in any different values, it doesn't make a difference) the output gets stucked at VCC forever. Any ideas? msigwald@gmail.com |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| This is incredible! | jc_ice | DVD Video | 1 | 08-13-2006 10:47 AM |
| Please try this | Rob | DVD Video | 1 | 08-13-2006 10:43 AM |
| Get Rich | Daun Johnson | A+ Certification | 0 | 01-31-2006 03:11 PM |
| make lots O money fast an easy | migeul | A+ Certification | 0 | 03-06-2004 01:45 AM |
| Re: free email addresses finding program (files included) | Leonardo | A+ Certification | 1 | 12-05-2003 03:51 PM |