Tuesday, November 20, 2012

Instruction Sets



A computer. Without an instruction set. Is nothing.

Possibly because even the techies don’t know much about them and you know the old saw, better to keep your mouth shut and all that.

What’s an instruction set? Well, it’s the language your processor speaks and its ‘words’ are composed of strings of binary digits, commonly referred to as machine code. At its basic level, this code is responsible for enabling and disabling where control pulses are directed in the micro. Back in the good old days, memory was expensive and clock cycles were valuable. The only way to program a computer was explicitly with machine code- there were no compilers or high level languages. Even operating systems were rare. They sucked up valuable resources.

Adding A to B and printing the result might look something like this…

10000001             Data in following addr to register A
00001010             Addr for A
10000010             Data in following addr to register B
00001011             Addr for B
00100001             ADD A to B; Result into C
11011000             Print Register C
11000000             Halt

The text to the right is simply comments, the machine of course only understands the binary code. While this is actually pretty compact, writing anything more than a simple program becomes a frustrating and error-prone process. Imagine debugging a program like this without any comments. And programs could easily exceed 100,000 lines.

If only there were a way to make the computer understand more human-like language and automatically convert..or..compile.. its own program. And so came Fortran (formula translator) for scientific work and COBOL (common business orientated language) for business uses, like invoicing and payroll.  And of course a myriad of other languages. For example, BASIC. The same instructions to the computer would look like this:

A=5
B=7
A+B=C
Print C

Now that’s programming! The downside is, the computer has to first examine all of our code and interpret it according to the rules. This means it might not always interpret what we want correctly, it also means our program will end up larger then intended with non-value added code, and because it’s larger and has more lines of code, it will run slower. It sees numbers that aren’t in parenthesis and so it assumes these will be variables. It sees the plus sign and so it assumes an addition will be performed. It looks for any characters after the word Print to determine if the output will be a variable or literal text. And then it writes its own binary code (just like we did above) to perform this. But no bets if the compiler will end up with the same code as we did.

Granted, there’s not much open to interpretation in something like A+B. But imagine a complex algorithm that used multiple constants. The programmer would know which storage locations were no longer needed as one-time use variables were used. But the compiler wouldn’t. It might just keep reassigning new locations as variables were called. It may end up using more memory and more cycles accessing them than is necessary, but today, we don’t care. We have Gigs of RAM and GHz processors. In fact, the whole GUI environment is a valid parallel of this. What would take one line to type in DOS to launch a program, requires a complete graphical environment with a pointing device, video mapping, a graphical file hierarchy, etc. etc. But again we don’t care, we have horsepower to compensate.

Imagine if we couldn’t make B=7. If all our variables had to go through A first.
First Set A=7. Then Move A to B. Then Set A=5. Now Add.
Imagine the bottleneck this would create if we had a list of numbers to assign!

Nobody says an instruction set is going to be easy to work with. A good instruction set translates into faster throughput. A faster machine. More flexible programming. Anyone that went through the Mac vs. PC wars of the 1990’s will remember how the PC with the faster Intel chip was getting smoked by the Mac’s PowerPC. I won’t go into those details here but it’s an interesting story. And as computers evolved and compilers became popular, the instruction sets took on a decided bent towards accommodating those languages. 

So while guys are beating their chests and boasting about their latest processor speeds, hard drive capacities and RAM figures, you’d do well to ask them about the efficiency of their instruction set.

[Incidentally, the binary code in the example above is real. It’s part of the instruction set of my computer]


Tuesday, November 13, 2012

Hang on!



Thanks to Cara and the parents, we’ve got 50 more pieces of siding stained and ready to go up. Likely, the snow will be flying when I put these on. The furnace venting is now complete, and the pigtail and shutoff wired in. The LP was installed for a princely sum and not quite where I had wanted it…another story. But we have heat and that’s what counts when you’re trying to keep things from freezing. I’ve got my eye on a nice thermostat which will be the subject of another post, but at the price of an iPod, it’ll have to wait right now.  

The final drywall coat and spray texture is finished upstairs and we actually started priming the walls and ceiling last night..given the consistency of the paint and the number of gallons we’ll need, this could be a long process. I also lined up delivery of the carpet, which is scheduled for Wednesday. AND, found an installer who will take the job on, hopefully this week. It’s a delicate balance between getting it done “now” and giving us time to get all the paint up, plus he’s doing it in his spare time.

Picked up the floor registers and repainted them a nice dark hammertone to cover their beige-ness. Have some 9x9 VCT for the kitchen that might work if I can make use of a couple of cracked corner tiles..NOS so it’s not like I can run out and pick up any extras. The laminate samples arrived but that’s also a big-Q. Nice patterns, but you either get super-gloss or uber-matte. No in-between.

As if this weren’t enough excitement….plus my day job of trying to keep projects on schedule…there was a hearing on Friday to share with the public, Mid-America’s plans for upgrading their high voltage transmission lines over a route that passes directly over my land. This is a major upgrade with poles much larger (towers, actually) and taller than current and of course the path has changed dramatically. Since it affects both us and the neighbor, we’ve got plans to discuss and hopefully arrive at an agreeable placement of one of these towers. Otherwise…we’re looking at a game-changer.

Now, Dec 1 is move-in day, but I leave this Sunday for testing in Chicago, will get back just in time for Thanksgiving, hop in a car and head for MN the next day, re-pack my bags and turn around and go back to Chicago that Monday, and come home the day before move-in.

And to add the news that trumps all of this petty running-around, my grandfather passed away on Veteran’s day, with funeral planned for this weekend.  He fought at Anzio, one of WW2’s bloodiest battles, losing an arm and taking much shrapnel, and against all odds, made it home alive. Amazing.



Friday, November 2, 2012

And an Update...

Friday, November 2nd, 2012.

The drywall is moving along and most of the upstairs is on the 3rd coat. In fact, things have been clicking into place such that I was able to finish hanging drywall in the NE corner over the big corner windows and the 54" wide sheet over the downstairs door..something I hadn't anticipated being done until months from now. This works out well because the mudders and tapers can hide the screws, finish the corner and texture the works at the same time that they do the rest of the room.

The furnace and ducting are now installed. I just have to connect the external vents and run the wiring. I put up the first row of rear east-side siding last night since the gas pipe must extend through it before the regulator goes on. Kind of impossible to do that if the gas is already hooked up. This was also a good time to pull down the small lower soffits and seal for any drafts and stuff in extra insulation.

Speaking of which, the LP company is currently enroute to set the 500 gal tank and start trenching-in the copper tubing. Then a second truck will stop out today and fill the tank. In theory, we may be able to give the furnace a test run this weekend which would certainly help with the drywall curing upstairs.

I received notice yesterday that our carpet has arrived at the local store. Our plan is to paint the ceiling after the spray texture is done (I imagine by mid-week) and get that carpet in ASAP. Unfortunately, the kitchen VCT can't be selected until the counter-top laminate samples arrive, and that could be anyone's guess (found a non-mainstream design company with some great patterns). So....we'll end up having to cut out a section of carpet after the fact to install the VCT.

Exterior stairs are now finished and have provided much relief to the drywall guys. Yes, the spiral stairs are tight, and I can vouch that one would not want to haul any sort of equipment up and down them. Also, genuine Remcraft light fixtures have arrived. Pricey, but much more reasonable when you buy them from a closeout lighting store. And genuine Made-In-America. I'll try to get one installed Sunday..which means moving the picker.

I just got off the phone with CFU and their voluntary-enrollment program for their smart meter is experiencing delays. Actually, getting their website up and running is proving to be the problem, or so they tell me. Our new meter was installed weeks ago but those of us on the trial program will have to wait for the URL and password.

And this weekend's big project...try to finish the soffits (or at least reach the last rear corner). This calls for a functional circular saw and temps adequate for painting. Both are dicey propositions right now.

Late October 2012