Skip to content

Logarithmic DAC for AY8913 and SN76489 programmable sound generators (Done as part of Zero To ASIC Analog course)

License

Notifications You must be signed in to change notification settings

rejunity/tt07-analog-dac-ay8913

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analog DAC for AY-891x family of Programmable Sound Generators

Recreation of the logarithmic 4-bit current steering DAC from AY-8910/AY-8912/AY-8913. Inspired and informed by silicon reverse engineering of the orginal chip.

This work was done as excercise for Zero To ASIC Analog course and will be part of the open-source silicon for AY-8913 and potentially SN76489 unless I manage BJT DAC for it. Also check open-source silicon effort for Z80 CPU.

Silicon

Simulation with parasytics extracted

The original DAC from the 80ies

4-bit to 16 lines decoder on the left side. 16 current steering transistors of the different size form the DAC on the right. Output is in the top right corner.

Reverse engineered schematics by lvd2

Yeah, it is just bunch of transistors connected in parallel. The real magic is in the width & length of their gates.

Compare old and new

Magic

What did I learn?

Sizing transistors to produce exact currents: 2mA, 1.4mA, 1mA, 0.7mA, 0.5mA...

First of all, it turns out that there are so many secondary effects, that the theoretical formula W/L=2 * Id / (uCox * (Vdd-Vth)^2) often presented in books becomes practically useless!

The W/L ratio of the gate is non-linear in regards to desired current. 4/2 != 2/1 != 1/0.25 in terms of current. Thinner the gate (in absolute values), stronger are various secondary effects and more resulting current deviates from the theory.

I could not find SKY130 documentation how to model these effects, but I could find some clues in:

See how Vth (threshold voltage) depends on W/L, ranging from 0.434V to 0.64V. image

Check out what they have in models_fet.spice though, even weirder: image

From my experiments it is very likely that W/L affects not only Vth, but Cox as well.

Short channel effects

The behaviors above are actually called Short chanel effects and Reverlse short-channel effect!

Practical solution

I started using gates that are much larger (fatter and longer) than the theory would give me. Making gates larger significantly reduced the secondary effects!

I picked, partially through calculation, partially through experimentation, the sizes for my maxmimum (2mA) and minimum currents (16uA). Which turned out to be really nice numbers 12/1 and 1/12 😎 and used super simple Python script to fit exponential curve through them: for i in range(8): print(12*(0.707**i)

I thought I would have to wiggle the gate sizes in the middle, but it just worked out as is.

If I had my transistors even slightly smaller, it would not be that easy! Right now they are approximately x3 larger than theoretically necessary.

Some observation on the original DAC in AY-8913

image
  1. Now I see that the 3 "middle" transistors don't exactly follow the pattern and perhaps original designers had to wiggle their W/L ratio.
  2. Even the smallest current steering DAC gate is significantly larger than the logic gates next to them (see the image below), even if they control relatively tiny currents. I assume the original designers might have done the same - just make all DAC transistors larger to make it easier to "fit" in the exponential curve without significant distortions.
  3. It also could explain why couple of "steps" are bit off from the spec in the original chip.
image

What is Tiny Tapeout?

Tiny Tapeout is an educational project that aims to make it easier and cheaper than ever to get your digital designs manufactured on a real chip.

To learn more and get started, visit https://tinytapeout.com.

Analog projects

For specifications and instructions, see the analog specs page.

Resources

About

Logarithmic DAC for AY8913 and SN76489 programmable sound generators (Done as part of Zero To ASIC Analog course)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published