From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D896ABB81 for ; Sun, 5 Feb 2006 06:42:57 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k155gvuL028026 for ; Sun, 5 Feb 2006 06:42:57 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA07312 for ; Sun, 5 Feb 2006 06:42:56 +0100 (MET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k155gsf4009021 for ; Sun, 5 Feb 2006 06:42:55 +0100 Received: from rosella (ppp21-250.lns2.syd7.internode.on.net [59.167.21.250]) by smtp1.adl2.internode.on.net (8.13.5/8.13.5) with ESMTP id k155glp8027660; Sun, 5 Feb 2006 16:12:48 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code... From: skaller To: Oliver Bandel Cc: caml-list@inria.fr In-Reply-To: <20060205041600.GA5936@first.in-berlin.de> References: <20060204211943.GA590@first.in-berlin.de> <1139106546.8453.87.camel@rosella> <20060205041600.GA5936@first.in-berlin.de> Content-Type: text/plain Date: Sun, 05 Feb 2006 16:42:47 +1100 Message-Id: <1139118167.8453.254.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43E59061.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43E5905E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 recursive:01 recursive:01 ocaml-code:01 oliver:01 bandel:01 recursion:01 clocked:01 model:01 inputs:01 inputs:01 synchronous:01 clocked:01 wire:98 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Sun, 2006-02-05 at 05:16 +0100, Oliver Bandel wrote: > But I'm not clear about how to write this function "f", > because it needs mutual recursion... No it doesn't, not even with feedback, because your system is CLOCKED. A simple model is: you have a collection of chips with inputs and outputs. In phase one, calculate the ouputs from the inputs. In phase 2, you have a circuit board, representing the wiring, this is a function that copies the outputs of all the chip to their inputs, following the wiring diagram. That's where the feedback comes in. If you want to know how to make a subcircuit do the feedback *internally* on one clock, there is a simple answer and a hard one. The simple answer is YOU CANT. Circuits are monolithic. The hard answer is .. you can have multiple clocks, synchronised by a master clock. The implementation is simple .. a clock is just a counter that writes TRUE when it is zero and FALSE otherwise. Then you invent a thing called a LATCH, which is like wire, except it holds the output stable and ignores the input UNLESS a special ENABLE input is True. That's connected to your counter. Basically .. you're asking hard questions about how to design synchronous circuits. Don't expect a clocked circuit to just be a simple composition of functions. The functions get very complicated -- otherwise circuit designers wouldn't have a job :) -- John Skaller Felix, successor to C++: http://felix.sf.net