MODULE div455
title 'frequency divider'
div455 device 'P22V10';
" Inputs
CLK pin 1; " Internal
S8,S7,S6,S5,S4,S3,S2,S1,S0 pin 22,21,20,19,18,17,16,15,14 istype 'reg'; " Outputs
DP pin 23 istype 'reg'; " Constants
H,L,X,C,Z = 1,0, .X., .C., .Z.; Counter = [S8..S0]; EQUATIONS Counter.clk = CLK; when (Counter==511) then DP:=!DP; when (Counter==511) then Counter :=57; when !CLK then Counter := Counter+1;
END div455
|