Posts Feed
Comments Feed

Archive for the 'Computer' Category

History of the Computer - Cache Memory Part 2 of 2

(Times and speeds quoted are typical, but do not refer to any specific hardware, merely give an illustration of the principles involved.)

Now we introduce a ‘high speed’ memory with a cycle time of, say 250 nanoseconds between the CPU and the core memory. When we request the first instruction, at location 100, the cache memory requests addresses 100,101,102 and 103 from the core memory all at the same time, and retains them ‘in cache’. Instruction 100 is passed to the CPU for processing, and the next request, for 101, is filled from the cache. Similarly 102 and 103 are handled at the much increased repeat speed of 250ns. In the meantime the cache memory has requested the next 4 addresses, 104 to 107. This continues until the predicted ‘next location’ is incorrect. The process is then repeated to reload the cache with data for the new address range. A correctly predicted address, when the requested location is in cache is known as a cache ‘hit’.

If the main memory is not core, but a slower chip memory, the gains are not as great, but still an improvement. Expensive high speed memory is only required for a fraction of the capacity of the cheaper main memory. Also programmers can design programs to suit the cache operation, for instance by making a branch instruction in a loop take the next instruction for all cases except the final test, maybe count=0, when the branch occurs.

Now consider the speed gains to be made with disks. Being a mechanical device, a disk works in milliseconds, so loading a program or data from disk is extremely slow in comparison, even to core memory - 1000 times faster! Also there is a seek time and latency to be considered. (This is covered in another article on disks.)

You may have heard the term DMA in relation to PCs. This refers to Direct Memory Access. Which means that data can be transferred to or from the disk directly to memory, without passing through any other component. In a mainframe computer, typically the I/O or Input/Output processor has direct access to memory, using data placed there by the Processor. This path is also boosted by using cache memory.

In the PC, the CPU chip now has built-in cache. Level 1, or L1, cache is the primary cache in the CPU which is SRAM or Static RAM. This is high speed (and more expensive) memory compared to DRAM or Dynamic RAM, which is used for system memory. L2 cache, also SRAM, may be incorporated in the CPU or externally on the Motherboard. It has a larger capacity than L1 cache.

Tony is an experienced computer engineer. He is currently webmaster and contributor to http://www.what-why-wisdom.com. A set of diagrams accompanying these articles may be seen at http://www.what-why-wisdom.com/history-of-the-computer-0.html. RSS feed also available - use http://www.what-why-wisdom.com/Educational.xml

Tags: , , , ,

No Comments »

The Brain has the Same Problems that Databases Do

What can the human brain learn from how a database works?

There is a battle going on in every database and the same battle in every human brain. The battle is simply Memory vs. CPU (processing). We either rely on indexes to recall data or we count on the CPU to calculate the resulting data.

Some basics regarding relational databases, they are not as complicated a concept as one might think. It’s quite basic, if you have a telephone book, you have a database (or a table). If you then have another book (like a medical record list from the hospital) you can relate the two. Why is that important? If you relate the two, you can determine if a certain area code in the phone book has more allergy related illnesses. Finding out that more people who live next to high-power lines in your phone book have some form of cancer. Relating data is a very powerful thing, the human brain’s incredible recall abilities are directly related to it’s ability to “relate” data. We store color in one area, and shape in another. Smells in one area and happy thoughts in another! The details are obviously still very sketchy, but you get the idea.

A balance in the design of the tables that store the data in a database must be struck. The theory is that the human brain works in much the same way, the problem is Database Administrators and Developers alike constantly strive to increase the performance of the database. We humans do not make specific efforts to strike the same balance within the inner tables of our brains database.
Databases are optimized in many, many ways. Two of the most common ways are:

Large tables are broken down to store data in multiple related tables.

Indexes are created and used to retrieve the vital links between these tables.

An index is just that. You’ve seen an index in you local phone book. In the front it tells you where in this massive book to find people in a certain city, or where to find businesses of certain types. Or where to find only those with the last name that starts with a Y. Databases do the same thing; internally the index is stored in memory for quick retrieval when a query for data retrieval is executed. Simply put, someone asked the database for data and the database used an index to help it find that information quicker.

We have indexes in our brains just as the databases do. Case in point, I don’t know the words to a certain song (I mean I just don’t know them) until someone starts the song; then suddenly I can continue to sing every word, that person that started the song “Hit an index” in my brain. I don’t have to “Remember” the entire song, just the index. This means the entire song is not “In Memory” but rather “On Disk”. The index is in memory and is readily available to me when needed. We all have indexes for many other items “On Disk” in our brains. Sometimes you lose the index, and the entire song is gone.

Where is the ” Battle “, the battle is in Recalling or Figuring it out. I don’t have to memorize my address, I know where I live. If I instead memorize my cities address scheme I can calculate my address (19 blocks west of Central is 19th Ave . etc.). This is where database administrators and developers alike are constantly running their technical balancing act. The decision to calculate the result, or recall the result! Should I memorize all the data and count on indexes, or should I memorize the formula and count on calculation to retrieve the data.

Can people benefit, I think we can! I find myself naturally counting more on “Calculating” the result then I do memorizing. It works ok because I’m a logical thinker and it comes naturally. I get left behind far too often though. The problem is in remembering to do many things, or remembering whether I did something at all. Important dates, even vacations go by the way side. My memory recall is all but shot because I count on logic as a crutch. In a pinch I can pull it off but it takes a lot more effort for me to Recall then it does to deduce. If I were to optimize my inner-indexes and work on utilizing my recall more often, just as DBA’s do, it might very well be of great benefit to many.

Could I increase my ability to recall? In the database there is a concept called re-indexing. It’s basically forcing the database to recreate it’s index. The more often it does this the more current and fresh the index is. Should I be doing the same thing for myself? If I were to go over and over and over a specific item (Such as what I had to do in grade school for the Preamble to the Constitution) I will insure it is stored and it’s index is strong. But do I need to go over the entire text over and over. If I already have the data (I’ve already experienced the vacation) and simply don’t want to lose it, I should re-index weekly (maybe monthly). This should insure I do not lose the data and could increase my reliance on memory, in hopes of striking a balance.

There are others around me who count on recall as a crutch and have deductive reasoning fall by the way side. I think they are in the same boat on the opposite end. In the database we either increase the CPU (brain exercises) or we decrease the amount of CPU required by normalizing the data in a logical way (break down the tables). This simply forces the system to rely on memory instead of over burdening the processor. What could one do to decrease their reliance on memory?
Coming soon… :-)
What mountains could we move if even a small percentage of us had a balance of Memory and CPU.

Adam Yax is CTO of http://www.phoenixsynergy.com, which provides IT services in Phoenix, AZ.

Tags: , ,

No Comments »

Why Aren’t Computers Like Refrigerators

I was having a heated discussion with a technologist yesterday. She
insisted that I just didn’t appreciate the delicacy of today’s computers.

“That’s exactly my complaint!” I retorted. “They’re incredibly wimpy.”

For instance, I was in a rush the other day, so instead of scrolling to the
shut down menu as I was leaving the office, I made the calamitous error
of taking a short cut. I pressed the “on” button until the machine
lumbered to silence.

Little did I know that was the last gasp for my hard drive, which by the
way, is a misnomer. There is nothing hardy about hard drives. They
destruct way too soon and way too often.

Which brings me to my point.

Computers should be just as strong and tough as a good refrigerator,
and why not?

They’re APPLIANCES, not messengers of the Almighty!

Does your refrigerator get “buggy” after a while, and require a software
upgrade merely to maintain or restore its functionality?

I’ve been told it’s not good for the hard drive if you shut down your
computer, repeatedly, so it’s better to leave it on, allowing it to eat
electricity.

Has anyone ever suggested, for other than dietary reasons, that you not
open the door to the fridge too often, lest it will forget how to cool your
food?

We expect a decent icebox, as they used to be quaintly called, to last at
least a dozen years or more.

Try getting more than a few years out of a laptop.

Lest you think I’m a Luddite, please note that one the the great pioneers
in computing, Andrew Grove of Intel, went on record several years ago
saying it is shameful that computers take so long to boot up. He asked,
why aren’t they more like TV’s?

When was the last time you had to boot up your fridge?

Isn’t it time manufacturers figured out a way to automatically back up our
data so we don’t run the risk of losing it? As I recall, this was the claim to
fame of Tandem.

Why hasn’t this architecture been adapted to the PC? Why doesn’t every
PC come equipped with two hard drives, one of which is simply there to
continuously back up the other?

Or, why isn’t our data regularly streamed to a secure online memory
cache that is awarded to us at the time we buy or lease a PC?

As consumers, we’re way too quiescent and passive about pushing for
significant improvements. It’s time to tell technologists we want
computers to be as solid as other appliances!

Dr. Gary S. Goodman, President of Customersatisfaction.com, is a
popular keynote speaker, management consultant, and seminar leader
and the best-selling author of 12 books, including Reach Out & Sell
Someone

Tags: , , , , , , , , , , , ,

No Comments »

« Prev

Close
E-mail It