sicp-ex-5.1



<< Previous exercise (4.79) | Index | Next exercise (5.2) >>


codybartfast




Data-Path:
==========

  ┌───────┐   ┌───────┐    ,─.    ┌───────┐
  │   p   │   │   c   ├──>( > )<──┤   n   │
  └─────┬─┘   └───────┘    `─'    └───────┘
    ^   │       │   ^
    │   │       │   │           ^
    X   │       │   X          /1\
    │   │       │   │          ─┬─
    │   │       ├───│───┐       │
    │   v       v   │   v       v
    │  ───────────  │  ───────────
    │   \  mul  /   │   \  add  /
    │    ───┬───    │    ───┬───
    └───────┘       └───────┘


Controller:
===========

        start
          │
          │
          v
          ^
         / \ yes
  ┌────>( > )───> done
  │      \ /
  │       V
  │       │
  │       │no
  │       v
  │  ┌─────────┐
  │  │  p<-mul │
  │  └────┬────┘
  │       │
  │       v
  │  ┌─────────┐
  │  │  c<-add │
  │  └────┬────┘
  └───────┘