home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s199 / 1.img / PRESET.ABL < prev    next >
Encoding:
Text File  |  1986-02-04  |  1.5 KB  |  52 lines

  1. module _preset flag '-KY' "leave unused OR terms connected
  2. title '2-bit counter to demonstrate power on preset
  3. Michael Holley   FutureNet - Data I/O  31 Oct 1985'
  4.  
  5.     preset    device 'F82S167';
  6.  
  7.     Clk,Hold    pin  1,2;
  8.     PR        pin  16;    "Preset/Enable 
  9.     P1,P0        pin  15,14;
  10.  
  11.     Ck    = .C.;
  12.     
  13. equations
  14.  
  15.     enable P0      = 1;    "always enabled, pin 16 is preset
  16.  
  17.     [P1.R,P0  ]     := !P1 & !P0 & !Hold;    " state 0
  18.     [P1  ,P0.R]     := !P1 &  P0 & !Hold;    " state 1
  19.     [P1  ,P0  ]     :=  P1 & !P0 & !Hold;    " state 2
  20.     [P1.R,P0.R]     :=  P1 &  P0 & !Hold;    " state 3
  21.  
  22. test_vectors   
  23.        ([Clk,PR,Hold] -> [P1,P0])
  24.     [ 1 , 0,  0 ] ->    3; " Provides a High-to-Low on clock
  25.     [ 0 , 0,  0 ] ->    3; " to enable clocking
  26.     [ Ck, 0,  0 ] ->    0; 
  27.     [ Ck, 0,  0 ] ->    1;
  28.     [ Ck, 0,  0 ] ->    2; " Hold count
  29.     [ Ck, 0,  1 ] ->    2;
  30.     [ Ck, 0,  0 ] ->    3;
  31.     [ Ck, 0,  0 ] ->    0; " Roll over
  32.     [ Ck, 0,  0 ] ->    1;
  33.     [ 1 , 1,  0 ] ->    3; " Preset high
  34.     [ 1 , 0,  0 ] ->    3; " Preset low
  35.     [ Ck, 0,  0 ] ->    0; 
  36.     [ Ck, 0,  0 ] ->    1;
  37.  
  38. " Notes on preset from the Signetics Data Sheet
  39. "
  40. " The PR input provides an asynchronous preset to logic '1' of all
  41. " State and Output Register bits. Preset overrides the Clock, and
  42. " when held High, clocking is inhibited and all outputs are High.
  43. " Normal clocking resumes with the first clock pulse following 
  44. " a High-to-Low clock transition after PR goes Low.
  45. "
  46. " The power on preset also inhibites clocking until a High-to-Low
  47. " clock transition. This is provided by the first 2 test vectors.
  48.  
  49. end 
  50.  
  51.  
  52.