Technology has a habit of hanging around well past its welcome, like a dinner guest who, despite their empty wine glass and the clatter of dishes being cleaned lingers until being handed their car keys.
To the left is a punch card with an VIN, Vehicle Identification Number. All cars produced since 1981 must be uniquely identified with a standard VIN which means there must be some agreement as to what constitutes a VIN, and such a thing exists at ISO 3833. Wikipedia contains a reasonably good description of the standard if you don't want to shell-out for
Last model year: 2012 |
Punch cards, like the one above, encoded data in BCD (binary coded decimal) form. When stored in a computer, these punch marks were more or less translated to numbers based on the digits punched from the cards, eventuality morphing into EBCDIC. Standardized in 1963ish by none other than IBM, EBCDIC assigns numeric codes to characters so the data could be manipulated by the CPU, transmitted electronically and stored magnetically.
VIN Punchcard Vestiges
Nice to know a bit of computer history, what does EBCDIC have to do with cars? This all relates quite directly the data stored in digit 9 of every VIN: the check digit. The first-order test if a VIN is valid is a check of the digits of the VIN against a curious algorithm involving translating the alphabetic characters into what seemed to be odd numbers.Here's how one calculates a VIN checksum:
- Translate alphabetic characters into some number
- Multiply each digit by a weight (why? read on)
- Divide sum by 11
- The remainder from the integer division in step 3 (the modulo, if you want to sound all fancy-pants) is the check-sum
ABCDEFGHJKLMNPRSTUVWXYZ
12345678123457923456789
Let's walk through an example: Pick a letter, let's use M, look at the punch card's top row to locate M, then trace downward to the numbers, notice 4 has been removed (or punched)? The letter M is encoded to 2 in the table above. All of the letters above work the same way -- meaning the translation table above maps to a 1960's era, plant-derived storage device.
But, wait, there's more: encoded in EBCDIC, which is how this data would have been stored, "M" would be represented as D4 in hex or 11010100 in binary. To do the translation above, the engineer would just need the lower four bits (0100) and to get those the operation is very easy, just need to clear the upper 4 bits with by "anding" (binary and, &, means the result is 1 when both values are 1) with 00001111 (0F in hex):
11010100
&00001111
--------
00000100
The result is binary 100, or 4. Just like what's in the translation table, which is based on lowly punch card. A bit complex to write out in English, but for a computer, this "and" operation is baked into the CPU itself, typically one assembler instruction that runs in one clock cycle, and therefore executes quickly, which was very important when computers much slower than the phone in your pocket ran the Pentagon in the early 1980's.
Positional Coefficient
While we're dissecting the check digit, let's continue with the multiplier for each position in step #2. This feature of the VIN helps with the common problem of transposition, or swapping two adjacent characters. Consider a three digit VIN123
Now, calculate the check sum by adding the numbers 1+2+3 = 6. Let's say you wrote the VIN incorrectly as
132
This also sums to 6. Having a multiplier for each position will result in the sum being different (under most conditions...) in the case of transposition. Clever!
Last Step: Modulo
Once we've done our translation and multiplication and summation, the last step is calculating the modulo, or the remainder of integer division. In this case, we divide the sum by 11 and the remainder is our check digit. But wait! It's possible to get 10 as a remainder, but the check digit is just one character, then what? In this case, the check digit appears as "X", the Roman numeral for 10. So not only do we have old-time punch card encoding sneaking around in the VIN, we also have a little influence from our Tiberian friends.Like the "and" operation, the CPU contains a "modulo" operator and the operation can be efficiently performed in one clock cycle, at least on modern computers, probably one cycle on old-timey CPUs as well.
GitHub
While experimenting with all of this, I ended-up creating some code to do the VIN validation. Not wanting to leave any development to waste, this can now be found on GitHub here. The committed code contains a little extra, in that it will check the manufacturer code as well. There's better VIN verification programs out there, but this is fairly simple for the reader who's interested in seeing the algorithm.Lift Supports
Current lift support |
For the Freestyle, the manufacturing line changed for the 2006 model year, and there's a different lift support depending on when the vehicle was built. To find out the build date, one uses the VIN and the magic of the FordETIDS web site. When I was looking at the VIN, I began wondering. "What's in that number?" The digression above being the result.
ETIS record for the Freestyle |
I found that my Freestyle was manufactured 19-Aug-2005, and probably more than I wanted to know thanks to FordETIDS. With this information in hand, I ordered the right lift supports for a few cents under $40. When the parts arrive, I'll cover the replacement process, which doesn't look too difficult. The freestyle's an excellent "grocery getter": with the back seats folded down it's easy to load and unload and holds a huge amount of cargo. Holding the tailgate with my head was becoming a drag, so I'm happy that will be a thing of the past in the near future.
No comments:
Post a Comment