Sunday, April 29, 2012

Power adapter fun

This is one of those posts that will help one person out there who is googling around for a power adapter for a Western Digital MyBook Essential (or other MyBook model).  (Well, rereading it, it is somewhat useful for learning to match power adapters to electronic devices in general.)

The Western Digital MyBook Essential is a USB hard drive which comes in 1TB, 2TB, and 3TB sizes  and is very economical for the space you get, and has slightly more expensive models that support built-in full disk encryption.  Unfortunately it is useless if you do not have a power adapter (which it comes with but is easy to lose), because USB does not supply sufficient power to drive the 3.5" desktop-sized hard drive it houses. After some research it looks like the power adapter is 12v center positive.  I have a multi-volt power adapter that works great (solid constant power even when powered from a car inverter.... don't ask) but it is only 300ma.  The higher powered multivolt adapters I've purchased from Radioshack and Fry's tend to have dirty power when driven from a car inverter or simply don't work for some reason - these have all ended up in the trash.  The 300ma power adapter is not enough to power the MyBook USB hard drive, which comes with a 1.5 amp power supply, so it was back to the drawing board.  I remembered from robot labs that Bioloid AX-12 etc. actuators use 12v and have huge amperage - 5 amps (60 watts total!).  Looking at the ax-12 adapter, it is indeed center positive (also called "tip positive") so I tried the plug to see if it fits and... viola', MyBook works like a charm.

Although trying reversed polarity seems like it would break electronics in my experience the electronics do not break on reversed polarity but simply don't turn on (I tried this while playing with some electronics I never expected to work, so the risk was low, and they eventually did work so I learned reversed polarity didn't break them).  This doesn't apply to anything we did above because we checked and matched polarity properly - I digress.

Now to find the USB 3.0->USB 2.0 adapter, ugh!

Saturday, April 28, 2012

Slashdot comment of the day #2

The original post titled "Hobbit Film Underwhelms at 48 frames per second" continues to say:

"Warner Bros. aired ten minutes of footage from The Hobbit at CinemaCon, and reactions have been mixed. The problem? Peter Jackson is filming the movie at 48 frames per second, twice the industry standard 24 frames per second, lending the film a '70s era BBC-video look..."

To which an Anonymous Coward responds:

"Could you show me what this "70s era BBC-video look" is. Despite having seen lots of 70s era BBC-video, I'm unable to understand what you're talking about based on the description."

A cultural reference nobody gets, LOL.  * slaps knee

Monday, April 23, 2012

Censorship: you link it, you bought it

In the aftermath of the unexpected and exceptional success of protests against PIPA ("Protect IP Act") and SOPA ("Stop Online Piracy Act") we can begin to rethink what world it is exactly that we live in.  For one, it is a world where legislators better think twice before fucking with the Internet.  Making linking a crime (or a de facto crime) is not a solution.  The burden of implementing filters is too heavy for those entrepreneurs trying to stretch what the Internet can do.  For example, a wiki can be implemented in just 4 lines of Perl Code!  If links posted to the wiki must be filtered to protect the wiki owner from a PIPA-like or SOPA-like law, then the implementation requires tens of thousands of lines of additional code.  In addition, a huge database of song/text/video signatures must be maintained to enable such filtering (which afaik does not generally exist, though YouTube has coordinated with content owners to get such signatures, and Apple has obviously created one for music), potentially increasing the cost of running sites like a wiki by many times.

Censorship is becoming an increasingly important issue as the amount of content continues to explode:


I was reminded of this while watching The Hunger Games for the second time (spoiler alert!).  At the end of the movie Cato is being eaten by monsters and Katniss decides to put him out of his misery by shooting him with an arrow.  In the book he is shot in the head, an ending that is very quick and humane.  In the movie the director Gary Ross had to achieve a PG-13 rating, and therefore thought in his mind what a PG-13 rating would most likely allow, or may have even  been guided by the MPAA more directly.  He must have concluded a shot to the center of the chest, because that's where the arrow lands, however this would be a MUCH GORIER death than an arrow to the head.  Why an agency is able to dictate what is and is not acceptable movie watching is beyond me.

When the choice of whether to be exposed to a piece of content is "opt-in" (whether a movie or a wiki post), then why not let artists and authors decide what to do using their best judgement?  The workarounds for consumer judgement, however well intentioned, have all sorts of ill side effects, which consumers are necessarily made blind to.

Sunday, April 22, 2012

Flash vs DRAM follow-up: chip stacking

As a follow-up to our Flash vs DRAM article, which has become quite popular with search engines, I thought I would do a little research into verifying that flash chips are indeed stacked as we understood them to be at the time of writing.  We can see that to reach 32GBytes (256Gbit) chips built by Toshiba on 43nm back in 2008 were using 8-way chip stacks.  Micron even has 64Gbyte (512Gbit) Flash "chips" (multichip packages) in production.  Contrast this with Micron's largest DDR3 chip weighing in at 1GByte maximum, which is only just sampling, and you can see a difference of 64x capacity improvement.

What is great about Flash is that it is essentially "dark silicon", i.e. silicon that is not actively switching transistors most of the time, meaning less power consumption, which equals less heat.  This is because the bit-saving charge is held in nonvolatile capacitors and does not need to be refreshed, read, or written to unless a user program needs to read and/or modify the relevant data.  Chip stacking has the unfortunate downside of insulating the inner layers so that the ability to effectively cool the overall package is severely diminished.  At 1/2 watt  - 2 watts in aggregate (or 0 watts when inactive), Flash chips/modules are in no danger of overheating.  This means Flash is the type of chip product that is most amenable to chip stacking, and therefore it is no surprise that chip stacking has only really taken off with the recent attempt of Flash manufacturers to beat Moore's law at chip density (see that 20nm single-chip thick flash chips are only now reaching 16Gbytes).

Here we can see a beautiful picture of Toshiba stacking 8 Flash chips on top of each other.  All told that is 1.4 mm thick including plastic packaging!



Note another reason that Flash is amenable to stacking: it doesn't support high bandwidth, so pins on the edges of the chips are sufficient to support the reads and writes.  This is truly profound and in conjunction with its dark silicon characteristics we get we get the dynamic duo that enables chip stacking today: Stacked flash needs no cooling improvements or 3D interconnection of the dies.  Slam dunk.

The 3D integrated circuits of tomorrow will have an improved ability to provide communication between the chips at higher bandwidth, (see here, here, here) but heat will continue to be an issue.

Saturday, April 21, 2012

Wherefore art thou AMD?

33-year-old techies like myself, and the giants who came before (upon whose shoulders I enjoy standing) can remember back to a few times where AMD got to eat cake.  K6-2, Athlon, and AMD 64 processors all did well... until Intel's Core 2 microarchitecture blew AMD out of the water, a volley AMD has never recovered from.

One of the issues is clock speed.  I was reading through material (kudos to David Kanter over at realworldtech) today and realized there are stark differences in Intel's Core 2 memory management unit (MMU) and AMD's Barcelona (the poor gladiator that got thrown into the ring with the Core 2 titan :-(

Somebody must have sneaked a Scooby Snack into my Taco Bell burritos because I decided to follow a hunch..

The purpose of the MMU is to translate virtual memory addresses (the ones that a user program thinks are real) into physical addresses (the ones the operating system knows are real).  The translation-lookaside-buffer (TLB) is a content-addressable memory, which works like a hash table in order to map an input A to an output, where there are too many possibilities for the value of A to fit all possible mappings in the TLB, so you hold just the few you can fit in hardware.

Given a bag of useful A values, determining which one corresponds to  the current MMU address input is tough (i.e. power, time, and silicon hungry).  You could look through them one by one but that would be really time consuming.  Instead, two techniques are used: 1) the least significant bits of A are used for lookup into the TLB, and 2) Multiple values are fetched from the corresponding TLB entry (called "ways" of "set associativity") and verified to match the higher bits of A.  If one of the "ways" matches then you have found a proper mapping to physical memory and can proceed to do the physical memory operation.  If none of them match, then you have a "TLB miss" and have to resort to plan B.  Plan B  is an exception handler written in software or firmware (microcode) that looks into a larger memory for a match (slow).

From David's excellent article (his greatest work to date IMHO) we see that Barcelona implemented a grand total of 48 ways, and uses NO BITS to sort between them using step #1 above.  In contrast, Intel's Core 2 has 4 ways, and uses 2 bits to sort a total of 16 entries into 4 sets of 4 ways each.

It is obvious that Intel's strategy is more conservative.  In this case Intel's method delivered more speed using less silicon area and power.  As I discovered this tidbit I remembered that Barcelona had problems, not the least of which was lower-than-expected clock speeds.  This is best exemplified by AMD's switch at that time from frequency comparisons with Intel to PR Ratings.  Oh brother, they also switched to giving power consumption in terms of ACP rather than just TDP (the term upon which Barcelona was unfit to compete).

Barcelona arrived later than late to the party.  Truly unfashionably late.  During my research for this blog post (Oy vey, we are getting long aren't we) I rediscovered that Barcelona's production was reduced for many more months after its release due to, what else... a bug in the TLB!

Looks like our hunch was right, 48 fully associative entries in the primary TLB was the wrong design.

Note to self: don't fuck up the TLB.


Friday, April 20, 2012

Best slashdot comment of the day #1

In a discussion about new electric vehicle battery technology from IBM that would have very high capacity but would still take a long time to recharge; Belial6 writes:

"That's why the cars need a standard connector on the back. So you can hook up that generator trailer and recharge while you drive. "

+5 Funny :-)

Zipcar: some pros, some cons, but very different

Picked up my Zipcar for the first time today and had a surprising experience in many ways.  First, it was not easy to get an account set up because their website wanted two years worth of driving experience records and my California driver's license only goes back to this summer.  Since I did not know my New Hampshire driver's license number (they make you turn it in when you switch states) I just left that part blank and figured it would go through.

Nope.  Got an email the next day asking for a previous driver's license number.  If I were dueling zipcar this would be Point Zipcar.  Fortunately my wife Nancy was willing to give it an effort and called up New Hampshire.  Having lived there for 5 years we got pretty good at anticipating the quirky way things go there (some might say backwards way, but after 5 years it strangely starts to all make sense).  She called up our previously local DMV (only 70 miles from where we lived!  and people considered our area "urban") and got the driver's license number pretty easily after I popped on the phone to say that I was me.  Point Nancy!

Well it can't be that simple can it?  While filing taxes we took my driver's license out of my wallet to see when we had become residents according to the DMV.  You know what happened next.  It was lost.  I blame 1-year-old Gabby, whose light fingers have gotten us into trouble before.

Well to get to an appointment today I needed a rental car, and without a driver's license it is not possible to rent from a traditional rental place (even with a temporary driver's license, if it is from New Hampshire they will still likely turn you down because they look incredibly fake, rather than officially temporary like a regular piece of paper.. but that is a different way-too-long story).  The prices for local Enterprise compact/economy cars are great, near $25/day, but without a license that is not an option.


Enter Zipcar.  With my newly activated ZipCard I reserved a car.  Only one was available, and I could not figure out how to get their website to show me more options.  Very strange.  Regardless, it was only 5 miles away (note to Zipcar, you need to become sufficiently ubiquitous that you are always walking distance from home - this is why you have so much success on university campuses of course).

I got the above prius, named Pygmalion, but without the cartoon backdrop unfortunately.  Got off without a hitch, though for some reason I figured the card scanner was close to the door lock, rather than the windshield, and that direction of the card wouldn't matter (which was proximity based) but it seemed to.  No points for picking it up a 1/2 hour late, I got charged for that, oh well.

Drove to my appointment in a somewhat abusive manner - the Prius has plenty of power to make you feel unencumbered, especially when the gas is free (Point Zipcar) and your foot is heavy.  The only strange things were that if you push hard on the brake, as I sometimes do when I stretch, it deactivates all acceleration (probably something to do with that Toyota accident and subsequent recall?).  Also it is slow to takeoff from a stop unless you give it a lot of gas, but I think that is just the programming hybridness of the car trying to force you to be efficient.  It seems to me that you could apply just the electric motor for the first 10 mph and use very little energy even when accelerating - I think the Prius programmers were trying to train my psyche to slow down.  The car would beep at me whenever I parked and left the vehicle, perhaps something to do with the key being left in the car, which you must do in zipcar.  That was a little unnerving but whatever.

I arrived back at the zipcar parking spot 13 minutes late.  In the city being within 13 minutes of anything is a victory in my opinion, but not, apparently, in zipcar's.  This led me to 1) be looked at in a suspect manner by the next zipcar user who waited patiently for me to get out and looked even more unnerved by the strange beeping 2) be charged for an extra hour of rental.  That seems a bit too much, and scheduling things down to the second seems  a bit excessive as well.  Point Zipcar?

In the end Zipcar has all the points, some gained by its nice features (e.g. ease of renting with a lost license) and some gained as an adversary against whom you have no recourse.  I get 1 point because I married a wonderful wife that knows how to jump through hoops and help me through them.

In the end the Zipcar was more expensive to rent for 3 hours and 13 minutes than a 1-day Enterprise rental, but for these short durations the differences are only a few bucks (taking free gas into account) and convenience trumps.  This means Zipcar wins the competition, unless I happen to be the zipper dropping off the car right before you, in which case you will have some moments of nervousness wondering when you will see the car :-)