home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 180 / dpcs0203b.iso / editorial / easypc / Easy-Spice / data1.cab / Examples / Generic_Dig / register.spi < prev    next >
Encoding:
Text File  |  2002-07-08  |  616 b   |  21 lines

  1. .model Counter_8 d_logic_block file=$$counter_8 user=[10n]
  2. .file $$counter_8 
  3. PORT (DELAY=1e-12) output out[0:31] ; 
  4. EDGE (CLOCK=in[0], DELAY=USER[0]) count ; 
  5. count = count>=255? 0 : count+1 ; 
  6. output=count ; 
  7. .endf 
  8.  
  9. .model Reg_8 d_logic_block file=$$register_8 user=[5n,20n] 
  10. .file $$register_8 
  11. PORT datain in[0:7] ; 
  12. PORT OE in[9] ; 
  13. PORT (DELAY=1e-12) dataout out[0:7] ; 
  14. COMB (WIDTH=8, DELAY=USER[0]) datain_del ; 
  15. EDGE (WIDTH=8, DELAY=USER[1], HOLD=USER[0], CLOCK=in[8]) Register ; 
  16. datain_del = datain ; 
  17. register = datain_del ; 
  18. dataout = register ; 
  19. dataout.en = OE ? ~0 : 0 ; 
  20. .endf 
  21.