Tuesday, February 23, 2010

Thatsa Lottabytes

There is a Facebook fan page to establish hella- as the official SI prefix for 1024. This is good, but I don't think it goes far enough. I propose that lotta be designated to mean "several orders of magnitude larger than currently achievable."

In 2010 lotta would be defined as 1018.3, as having exabytes of storage seems comfortably out of reach. Each year it would be redefined, marching slowly to infinity (and beyond).

Graphic depiction of kilo, mega, giga, tera, peta, exa, zeta, yotta, hella, and lotta.
kilo 103
mega 106
giga 109
tera 1012
peta 1015
exa 1018
zetta 1021
yotta 1024
hella 1027 (proposed)
lotta > 1018 (my proposal)

Thursday, February 18, 2010

Email Contact Virii

The Matrix imageWe're all familiar with computer viruses: bits of code which attempt to transmit themselves to another system, from which they look for yet more systems to infect. The key point is that the virus must transmit code to infect another system.

Very occasionally there are more obscure examples of viral behavior, of data alone unaccompanied by code. Certainly, there is code involved, but it is the normal code of the system which performs a useful function and is not intended to spread data virally.

The contacts viral spreadFor example: people usually refer to me by the nickname Denny. My personal email address is denny@geekhold.com (1) but my work address is not "denny". One person had my personal email address. Shortly after I started he sent an email to a few team members. He typed "Denny," and GMail helpfully auto-completed my personal account from his contacts. When another member of the team responded to that email, the address was automatically added to his contacts. When he later sent an email to another set of coworkers... the Contact virus spread further.

The trouble with data-driven viral behavior is that there are few tools to stamp it out. With code viruses, a huge ecosystem of tools and malware signatures has been created. There are few tools to deal with an annoying bit of data spreading through the system, just manual exhortations to not respond to the email containing the external address.

Do people know of other instances of a viral spread of data, unaccompanied by code? There are certainly instances of poor auto-complete behavior, such as a mistyped URL leading to the browser forevermore suggesting the bogus site, but none I can think of which spread from one person to another. I suspect the root cause is a poor model for how auto-complete is supposed to work: the developer wants it to be completely automatic and not something the user should have to adjust.




(1): I long ago gave up keeping my email address off of spam lists. As I've used this address since 1996, I am wholly reliant on good filtering.

Tuesday, February 16, 2010

Resource Leak

Copper sewage pipe with corroded hole


Resource leak located after extensive debugging. This portion of the system required significant refactoring to resolve the leak.

Friday, February 5, 2010

Apple == A, Plus Four More Letters

What the web needs right now is another blog post about the iPad.

Apple A4 chipNo, don't run away! This will be different, I promise. We'll focus on Apple's A4, a custom CPU first used in the iPad. It has been widely assumed that A4 uses a licensed ARM Cortex A8 core. I have no reason to dispute this assertion, it seems like a fine choice. It has also been asserted that because the same core is used in parts from Samsung, TI, and Qualcomm, Apple should not have bothered making its own chip. Today, Gentle Reader, we'll explore that notion a bit.




Apple ASIC Expertise

Apple has a long history of ASIC design. Apple produced custom silicon for various Macintosh models since at least the late 1980s, when they designed the audio chips used in the Quadra 700 and 900 (a chip called "Batman"). Later, Apple designed entire chipsets to interface with the PowerPC 60x bus. Apple licensed a gigabit Ethernet MAC design from Sun, and used it plus IDE controller and other peripherals in chipsets for several Powermac models. With the switch to x86, Apple's efforts became much more constrained. The x86 bus interface is difficult to license, and Intel's own chipsets are quite reasonable. So far as I know, x86 Macintoshes no longer use custom Apple ASICs.

Custom chip design isn't a radical departure for Apple.

With that as background, what might Apple have done in the A4 chip? I have absolutely no inside information about the iPad or A4 processor, I'm going to make stuff up because its fun to speculate.




Graphics & OpenCL

PowerVR SGX CPU OverviewApple holds a nearly 10% stake in Imagination Technologies Group, which designs the PowerVR graphics accelerator and other IP relating to massively threaded processing. Apple uses their PowerVR SGX 535 in iPhone 3GS, and used various PowerVR graphics in earlier iPhone models. The A4 chip will certainly integrate a graphics core from PowerVR. As with essentially all GPU designs today, the PowerVR makes use of multiple, specialized CPU cores. There is relatively little information about its instruction set on the web, only that it is called META MTX and uses 16 bit RISC-ish instruction words. Update: PowerVR SGX does not use the META architecture, it has a distinct architecture of its own. Additional information can be downloaded after registration.

Apple has also invested heavily in two relevant technologies: OpenCL and LLVM.

  • OpenCL allows processing to be distributed across multiple CPUs in the system, even if they have different instruction sets. OpenCL algorithms are written in a language with syntax very similar to C99, and the framework handles the rest.
  • LLVM is a compiler toolkit, one aspect of which is a machine independent instruction set. Source code can be compiled to the LLVM virtual machine, and from there be translated into the equivalent opcodes for the target CPU. The compilation can be done statically before running it, or by a Just-In-Time compiler while interpreting the LLVM bytecodes.

iPhone applications are compiled to ARM instructions, but it is not much of a stretch to imagine support for sections of LLVM bytecodes as well. If the hardware has sufficient GPU power, the bytecode could be translated to the GPU instruction set and offloaded. Devices with less sophisticated GPUs would use the ARM instead. Apple does not allow iPhone apps to include their own virtual machine in this way, but would be free to provide the VM function as part of the OS.

I suspect this is the most compelling reason for Apple to build its own chip as opposed to buying off the shelf. The rest of the mobile industry is satisfied to offload 3D graphics and video decoding to the GPU. Apple has greater ambitions, and could make use of significantly more GPU pipelines. By controlling the complete platform from CPU to software, Apple can make tradeoffs which are not practical for the rest of the market. For example: a very large GPU plus very fast ARM would generate more heat than can be dissipated in a small form factor like a phone. Apple has the option to dynamically throttle the ARM clock speed in order to open up more thermal envelope for the GPUs, if sufficient OpenCL workload is ready to run. When the GPUs are less busy, the ARM clock speed can be brought back up.




Multi Package Modules

Multi Package ModuleThe CPU in the iPhone 3GS is a Samsung S5PC100. This is a multi package module with CPU, I/O chip, and SDRAM sandwiched tightly together. Multi chip modules have been around for a long time, where multiple dies wired together in one big package. The amount of testing which can be done on a raw die is rather limited, so MCM yields suffer as one bad die ruins the whole assembly.

Multi package modules are relatively new: each chip is in its own package, but use very tight pin spacings and do not have a heat spreader. They are soldered together on a small PCB, which in turn has a Ball Grid Array on the bottom with normal pin spacings. Because each chip is packaged separately a full suite of test vectors can be run before the final assembly is put together, improving the yield considerably and lowering the cost of the final product.

If we examine the main board of an iPhone 3GS, the largest component is not the Samsung processor - it is the Flash memory, an MPM containing a number of flash chips. The Samsung CPU in the iPhone 3GS comes in a close second in size, and is also a multi package module with CPU, I/O chip, and SDRAM.

With the A4, Apple will probably have one die containing both CPU and I/O. Samsung uses different I/O chips to tailor their offering to many market segments, which is not a goal for Apple. By arranging the pinout carefully, Apple might be able to make an MPM containing CPU, SDRAM, and Flash, reducing the total board area. Different Flash capacities could be offered by not stuffing portions of the MPM. The iPad itself might not need such an MPM as it is a much larger device, but future iPhones would benefit more.

To be clear: assembling an MPM is not something you can easily do when buying merchant silicon. The pins on one package have to be arranged so as to be easy to route to the pins on the other packages within the MPM.




Wrapping up

I'll say it again: I made this all up. I have no information on the specifics of the A4, just speculation. In the unlikely event that anyone reads this (instead of running away from yet another iPad blog post), don't copy it into Wikipedia as though it were verified information.

What about future iterations? Its tempting to consider a single chip containing the entire iPhone feature set, including radio and wireless networking. The A4 itself clearly doesn't do this, as GSM support is optional in the iPad. I suspect that even in future chips, Apple won't pull in the baseband radio. The front end portions of that chip are rather sensitive to noise, and generally don't work well when integrated in the corner of a gigantic ASIC. Also integrating the radio functionality would make it that much harder to keep up with advancements in wireless networks.

Another future possibility is to use this chip in Apple's other small form factor products, like the Airport Base Stations, Time Capsule, and AppleTV. This is certainly possible, but aside from obvious additional peripherals like SATA I'm not sure it adds many requirements to the chip.

Other articles about A4 you might find interesting:

  • The New York Times writes about the history of the A4 design team.
  • Louis Gray writes about Apple's heavy recruiting push to staff up their ASIC team.
  • Wikipedia already has an article, which will improve over time as more details emerge.

P.S.: While we're at it, the title of this post is a guess about the origins of the "A4" nomenclature: "Apple" is a capital A followed by four more letters.




Tuesday, February 2, 2010

Monday, February 1, 2010

Fuzzy Dice

Electric vehicle with fuzzy dice

Even electric vehicles can be made cooler with a simple application of fuzzy dice.

Wednesday, January 27, 2010

On the Ancestry of Consumer Electronics

Writing about the Newtpocalypse the other day inspired me to get my MessagePad 120 working again. In the comments of that post, Grant Hutchinson pointed out that my MP120 would not be affected and should still work. Indeed, it does! The backup lithium battery still had a little charge left, so my files are still present. The Newton pre-dates Flash memory, and stores all files in battery backed SRAM. The battery faithfully kept the SRAM powered for the last 13 years sitting in my garage, patiently waiting for me to use it again.



This morning Kara Swisher republished a Steve Jobs interview from 2004, talking about the products which Apple chooses to pursue and not to pursue. Its an interesting perspective on the eve of Apple's media event today. As she notes, in some respects Apple's new device will be "the Newton’s great-grandson."

Friday, January 22, 2010

Sun Microsystems, 1982-2010

I was a summer intern at Sun Microsystems in 1991, working on Verilog test cases for a 155 Mbps ATM adaptor. I still have the T-Shirt, shown here. Only after we had the shirts made did the intern coordinator really look at it and notice the Sun logo was orange instead of purple, a bit of a gaffe. On the back are shown the companies who we, the interns, perceived as competitors. I've no idea why Apple is there while SGI is not, chalk it up to the exuberant misinformation of youth.

Sun Microsystems intern T-shirt 1991.

I returned to Sun as an ASIC designer (eventually transitioning into software) and worked there from 1992-2000. The first few years in that span were rough for Sun: the market was just beginning its transition from Unix-based CAD and graphical workstations to Windows NT on x86. Sun managed the transition pretty well, moving the bulk of its business into large SMP servers which the Intel boxes of the time did not scale to. Then came the dotCom boom, which were heady days for Sun.

Sun had a tradition of elaborate April Fools jokes. One year a complete hole of miniature golf was constructed in Scott McNealy's office. Another year a platform was built submerged 1" under the surface of the campus lake, with Andy Bechtolsheim's Ferrari parked upon it. I have the T-Shirt from the 1993 joke: the SHARCStation with superSHARC processor. A complete workstation was submerged at the bottom of a pool, with a scuba diver operating it. I don't remember whether it worked while underwater, but given the culture of Sun at the time I suspect they had come up with a way to waterproof it. Amusingly, I just searched for superSHARC: its now the name of a real processor, a DSP from Analog Devices.

Sun Microsystems April Fools T-Shirt SuperSHARC 1993.

I left Sun 10 years ago... but I've missed it. In the mid 1990s it was a heady place, a company at the top of its game with extensive resources to push the industry along. Its corporate culture valued engineers highly, which showed up in lots of little ways but one big one: enclosed offices. Sun would use cubicles if necessary, but the corporate preference was an office with a door. MTS level positions would be doubled up in an office, Staff Engineers and above were allocated a single office.

After the dotCom bust, Sun's fortunes changed considerably. The way is now clear for Sun to be purchased by Oracle. Rest in Peace, Sun. These last few years have not been kind.

Thursday, January 21, 2010

Colloquialisms in Code

Both of my parents are from Tennessee. Per capita, Tennessee has the highest density of colloquialisms than any other place in the western hemisphere. So ... lets code them up. You can mouse over each item to show the original phrase it purports to represent. Note: the Javascript rollovers don't work in the RSS feed, only on the web page. So far as I know, its all akin to voodoo.


--------


justification = my_ass.pull();
I pulled the justification out of my ass.

--------


Drawer = Set(["knife1", "knife2"])
if not "sharpest" in Drawer:
Not the sharpest knife in the drawer.

--------


if not (hand[left].find(his_ass) ||
        hand[right].find(his_ass) ||
        flashlight.find(his_ass)):
He couldn't find his ass with both hands and a flashlight

--------


ASSERT(dead.val() > doornail.val());
Dead'er than a doornail.

--------


if (them.fitness == fiddle.fitness):
Fit as a fiddle.

--------


CHECK(!(water[FISH_CONSTANT]));
Like a fish out of water.

--------


error: prototype for 'Silk_Purse(Cows_Ear)' does not match any in class 'Silk_Purse'
You can't make a silk purse out of a sow's ear.

--------


interface Wagon {
  public:
    void Wheels();
}
class Grandma implements Wagon {
If Grandma had wheels, she'd be a wagon.

--------


Bricks[LOAD - 2];
Two bricks shy of a load.

--------


class Shadow {
 public:
  Shadow(Shadow); // copy constructor
}
class Person {
 public:
  Shadow Stand();
}

Person Skinny;
Shadow S(2 * Skinny.Stand())
So skinny they have to stand up twice to make a shadow.

Tuesday, January 19, 2010

Recollecting The Calculus

Allow me to summarize my recollections of The Calculus:

  1. One must always refer to it as "The Calculus," never just "calculus."
  2. The first derivative is the instantaneous rate of change, i.e. the velocity.
  3. The second derivative is the instantaneous rate of change in the velocity, i.e. accelleration. Etc, etc.
  4. Laplace transforms are a much easier way to compute derivatives.
  5. I have no recollection of how to use the Laplace transform.

Thats pretty much it, in a nutshell. I suspect that had the modern web existed back then, my calculus classes would have been different but my retention of the material decades later would be about the same.

Wolfram Alpha computing a derivative

Friday, January 15, 2010

Intel Acquiring FPGA Vendor?

EE Times reports on a JP Morgan Analyst prediction that Intel will acquire an FPGA vendor. The purported reason: to expand its competitiveness in embedded systems and system-on-chip. The two obvious market leaders in that category are Altera and Xilinx, though there are several smaller vendors like Actel and Lattice as well.

Fake Intel x86 with FPGAs

The SoC angle is interesting, in terms of the disruptive change it might allow. Freescale carries a huge variety of part numbers with various combinations of PowerPC core plus networking, USB, CAN-BUS, encryption, etc. Some of the functionality is implemented via an independant communications processor (a 68k descendant) alongside the PowerPC, to try to make each chip more flexible and able to serve different markets. Nonetheless, its still a very large collection of chips. Intel could be aiming for just a few different parts, with embedded FPGA blocks of various sizes and I/O pinouts. Need CAN-BUS? Buy a part with the right type of pins bonded out, with a license for soft logic IP to load into it. More sophisticated customers could load their own design logic into the FPGA blocks.

At one time Xilinx offered parts with hard logic PowerPC cores, but the CPU performance was modest and did not remain competitive over time. Xilinx and Altera both now emphasize soft logic CPU cores instead. These certainly work... but implementing a CPU in FPGA gates is an awfully expensive way to get your software to run. If Intel were to enter this space it would come from the opposite direction: a modern CPU core paired with a modest amount of FPGA logic.

EETimes published a subsequent rebuttal of the acquisition rumor, throwing around big numbers about the premium to be paid for Altera or Xilinx. The numbers make my head hurt, but its worth a read if you're interested in the topic.

Monday, January 11, 2010

Long Hidden Easter Eggs

As we have a 4 year old daughter, computer games have become part of the background noise in our household. One of the popular games at the moment is Pajama Sam 2. It was published in 1998, and we'll see in a moment why that is relevant.

Pajama Sam Boardroom scene

One scene in the game involves the Chairman of the Board brainstorming who should fill the empty board seat with the other board members. As it is a kids game the Chairman is an overstuffed seat, and the board members are anthropomorphic lumber. Of course. The dialog is complete filler, chosen at random from a small set of snippets:

Board Member: "Did I suggest Bernie from Research?"
Chairman: "Yes."
Board Member: "Did I already mention Bill, the Security guy?"
Chairman: "Yes."
Board Member: "Did somebody suggest the supply clerk?"
Chairman: "Yes."

There is one more snippet, weighted to be played with very low probability. I only happened to hear it once, when the game was left running for an hour. The developers had a little joke.


Board Member: "Maybe we could get Gil Amelio to be on the board."
Chairman: "I'd prefer an internal candidate."

Gil Amelio was the CEO of Apple at the time. Pajama Sam ran on both Windows and Macintosh, which was rather unusual for 1998. That was the deepest part of the "beleaguered Apple" period, where the death and dismemberment of the company was predicted daily.

This is funny for the parents, of course, because a corporate Board is supposed to consist mainly of outside directors to prevent excessive inward focus and make the company more Oh, nevermind.

Wednesday, January 6, 2010

Y2.01K

Crash the Y2K bug

Y2K was a big deal. A huge amount of money was spent updating older software which stored dates using only two digits. A common solution at the time was to treat dates of 00-09 as post-Y2K, and 10-99 as pre-Y2K. Effectively this only delayed the problem for ten years - our ten years ran out a few days ago. Some examples of failures experienced since Jan 1, 2010:

A huge amount of money and effort was expended in the 1990s to upgrade systems for Y2K. When Jan 1 rolled around and civilization did not end, there was much criticism that the whole thing had been hyped by vendors eager to sell new gear. Quite likely we overspent... but I believe the consequences of underspending would have been more expensive to clean up afterwards.

Fortunately, it appears that magic pixie dust is available to fix all Y2.01K problems, according to a press release from BogusTech. Obviously a spoof, its very funny and well worth reading.

Tuesday, January 5, 2010

A Big Day for Mobile Technology

Newton MessagePad 120

Today, January 5, 2010, will be a big day in the history of mobile technology. A huge day. Any tech news site worthy of your attention should devote many resources to the events of today.

I am, of course, referring to the impending Newtpocalypse.

The Apple Newton was a groundbreaking device. The picture accompanying this post is my much-beloved Newton MP120.

NewtonScript tracks time intervals using a 30 bit signed integer, with an epoch of 1993. 229 bits from 1993 is January 5, 2010, at 6:48:31 pm. Tonight. When the NetwonScript time overflows into bit 30 it becomes a negative number, and Bad Things Happen. Fixes have been developed, but only for the later model Newtons. My beloved MP120 will stop working tonight. Sniff. Of course, it hasn't been charged since 1999 so its effective behavior will be unchanged.

PS: in addition to being the Newtpocalypse, I think Google has some kind of announcement today relating to mobile tech.

Monday, January 4, 2010

Access Hatches

Underground labYes, the rumors are true. Google has constructed a series of secret underground labs connected by high pressure pipes, to synthesize and transport Google Juice around the planet. Google Juice is devilishly difficult to generate and must be infused into a website quickly before it begins to destabilize, though once absorbed by the server it is remarkably stable.


The apparatus which powers this system requires constant supervision and maintenance, and if you watch carefully you might spot the access hatches scattered here and there.

Google manhole cover

(Kidding. Really. Nothing to see, please move on.)