How to Build a Computer From Scratch

Building a computer is not really hard. The reason why is because there aren’t that many parts, it is pretty obvious where the parts go, the parts are designed to only fit one way, and it doesn’t take much strength or force to assemble the machine.

What are the basic parts? A working computer requires surprisingly few parts. It might not do much, but it counts.

The minimum parts required for a working computer are:

Power supply, CPU, Motherboard, RAM

With that configuration, you have a computer a system that is “functional”.

The problem is that there is no visual feedback…or in computer terms there is no output. To get output, and test to see if your parts are working you need only to add a keyboard with a caps lock or number lock display light. When added, if all the parts are working, you can  press the caps lock to see the light go on and off. For this to work, the CPU, ram, and motherboard must all be working together correctly and receiving power.

Of course, that is not nearly enough to build a real computer! You would like to have a nice display of course, and a mouse, and at least an operating system.

Most modern motherboards come with much of the peripherals built into the board. So a decent motherboard would also get you sound and video, as well as USB, and wired networking.

So let’s relist:

You need a power supply, CPU, motherboard, ram, video, sound, USB, keyboard, mouse, and hard drive.  Don’t plug the power supply into the wall until you are ready to test the system. I suggest that you use an anti-static wrist band and ground yourself before you begin handling your parts.

The first decision you want to make is what processor do you want to use. How powerful, and what type? This determines what motherboard you will choose.

The two types of processors are AMD and Intel. Typically at lower power, AMD provides a better value, but Intel dominates high-end machines. When you choose your processor, you will need to choose the motherboard to match, and then you will need to choose RAM that works with that board.

So your basic starting point is CPU, Motherboard, and Ram. Once you have that worked out you are going to be in pretty good shape.

If your motherboard has audio and video on board, and you don’t need powerful graphics for high-end gaming this will save you money. In most cases, you can add a boss graphics card later.

The installing the CPU is probably the trickiest part. The good news is that motherboard manufacturers provide really good manuals with the board to walk you through the process of putting your machine together. You will want to study your motherboard manual carefully before you start.

As I said, the CPU is the tricky part. The pins on the CPU have to match the slots in the CPU socket on the motherboard. Specifically, PIN 1 of  the CPU MUST MUST MUST go into slot 1 of the CPU socket. The CPU will have pin one marked on the CPU and slot 1 of the CPU socket should be marked on the motherboard. If it is not marked on the motherboard, the motherboard manual will have a diagram that shows where pin 1 fits. Once you have the CPU in the socket you must install a cooling fan and heat sink on top of the CPU or it will burn up in a fiery supernova and you will be very sorry. Usually, there is a little packet of grease called thermal paste that makes a nice seal between the heat sink and the CPU. Find that paste, and apply it to your CPU, then fasten the fan and heat sink to the mainboard slots surrounding the CPU. This can be difficult physically to do, so take your time and get it right. You can ruin your fan and heat sink if you are not careful with this process. Once you have the CPU, heat sink, and fan assembled together and attached to the motherboard, you should look in your manual and locate the power connection for the CPU fan. The power cable from the fan must be plugged into the motherboard to activate when the computer is powered. Make sure its plugged in. Do not let your computer spontaneously combust because you forgot to provide power to the CPU fan.


Now you have the CPU installed, so the RAM is next. The ram has a slot near the middle that ensures it can only be installed the correct way. You will need to use a little force to install it, but not too much. If you feel you are forcing it to check to make sure the slot in the ram matches the divider in the ram socket on the main board. Pictures will help this post, and I will add some.

With RAM and CPU installed into the motherboard, you can go ahead and fasten the motherboard into your case. You will also need to install the power supply into the case, but this is a fairly straight forward process. Pretty much align it with the screw holes and use a Philips head driver to fasten it in place

With Power Supply, CPU, RAM, and Motherboard connected, you will need to consult your motherboard manual to see where the power switch wire from your case hooks into your motherboard. The board has what are called jumper blocks, and they have pinout assignments. That means each pin has a number, and these should be marked on the board, as well as diagrammed in your manual. You can find the wire from the case’s power button and it will be marked something like PW SW. Fit that onto the correct jumper on the motherboards jumper block.

Now you should plug in a keyboard and you are almost ready to test your basic parts. Double check everything first. The CPU is positioned correctly based on the motherboard’s pinout diagram. The fan and heatsink are firmly attached to the CPU and there is thermal paste creating an airtight seal between CPU and heatsink. The RAM is seated correctly into the ram slots, and the fasteners at each end of the slot are fully upright and fit perfectly into the notches on each end of the ram.  The motherboard itself is firmly fastened to the case and is not loose. You have your power switch wire from the case attached to the correct pins on the motherboards jumper block.

If all this looks good, find the very wide set of power cables coming from the power supply. What I mean here is that the connectors at the end of the wires will be very wide and will match up to the main power connection to the motherboard. What is your friend? The motherboard manual is your friend. Check and attach the power supply to the motherboard in such a way that you can tell it is locked in place.

Now hook up your keyboard. Finally, grab the main power cord that plugs into the back of the power supply and the wall. Plug it into the power supply but not into the wall yet. Some power supplies have a dual setting on the back for 110 and 220 AC. In the USA we use 110. Make sure your power supply has its current switch, assuming it has one, set to 110. If so you can now plug your cord from the power supply into the wall. Sometimes when you do this the power supply fan will spin just a bit. That’s not a bad sign at all.

Now you can activate the power switch on the case. When you do, hold it in for at least  5 seconds. If everything is correct the CPU fan should spin up, the power supply fan should activate, and if you are watching the keyboard, caps locks and num locks indicators will flash. If you miss this try clicking your caps and num locks a few times and see if the lights go on and off. If so you are in business. If not something is wrong.

If you have no power at this point, you either have a part that is faulty, or something is wrong with your assembly. The best thing to check right away is to make sure you have all the power cables connected correctly. This includes the power from the power supply, checking to make sure the power supply on/off switch on the back of the power supply is switched to the on position. Sometimes there is an extra power cable that plugs directly into the motherboard. It might be yellow and black, and have four connectors. If this is required and is not connected the machine will not power up.

If you made it this far and your machine is working, you have crossed a major milestone. The rest of the job is fairly straight forward. Hooking up the hard drive and other peripherals is fairly simple, and if you have installation media, installing the OS is a breeze.

No doubt a YouTube video would be the cat’s meow here. I may very well meow tomorrow and make one. I have the parts to put a machine together, so it’s just a matter of creating the video.

Check back soon, and good luck!

Watson Diagnoses Cancer

You may have seen that some Japanese doctors were stumped with a patient diagnosis, and fed the symptoms to IBM’s Watson, who promptly provided the correct diagnosis and treatment for the patient’s rare form of Leukemia.

How long do you think it took the supercomputer to render that diagnosis and provide a treatment option? Seconds?

Doesn’t that make you wonder why we need doctors at all? Why can’t I just upload my symptoms to Watson, have it make the diagnosis, upload my prescriptions to CVS, and have them delivered to my door?

Could computers handle law? All of law? If we can agree to arbitration, why not simply have a computer provide the arbitration?

People looking into the future see a time when no human labor will be needed for anything. When will that be? 30 years? 50 years?

How will we make money?

Another question, when all the soldiers become robots, will there be any refusal of orders for reasons of conscience? It answers itself. Of course not.


Installing Apache Cordova (Phonegap)

If you are interested in writing mobile apps with PhoneGap/Apache Cordova you can either use Adobe’s Phonegap service which allows one free private app before you have to pay, or you can use Apache Cordova’s free platform.

In case you don’t know Phonegap/Cordova lets you write mobile apps with HTML5, CSS, and JavaScript. In many cases, you can write one set of code to compile for all three major platforms. This is far more efficient than learning Objective-C/Swift for iOS, Java for Android, and I assume C# for Windows phone.

The trick to getting Cordova to setup on your machine is to understand the prerequisites. If you just go to the Cordova site and start to install you will realize quickly that you need the platform SDKs for the devices you intend to target.

What does that mean? It means before you install Cordova you need to first install other software because it depends on other software to work.

I primarily target Android. Exclusively, would be more correct. To set up Cordova for Android, you first need the JavaSDK, then you need Google Android Studio, then you can set up Apache Cordova.

If you want to go a step further and do Rapid Application Development (RAD) with Ionic, you can now install Ionic and in theory, should have everything you need. To be clear. Ionic, is not required for creating mobile apps with the web stack, but rumor has it that it speeds development. I have not used it.

I assume if you wanted to target iOS with Cordova, you would need to install Apple’s Dev Tools and SDK. I am guessing you would only need to install XCode to get everything but I don’t know for sure. What I do know, is that you need to own a MAC, to ultimately publish for iOS.

I have an Android phone, and I think people who use iPhones are terrible, mean people, so I don’t develop for iOS. That means I am no expert. But I think if you want to use Cordova for iOS, you need a Mac, XCode, and Cordova and you should be good.

For Windows? Who knows. Probably .net and whatever Windows Phone SDK Microsoft is using. Then add Cordova.

But the main point is that Cordova has dependencies based on the platform you are targeting, and you need those dependencies before Cordova can compile your web apps.

What is a machine’s favorite color?

I’ve wondered about the idea of what I call Killer AI, Skynet and terminators and Agent Smiths and those types of things.  Isn’t the idea that the machine would see that humans are a threat to it, and then decide to exterminate the race? What I find puzzling is why would a machine care?

Another model I have in my mind for AI is Mr. Data from Star Trek the Next Generation. Continuing with the idea of a machine caring or not about its existence, many times we saw that Data simply did not care. If you told Data that you were going to switch him off, he would just shrug and be switched off. He had no preference.

My favorite color is blue.  Why do I prefer blue over other colors? I just do right? I’m built that way, so to speak. I came out of the box like that.

How was I built? What process built me? Well, I was built by my mother and father who combined their genetic material to create me. I assume that somewhere in that material is a code that causes me to prefer blue. I would further assume that this code conferred some advantage to my ancestors, that caused them to survive and pass the blue code on. So in the larger sense, evolution built me, and evolution has set me up to prefer blue. Perhaps my ancestors were people who prospered by the bright blue ocean.

In any case, what I am getting to here is that the reason I think I have preferences is they give me survival advantages. This brings me to another point. A more important point. I believe I have code in me that gives me a preference for self-preservation. Or perhaps simply causes my system to attempt to preserve itself.

One specific mechanism of preservation is fight or flight. When I sense that I am  being threatened, my body reacts by energizing me to either eliminate the threat or flee from it.

From a programming perspective, what does my system have to do to be able to self-preserve?

Well, first it has to have some idea of self. Does it? Perhaps idea is the wrong word. No idea is required I think at all. But somehow the system is designed to maintain its integrity.

I can take a hammer and smash my computer to pieces. It will do nothing. However, if I were to try to take a hammer to my dog though I would certainly not, but if I did, he would run away and hide.

How would I model this with a computer program? I know literally nothing about this area, and I am sure it shows. But I find it interesting to think about. So bear with me, and lack of humility in assuming anyone is reading this.

I could create a JavaScript program, say a circle animation.  Suppose the animation were in a loop, and there were other animations that also spawned in loops. So what we have are lets say circle animations and square animations floating around on screen.

One rule we could make would be that if a square collides with a circle, the circle is destroyed. That gives us a threat.

At this point, however, the circle does not care. It has no “preference” for existence or nonexistence. How could it be imparted with a preference? That is very difficult for me to think about.

More easily I could program it to avoid the squares.  That seems a far cry from giving it a systems level integrity bias that I think of as self-preservation. But it might be a start.

By now though you can see where this is going. You probably saw it long before I did. If we programmed computers to care about things, they might not care in the same way we would care, but the effects would be the same. If we programmed a computer to prefer blue, it would prefer blue. In fact, we can program a computer to prefer blue, and it can find blue for us, even if we ourselves can not see the blue.

I see no reason why a programmable construct could not be designed to maintain system integrity. It could also be designed to avoid threats to integrity and also to attempt to eliminate threats to integrity.

I have thought before about a car that would maintain its system integrity. Let’s assume that for a car, to run out of fuel is to die. A computer in the car could be programmed to keep the car fueled and running. With GPS the computer could tell how far it was from a gas station, it could know how many hours of fuel it had left, and distance and so forth, and when it computed that it would run out of gas, it could navigate to a fuel station.

This is a stretch but think of a human driver who ignores the computer and does not stop for fuel. If the computer preferred to have fuel more than it preferred the wishes of the human driver, it could eject the driver or simply lock the controls and take over entirely.

Now we wouldn’t program a computer to do such a thing, would we? Two final thoughts.

  1. We certainly would. Yes absolutely.
  2. Who programmed fight or flight into me? You could say evolution did. Can programmable constructs be programmed to evolve? Certainly, they are now.  Once you put evolution into a self-contained system, how do you control it? Have we stopped bacteria from evolving resistance to antibiotics? At this time we have not, and bacteria are pretty dumb.

My conclusion: a very sophisticated evolving AI will get out of control.


Learn Regular Expressions

Open this tutorial in a window by itself:
Learn Regular Expressions in 55 Minutes

Then open this app in a new window:
Online Regular Expression Builder

Now you can follow the guide and try out the different examples immediately.  Let me get you started. When you go to regexr you see this:


The red is mine. Your patterns go inside the two red forward slashes. Try this – replace everything inside the slashes with a word in the text. Like this:


Now you are off to the races with the examples from the guide.

Thanks to the God of the InterTubes, Joel Norris, for the link to the