Can someome explain how arithmetic works?

From: blstuart_at_bellsouth.net <(blstuart_at_bellsouth.net)>
Date: Fri Jun 2 21:28:21 2000

In message <13552198944.11.DSEAGRAV_at_toad.xkl.com>, "Daniel A. Seagraves" writes
:
>Need this for my emulator, and nobody can explain to me how it works, and
>I can't find any documentation that's useful to me. Specifically, I need stuff
>like "you shift left and then check the last bit" etc. etc. Basically, I have
>a bunch of ones and zeroes and I have to know how to add/subtract/multiply/
>divide with them.

There are several answers possible depending on what level of emulation
you're looking to do. If the purpose of the emulator is for developing
software on one platform before running it on another, an instruction
level functional simulation is good because it's fast. For this, just
turn the 1s and 0s into native integers and operate on them.[1] For
a bit-level emulation, there are several good references for how this
can be and sometimes is done. For example Patterson and Hennessy's
books are quite good. I've taught out of their Computer Organization
and Design: The Hardware/Software Interface and quite like it. If
you can't find such a reference, I'll e-mail you the TeX source to
a chapter I wrote years ago for my introductory courses. Finally, if
you want to do a gate level emulation of a particular machine, then
you'll want to get the schematics of the machine and find out exactly
how its designers did it.

[1] I used to work with digital signal processor (DSP) chips quite
a lot. When Analog Devices entered the market with their ADSP-2100,
we were interested in it. So I wrote some code to implement a
standard voice compression algorithm. Now the test vectors for this
represented 2 seconds of real time. The Analog Devices simulator
which we ported to BSD Unix ended up taking about 1 week to run this
2 seconds on our VAX 11/750. It did the simulation at a very low
level. While it was running, I started developing a new simulator
using our simulator-compiler. When it was finished, it ran the
2 second simulation in about 2-3 hours. It simulated the machine
at the instruction level. The amusing part of the story is that
we were moving from one office to another at about that time. I
was beginning to wonder as the move approached whether the first
simulation was going to finish in time for us to shut the machine
down and move it to the other building. It did BTW and IIRC it
had about a day to spare.

Brian L. Stuart
Received on Fri Jun 02 2000 - 21:28:21 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:33:00 BST