付録:ナイトライダーABELソースリスト
module knightLED;
flag '-R3';
title 'knight rider LED ilum. 1997,10,11 by H.Machida';
"Device Declarations
NIGHTFS device 'P16V8R';
"Pin Declarations
"Input PIN assign
nc0,nc1 pin 4,5;
nc2,nc3 pin 6,7;
nc4,nc5 pin 8,9;
nc6,nc7 pin 2,3;
"Output PIN assign
l0,l1,l2 pin 19,18,17;
l3,l4,l5,l6 pin 16,15,14,13;
ud pin 12;
"Conventional PIN assign
clk pin 1;
oc_ pin 11;
VCC pin 20;
GND pin 10;
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Constant declarations
H,L,c,x =1,0,.C.,.X.;
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
vect = [ud,l0,l1,l2,l3,l4,l5,l6];
""""""""""""""""""""""""""""""""""""""""""
equations
state_diagram vect
state ^HFF: goto ^HBF; "1111 1111
state ^HBF: goto ^HDF; "1011 1111
state ^HDF: goto ^HEF; "1101 1111
state ^HEF: goto ^HF7; "1110 1111
state ^HF7: goto ^HFB; "1111 0111
state ^HFB: goto ^HFD; "1111 1011
state ^HFD: goto ^HFE; "1111 1101
state ^HFE: goto ^H7D; "1111 1110
state ^H7D: goto ^H7B; "0111 1101
state ^H7B: goto ^H77; "0111 1011
state ^H77: goto ^H6F; "0111 0111
state ^H6F: goto ^H5F; "0110 1111
state ^H5F: goto ^H3F; "0101 1111
state ^H3F: goto ^HFF; "0011 1111
state ^H00: goto ^HFF;
state [x,0,0,x,x,x,x,x]: goto ^HFF;
state [x,0,x,0,x,x,x,x]: goto ^HFF;
state [x,0,x,x,0,x,x,x]: goto ^HFF;
state [x,0,x,x,x,0,x,x]: goto ^HFF;
state [x,0,x,x,x,x,0,x]: goto ^HFF;
state [x,0,x,x,x,x,x,0]: goto ^HFF;
state [x,x,0,0,x,x,x,x]: goto ^HFF;
state [x,x,0,x,0,x,x,x]: goto ^HFF;
state [x,x,0,x,x,0,x,x]: goto ^HFF;
state [x,x,0,x,x,x,0,x]: goto ^HFF;
state [x,x,0,x,x,x,x,0]: goto ^HFF;
state [x,x,x,0,0,x,x,x]: goto ^HFF;
state [x,x,x,0,x,0,x,x]: goto ^HFF;
state [x,x,x,0,x,x,0,x]: goto ^HFF;
state [x,x,x,0,x,x,x,0]: goto ^HFF;
state [x,x,x,x,0,0,x,x]: goto ^HFF;
state [x,x,x,x,0,x,0,x]: goto ^HFF;
state [x,x,x,x,0,x,x,0]: goto ^HFF;
state [x,x,x,x,x,0,0,x]: goto ^HFF;
state [x,x,x,x,x,0,x,0]: goto ^HFF;
state [x,x,x,x,x,x,0,0]: goto ^HFF;
""""""""""""""""""""""""""""""""""""""
test_vectors 'knight rider up/down counter'
([clk] -> [ud,l0,l1,l2,l3,l4,l5,l6]);
[c] -> [H,L,H,H,H,H,H,H];
[c] -> [H,H,L,H,H,H,H,H];
[c] -> [H,H,H,L,H,H,H,H];
[c] -> [H,H,H,H,L,H,H,H];
[c] -> [H,H,H,H,H,L,H,H];
[c] -> [H,H,H,H,H,H,L,H];
[c] -> [H,H,H,H,H,H,H,L];
[c] -> [L,H,H,H,H,H,L,H];
[c] -> [L,H,H,H,H,L,H,H];
[c] -> [L,H,H,H,L,H,H,H];
[c] -> [L,H,H,L,H,H,H,H];
[c] -> [L,H,L,H,H,H,H,H];
[c] -> [L,L,H,H,H,H,H,H];
end knightLED;
付録:ナイトライダーABELコンパイル結果
Device NIGHTFS
- Reduced Equations:
ud := !(l0 & !l1 & l2 & l3 & l4 & l5 & l6 & !ud
# l0 & l1 & !l2 & l3 & l4 & l5 & l6 & !ud
# l0 & l1 & l2 & !l3 & l4 & l5 & l6 & !ud
# l0 & l1 & l2 & l3 & !l4 & l5 & l6 & !ud
# l0 & l1 & l2 & l3 & l4 & !l5 & l6 & !ud
# l0 & l1 & l2 & l3 & l4 & l5 & !l6 & ud);
l0 := !(l0 & !l1 & l2 & l3 & l4 & l5 & l6 & !ud
# l0 & l1 & l2 & l3 & l4 & l5 & l6 & ud);
l1 := !(l0 & l1 & !l2 & l3 & l4 & l5 & l6 & !ud
# !l0 & l1 & l2 & l3 & l4 & l5 & l6 & ud);
l2 := !(l0 & l1 & l2 & !l3 & l4 & l5 & l6 & !ud
# l0 & !l1 & l2 & l3 & l4 & l5 & l6 & ud);
l3 := !(l0 & l1 & l2 & l3 & !l4 & l5 & l6 & !ud
# l0 & l1 & !l2 & l3 & l4 & l5 & l6 & ud);
l4 := !(l0 & l1 & l2 & l3 & l4 & !l5 & l6 & !ud
# l0 & l1 & l2 & !l3 & l4 & l5 & l6 & ud);
l5 := !(l0 & l1 & l2 & l3 & l4 & l5 & !l6 & ud
# l0 & l1 & l2 & l3 & !l4 & l5 & l6 & ud);
l6 := !(l0 & l1 & l2 & l3 & l4 & !l5 & l6 & ud);
Device NIGHTFS
P16V8R
----------\ /----------
| \ / |
| ----- |
clk | 1 20 | VCC
| |
nc6 | 2 19 | l0
| |
nc7 | 3 18 | l1
| |
nc0 | 4 17 | l2
| |
nc1 | 5 16 | l3
| |
nc2 | 6 15 | l4
| |
nc3 | 7 14 | l5
| |
nc4 | 8 13 | l6
| |
nc5 | 9 12 | ud
| |
GND | 10 11 | oc_
| |
| |
-----------------------------
end of module knightLED
ご意見ご感想はこちらまで!!