From c53152068bd043d503b69d3f64a09ac592008e07 Mon Sep 17 00:00:00 2001 From: Benedict Date: Thu, 26 Apr 2018 11:16:20 +0200 Subject: pi: added programm which computes the fibonacci sequence --- fibonacci.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fibonacci.py (limited to 'fibonacci.py') diff --git a/fibonacci.py b/fibonacci.py new file mode 100644 index 0000000..d01139d --- /dev/null +++ b/fibonacci.py @@ -0,0 +1,10 @@ +import inst + +## this programm computes the fibonacci sequence + +## load the start values 1 and 1 into the two registers +## add the content of the two registers and save it alternating into the two +## registers, an repeat +prog = [inst.INST_LDA | 0x1, inst.INST_LDB | 0x1, inst.INST_REG_A_OUT, + inst.INST_ADD_A, inst.INST_REG_A_OUT, inst.INST_ADD_B, + inst.INST_REG_B_OUT, inst.INST_PC_LOAD | 0x3] -- cgit v1.2.3-70-g09d2