moore.abl
来自「自己编写的GAL可编程逻辑电路的编译软件abel4的windows界面」· ABL 代码 · 共 60 行
ABL
60 行
module moore
title 'Moore machine description of a Sequence detector
Data I/O Corp. by Jeffrey Davis '
moore device 'P22V10';
"Inputs
clk pin 1;
PR pin 2;
X pin 3;
"Output
Q1,Q0,Z pin 21,22,23 istype 'buffer,reg_D';
"State Register assignment
sreg = [Q1,Q0, Z];
A = [ 0, 0, 0];"use one bit changes for better optimization
B = [ 0, 1, 0];
C = [ 1, 1, 0];
D = [ 1, 1, 1];
Equations
sreg.ar = PR;
sreg.clk = clk;
state_diagram sreg
state A:
if X then B else A;
state B:
if X then C else A;
state C:
if X then D else A;
state D:
if X then D else A;
test_vectors
([clk,PR, X] -> [ sreg ])
[.c.,1 , 0] -> [ A ];
[.c.,0 , 0] -> [ A ];
[.c.,0 , 1] -> [ B ];
[.c.,0 , 1] -> [ C ];
[.c.,0 , 1] -> [ D ];
[.c.,0 , 0] -> [ A ];
[.c.,0 , 1] -> [ B ];
[.c.,0 , 0] -> [ A ];
[.c.,0 , 1] -> [ B ];
[.c.,0 , 1] -> [ C ];
[.c.,0 , 1] -> [ D ];
[.c.,0 , 1] -> [ D ];
[.c.,0 , 0] -> [ A ];
[.c.,0 , 1] -> [ B ];
[.c.,0 , 1] -> [ C ];
[.c.,0 , 1] -> [ D ];
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?