No Subject
- To: MISC
- From: jfox@xxxxxxxxxx (Jeff Fox)
- Date: Mon, 16 Jan 1995 18:54:48 -0800
Dear MISC readers:
I have been given instructions to deal with problems like the
one last week. Sorry, it caught me too, before I could get it
shut down it was shut down locally.
Now to get back to the MISC discussion:
From: Mats.Eriksson@eua.ericsson.se (Mats eriksson)
Date: Wed, 11 Jan 95 15:51:50 +0100
Subject: Ripple carry
>Can someone explain how the number of cycles an addition takes is
>determined? The S21 simulator does not seem to do this.
>Can one predict the number of cycles by looking at the ones and zeros
>in the operands? Will this be the same for P8, F21 and P32?
>
>
>Mats Eriksson (Mats.Eriksson@eua.ericsson.se)
Sure. You are right the S21 simulator does not simulate the
timing in the ripple carry.
It seems that the carry ripples from bit to bit in just
over a nanosecond. So it is safe to assume that a bit from
a carry when two bits are added will move through about 8
bits in the time it takes to execute and instruction.
So by the time a + is decoded and the output of the adder is
latched there will be time for carry to move through 8 bits.
so if 01 and 7F are on the stack a + will give the correct
80. But if 1 and 7FFF are on the stack the result of the
add will not be correct unless some extra time delay is
used. One NOP in front of the + would assure that the
result will be correct if the numbers need carry to move
through up to 16 bits. 1 FFFFF is the worst case where
21 bits of movement of carry is needed. There you need
two NOPs.
Now in DRAM there is an extra delay at the start of each word.
It is as if there were a couple of nop between words. So
no NOPs are needed if + is the start of a word.
Now when you use +* it works the same way. It you take two
ten bit numbers, then shift one of them left ten times
you can use +* in a loop to get a 20 bit result.
Chuck tends to left shift things like counters. He will add 1000
to say 0F000 and loop on no carry (for a 100hex loop)
If you know how big the numbers are you can determine if you
need no NOP, 1 NOP or 2 NOP before the + or +*.
I you know where it is going (ie the first instruction slot)
you many not need to add any NOP.
Also, if you know there is no carry you can use + as a single
cycle OR. MuP21 does not have an OR. It has AND and XOR (-or)
but no OR. Of course you can OR in the page offset to the
start of page address with a + instruction since there will be
no bits causing any carry. :-)
Jeff Fox