5.1. Designing Register Machines
Exercise 5.1

Register machine

Design a register machine to compute factorials using the iterative algorithm specified by the following procedure. Draw data-path and controller diagrams for this machine.

(define (factorial n)
  (define (iter product counter)
    (if (> counter n)
          product
          (iter (* counter product)
                (+ counter 1))))
  (iter 1 1))

Nobody's finished this exercise yet. You'll be the first!


There are no comments yet.

Authentication required

You must log in to post a comment.

Login