Hades logoHades applet banner
Intel MCS4 (i4004) calculator

applet icon

The image above shows a thumbnail of the interactive Java applet embedded into this page. Unfortunately, your browser is not Java-aware or Java is disabled in the browser preferences. To start the applet, please enable Java and reload this page. (You might have to restart the browser.)

Circuit Description

This applet shows a simple calculator built with the MCS4 system.

The circuit consists of the i4004 microprocessor, two i4001 ROM chips with the calculator program, one i4002 RAM chip to store the operands and result value, and some discrete interface logic with the input switches. However, no display is provided in this applet. Please open the memory editor window of the i4002 RAM chip to read-off the input operands and the final result value. Obviously, a 'real' calculator would include a (multiplexed) seven-segment display and more functions.

The program running on the i4004 implements a simple binary-coded decimal pocket-calculator with just two operations: addition and subtraction. After the applet has loaded, simply click the input switches to type in the first argument number, next type in the operand, type in the second argument, and finally type the enter key. The program now calculates the result value.

Please open the memory editor of the i4002 RAM chip to watch the program execution. The register banks 0 and 1 are used to store the BCD numbers of the first and second arguments, while register bank 2 is used to store the operation result.

The calculator program is stored in two i4001 ROM chips. One ROM chip is loaded with the binary code corresponding to the assembly source file input.asm. It polls the pressed keys, stores the numbers in the RAM, clears the RAM banks and calls the calculation subroutine.

The second ROM holds the routines for addition and subtraction, based on this assembly source file: calc.asm. For a detailed description of the program operation, please see the original BSc. thesis, pages 38-46 (see link below).

See also:

Print version | Run this demo in the Hades editor (via Java WebStart)
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)
Impressum http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/80-mcs4/io/input.html