/******************** MODULE INFO ****************************/ /* * File name : cnt4.sfl * * AUTHOR : Yoshihiro Iida (3aepm001@keyaki.cc.u-tokai.ac.jp) * VERSION : 1.0 * DATE : Oct 16, 2003 * * Compiler : sfl2vl * Project : POP-11: PDP-11 compatible On Programmable chip * Functions : 4-bit counter of POP-11 * * Copyright (c) Yoshihiro Iida, Tokai University, Shimizu Lab., Japan. (http://shimizu-lab.dt.u-tokai.ac.jp) This software is the property of Tokai University, Shimizu Lab., Japan. The POP-11 is free set of files; you can use it, redistribute it and/or modify it under the following terms: 1. You are not allowed to remove or modify this copyright notice and License paragraphs, even if parts of the software is used. 2. The improvements and/or extentions you make SHALL be available for the community under THIS license, source code included. Improvements or extentions, including adaptions to new architectures/languages, SHALL be reported and transmitted to Tokai University, Shimizu Lab., Japan. 3. You must cause the modified files to carry prominent notices stating that you changed the files, what you did and the date of changes. 4. You may NOT distribute this set of files under another license without explisit permission from Tokai University, Shimizu Lab., Japan. 5. This set of files is free, and distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You SHALL NOT use this software unless you accept to carry all risk and cost of defects or limitations. * * ------------ CHANGE RECORD ---------------- * Yoshihiro Iida (3aepm001@keyaki.cc.u-tokai.ac.jp) Sep 21, 2004: * First free version of this software published. * */ declare cnt_inc4 { input in<4>; output out<4>; instrin do; instr_arg do(in); } module cnt_inc4 { input in<4>; output out<4>; instrin do; sel s0,s1,s2,s3; instruct do par { s0=^in<0>; s1= in<1>@in<0>; s2= in<2>@(/&in<1:0>); s3= in<3>@(/&in<2:0>); out=s3||s2||s1||s0; } } declare cnt4 { instrin inc,rst; output out<4>,c; } module cnt4 { instrin inc,rst; output out<4>,c; cnt_inc4 cnt_inc; reg_wr cnt<4>,ovf; par{ out=cnt; c=ovf; } instruct inc par { cnt:=cnt_inc.do(cnt).out; ovf:=/&cnt; } instruct rst par { cnt:=0x0; ovf:=0b0; } }