From 721c62c977635b6ca716d965c8b84837a3d7b215 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Thu, 2 Jan 2014 15:47:08 +0100 Subject: Memorizing CPU : summs all the entries --- cpu/cpu.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cpu/cpu.ml') diff --git a/cpu/cpu.ml b/cpu/cpu.ml index 10e7bc4..592f612 100644 --- a/cpu/cpu.ml +++ b/cpu/cpu.ml @@ -2,7 +2,14 @@ open Netlist_gen (* Dumb CPU that just does an 8-bit addition *) +let sumz n i = + let rec res = + let aux = reg n in + fun () -> fst (Alu.nadder n i (aux res) (value "0")) () + in + res + let p = -main_2_2 (fun a b -> Alu.nadder 8 a b (value "0")) 8 8 + main_1_1 (sumz 8) 8 let () = Netlist_proc.print stdout p -- cgit v1.2.3