[sdiy] How does the MIDIVerb's adder work?
Eric Brombaugh
ebrombaugh at gmail.com
Sat Jul 27 17:33:26 CEST 2024
[Context: I did the reverse-engineering on the MIDIVerb DSP that Paul
Schreiber presented in the videos mentioned.]
Yes - the carry in of the adder is wired to the sign bit of the input
value, and yes that seems like it might have something to do with
two's-complement. You'll notice that the inverting store instruction
doesn't do a full two's-complement inversion, but just bitwise
"one's-complement" inversion. That will always result in an off-by-one
error in the data stored in DRAM, but when reading back from DRAM to the
accumulator the sign/carry connection completes the two's-complement.
But, only for negative values, and of course it isn't required for data
that was stored with the non-inverting instruction.
The overall result is less of a completion of two's-complement and more
like a low-level dither added in to the audio signal. When developing
the emulator that's used in the E520 effects module I did some listening
experiments to see how that sign/carry connection affects the sound and
it does alter the quality of the noise floor somewhat. I think it's a
judgement call whether it's a good thing or not, but I left it in to
stay faithful to the original.
There are a few "non-idealities" in the DSP of the MIDIVerb. Most are
compromises in the pursuit of simplicity and BOM count, but some like
the sign/carry are just head-scratchers. No question though that it's a
wonder of 80's-era design and a great example to study.
Eric
On 7/27/24 05:27, Gordonjcp wrote:
> Hi folks,
>
> I recently got interested in a post on Reddit where someone was trying to disassemble the original MIDIVerb and MIDIFex DSP ROMs, following Paul Schreiber's videos on Youtube about reverse-engineering one. I had a crack at writing my own emulator, based on the circuit diagrams in the video, and while I've got it working there are some things I'm not totally clear about.
>
> There are four basic operations, which are various combinations of add or load the accumulator with half the value in RAM, or store the accumulator to RAM and add the accumulator to half its current value, or this but with the accumulator inverted.
>
> Halving the accumulator is accomplished by wiring D1 of the "input" to D0 of the adder, and so on, with D15 wired to both D14 and D15 at the top. But there's an oddity here - the Carry In of the adder chain is also wired to D15, which means that if the value is negative the output has 1 added to it. This sounds awfully like two's complement arithmetic, except that you'd add 1 only if you were subtracting. As it is, it's just going to generate an off-by-one error.
>
> It clearly works the way it's drawn, although I haven't tried leaving this funny carry in thing out to see if it makes much of a difference. I don't know if it makes a difference but because of the way the DAC is wired, that's shifted left one bit with the lowest bit always set to 1 and the remaining high bits sign-extended.
>
> Paul, you drew it, can you wade in and explain why I'm wrong? ;-)
>
More information about the Synth-diy
mailing list