The Naked Scientists

The Naked Scientists Forum

Author Topic: How do computers work?  (Read 24242 times)

Offline mikemaas

  • First timers
  • *
  • Posts: 6
    • View Profile
How do computers work?
« on: 08/02/2009 11:39:57 »
After several years owning a machine and going to courses on Word, Excel, emailing and elementary web-building, I`m still baffled the moment anything goes wrong. It`s because I still have no understanding of what goes on inside my computer.

   Has nobody written a book of about 200 pages for the educated, numerate reader, plus fat glossary of all the jargon ?

  Answer, I think, is no ! A few years back I spoke to a prof of electronic engineering at Imperial College. He put me on to a prof Wilkes at Cambridge who simply said the documentation`s lamentable. I`ve also reccently emailed pro Chris Bishop, who replied that I should search in bookshops. I`ve done it. Can`t find anything.

I wonder if you can suggest something.

Mike Maas

Mod Edit - Formatted subject as a question - please do this to help keep the forum tidy and easy to navigate - thanks!
« Last Edit: 10/02/2009 13:14:57 by BenV »


 

Offline Vern

  • Neilep Level Member
  • ******
  • Posts: 2072
    • View Profile
    • Photonics
Re: How do computers work?
« Reply #1 on: 08/02/2009 17:05:00 »
I've spent a lifetime learning about computers and I still get stumped by problems that can happen in them.

If you Google the phrase: how do computers work; you will be rewarded with:

How computers work

 

Offline Don_1

  • Neilep Level Member
  • ******
  • Posts: 6890
  • Thanked: 7 times
  • A stupid comment for every occasion.
    • View Profile
    • Knight Light Haulage
Re: How do computers work?
« Reply #2 on: 09/02/2009 15:48:55 »
A question many would like answered, if only they could get their B****Y computers' to B****Y WORK!!!
 

Offline Vern

  • Neilep Level Member
  • ******
  • Posts: 2072
    • View Profile
    • Photonics
Re: How do computers work?
« Reply #3 on: 10/02/2009 12:48:32 »
A question many would like answered, if only they could get their B****Y computers' to B****Y WORK!!!

Wouldn't it be so nice if computers did what you want them to do instead of doing what you tell them to do?   :) :)
 

Offline Ultima

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • My Homepage
How do computers work?
« Reply #4 on: 26/02/2009 00:40:36 »
mikemaas what kind of thing were you hoping to learn about? There are three big hows, how does the software work, how does the hardware work, and how do these work together. Inside each of those topics it gets fairly complicated too. You might want to try finding short introductory books about "Computer Architecture" another about "Programming" and a final one about "Operating Systems". That covers the serious business. If you just want to know why software fails that's nothing to do with the computer. It's all down to the less than mechanistic humans that create the software you use... they are only human after all!  ;)

Also long time no see to anyone who still remembers me... I asked for this part of the forum to be setup ages ago, and then kind of vanished leaving everyone else to pick up on computer type questions... sorry! ::)
 

Offline DoctorBeaver

  • Naked Science Forum GOD!
  • *******
  • Posts: 12656
  • Thanked: 3 times
  • A stitch in time would have confused Einstein.
    • View Profile
How do computers work?
« Reply #5 on: 26/02/2009 09:25:27 »
A question many would like answered, if only they could get their B****Y computers' to B****Y WORK!!!

Wouldn't it be so nice if computers did what you want them to do instead of doing what you tell them to do?   :) :)

The art of programming - turning what you want into a series of linear steps. Controlled, linear thinking is not always easy.

I am reminded of a little example told to me years ago. Say to someone "Go to the shop for me and get a loaf of  bread. Take the money from my wallet on the table"

A human would know to get the money before going to the shop whereas a computer would follow the instructions as given and go to the shop then crash because it had no money; the instruction to get the money had followed the instruction to go to the shop. When we reach the point where computers can re-arrange their instructions into the correct order then we'll be getting there. 
« Last Edit: 26/02/2009 13:25:20 by DoctorBeaver »
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3823
  • Thanked: 19 times
    • View Profile
How do computers work?
« Reply #6 on: 26/02/2009 11:18:09 »
At a very basic level you have read/write memories, instruction sets in read only memory and of course input/output devices.
you use your input device to load data into your r/w memory and tell your instruction set what to do with it.
In the computer you have sitting on your desk this all lies beneath about ten further levels of complexity!!!
 

Offline techmind

  • Hero Member
  • *****
  • Posts: 934
  • Un-obfuscated
    • View Profile
    • techmind.org
How do computers work?
« Reply #7 on: 04/03/2009 23:49:38 »
After several years owning a machine and going to courses on Word, Excel, emailing and elementary web-building, I`m still baffled the moment anything goes wrong. It`s because I still have no understanding of what goes on inside my computer.
...

Part of the trouble is that there's so much complexity in the software that merely knowing how the computer (hardware) works will still leave you stuck when things go wrong. It's a bit like having a car and being a mechanic - but you can still get stuck because the roads are complicated and you don't have a map.

On the other hand, being a "mechanic" and knowing roughly how "roads" work will give you a bit of a head start.


Basically in your computer you have:
 - memory which is short-term storage, which might be very short term and is erased in any case when you switch off.
 - hard disk which is principally long-term storage, retaining vast amounts of information for years if required, (hopefully) - even when switched off
 - processor (or CPU) which does calculations, fetches data from memory, stores data back to memory, can oversee the copying of data between the hard disk and memory, can oversee the copying of data between memory and USB devices etc and runs programs or software. It does these simple things very very fast, hundreds of millions of simple add/subtract/compare steps per second.
 - software also known as programs (American spelling deliberate) which comprise (extremely) long series of instructions, a bit like a recipe, which tells the processor how to accomplish a complex task (like a functioning wordprocessor) in terms of simple operations that the processor can do directly (fetch-data, copy-data, do calculations on data, branch if this data is bigger than that data etc).

Modern software is so complicated that no human could comprehend creating some big application like MS Word in terms of very simple add/subtract/store instructions. And you'd be reinventing the wheel all the time - there's a lot of commonality between different software.

So... we create various "abstractions" or tiers of software. This goes from "low level" which means based on simple commands/instructions (add/subtract etc) to "high level" which is much more complicated and abstracted like presenting the user with an Open File dialog box. The "low level" side of things are obsessed with details, while the "high level" is more big-picture stuff. It's loosely heirarchical, so the "high level" application can call upon the services of "lower level" routines, which in turn call "level level" routines still - a bit like an army commander passing orders down the various ranks to get a job done.

Very broadly and traditionally, the Operating System is at the lower-level of the scale and the Applications are at the higher end. In reality, a complex operating system such as Windows pretty much spans the whole range.

Example: an simple image viewer program
After the user has chosen an image file - perhaps from a File-Open dialog box, the Application issues a command like "DisplayImage(filename)"
This "DisplayImage()" is very high-level
it naturally subdivides into two sub-functions; loading the image-file off disk and converting that image-file into a recognisable picture
Loading the image-file off disk involves finding out exactly where on the disk it is stored (and it may well be in several separate pieces) and issuing requests to the disk drive to hand over the data.
Unless the image is a simple BMP file, there will be a lot of logic (GIF/PNG) or maths (JPG) to convert the data from the file into a visible picture.



Now, 25 years ago you could only run one program (application/piece of software) on your computer at a time, and that application had (near) complete control. This might have been a bit limiting for the user, but it did mean that the overall system was in a well-defined and repeatable state whenever that application/program was running, so things didn't have too much scope to go wrong. The main operating system of the computer was stored in uncorruptable Read-Only Memory, and the computer would be in the same state as it left the shop whenever you turned it off and on again. Ahh, so simple. Of course you couldn't personalise anything.

Today we have many programs all running concurrently, Word Processor, streaming audio, anti-virus programs, may a few Internet Explorers, not to mention USB hardware devices like cameras and broadband modems and memory sticks all shuffling data around simultaneously! The processor at the heart can still only do one thing (or two things if dual core, or 4 if quad core) at a time, and in the detail is in fact selectively switching its effort between all the parallel tasks in (usually) imperceptibly short timeslices. The shear complexity creates all sort of potential for unexpected interactions between programs.

Furthermore, all the operating system, programs, and millions of customisation and configuration settings and parameters are stored on a hard disk which can (although shouldn't) be re-written, modified, or corrupted at any time.

Recipe for disaster. Yes. To be honest, it's amazing it works as well as it does.


Things that can (and do) go wrong
 - faulty hardware glitching (failing hard disk, faulty memory, bad contacts on memory) which may cause intermittent problems, or trigger permanent problems after a momentary glitch has corrupted programs or data (files) on the hard disk
 - software clashes (like my computer sometimes has issues recognising and communicating with other USB gadgets (digital camera, external DVD burner) while my 3G broadband modem is plugged in)
 - software bugs (faults) where a program will repeatably misbehave when a particular set of circumstances happen (eg an old wordprocessor I used would always 'crash' (jam up) if you inserted a picture too close to the bottom of the page)
 - MS Word has/had some bugs where the bottom sentence on a page becomes invisible then reappears. Also in various versions of Word, bits of Word Drawing Object pictures faile to print if they were more than 1024 pixels from the left-hand edge of the image.
 - unexpected "features" eg where pressing something changes the language of the keyboard and you do it by accident and have no idea how to put it back, or pressing and holding some key combination triggers "stickykeys" (Google it). Or in Word (do I have gripes with Word?) when I begin a sentence with "To" I only have to blink and its auto-put "To whom it may concern". That's not what I wanted.
 - more permanent software clashes/interference, such as the fact that the DVD-player software provided with my computer refused to play DVDs ever since I installed my DVD writer (which comes with its own DVD-playing software - with inferior picture quality). Ironically in my case this also had something to do with the copy-protection systems used on DVDs stopping me even watching them. Grrrr!
 - malware (malicious software) which includes viruses, spyware, trojans etc, which is software which gets on to your computer uninvited or by deception and does all sorts of stuff you wouldn't want to happen causing no end of trouble - usually these days so that somebody on the far side of the planet can try to make a fast buck at your expense (directly or indirectly). This might send spam behind your back, show adverts you never wanted, redirect you to websites you didn't wish to see, demand a ransom from you to have your computer back, form part of an organised "attack" on a third-party company on the internet (usually related to extortion)...
 - anti-virus software: works very hard to try to spot the hundreds of thousands of pieces of malicious software which are in existance and stop them in their tracks. Unfortunately all this checking can slow your computer down noticeably, occasionally it makes mistakes and will claim that something perfectly harmless (and which has been there for ages) is in fact harmful. If it then "removes" or "fixes" this mistakenly-identified virus this may cause big problems. Other times it will fail to stop something bad.
 - auto-updates: there are often "vulnerabilities" (defects) found in software which might allow malicious software a route in; people like Microsoft issue "updates" for these defects when they have fixed them. These "updates" or "patches" are newer versions of the original software, and as well as fixing problems, may sometimes introduce new features. Microsoft mostly issues updates/patches on the 2nd Tuesday of each month. Unfortunately the new software can occasionally clash with other things and cause new problems: Microsoft issued a fix last year which inadvertently caused common Bluetooth devices to stop working (I think - it was some such moderately widespread symptom). Microsoft's Update tries to force me to download a newer version of my modem driver, but I've found before that this reduces the top speed of connection I can achieve. If you have updates happening in the background automatically, they can cause occasional unexpected consequences... however the consequences of turning off the patching is that you're much more at risk of malware getting in. So you can't win.
« Last Edit: 05/03/2009 01:15:16 by techmind »
 

Offline DoctorBeaver

  • Naked Science Forum GOD!
  • *******
  • Posts: 12656
  • Thanked: 3 times
  • A stitch in time would have confused Einstein.
    • View Profile
How do computers work?
« Reply #8 on: 05/03/2009 09:21:43 »
It is interesting to note that until Vista was released all MS Windows operating systems (WFW, 95, 2000, XP,etc.) rode on the back of MS-DOS which was written 25+ years ago. The software had to be modified continuously to handle new procedures and it grew into a totally unweildy and incomprehensible mess. If anything went wrong, rather than re-writing some of the basic code, another patch was issued. These patches then had to be patched,and so on. This is 1 of the main reasons why MS software was so prone to system failures/crashes.

It is also 1 of the reasons why Windows is so vulnerable to virus attack. Rather than being able to modify 1 routine, or a few routines, to prevent a particular type of virus attack, the code that needed to be altered was scattered throughout numerous updates and patches and impossible to track down 100%. That, in turn, led to more updates & patches being issued. In theory, Vista should be much easier to modify (I stress "in theory").
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3823
  • Thanked: 19 times
    • View Profile
How do computers work?
« Reply #9 on: 05/03/2009 09:35:18 »
When I first encounted computers I had little Idea how they worked, I had grown up with knowledge of ring counters, mercury delay lines, cathode ray tube storage and other bits of 1940,s hardware but had no idea as to how they all fitted together.
About 1975 when 8080,s became popular I discovered instrution sets and it all fell into place, I still have a 64K CPM computer (the forerunner to DOS) in working order complete with circuit diagram.
 

Offline DoctorBeaver

  • Naked Science Forum GOD!
  • *******
  • Posts: 12656
  • Thanked: 3 times
  • A stitch in time would have confused Einstein.
    • View Profile
How do computers work?
« Reply #10 on: 05/03/2009 09:49:50 »
I still have a 64K CPM computer (the forerunner to DOS) in working order complete with circuit diagram.



I remember CP/M. And DR-DOS. Do you remember Superbrain computers? I believe they ran CP/M.
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3823
  • Thanked: 19 times
    • View Profile
How do computers work?
« Reply #11 on: 05/03/2009 10:46:45 »
The computer I have is complete with two 5.5" floppy drives and is labeled ALPHATRONIC built in Japan.
If you would like to renew your acquaintance with CPM simulators are available on the internet that run quite fast on a modern computer.
 

Offline DoctorBeaver

  • Naked Science Forum GOD!
  • *******
  • Posts: 12656
  • Thanked: 3 times
  • A stitch in time would have confused Einstein.
    • View Profile
How do computers work?
« Reply #12 on: 05/03/2009 13:26:06 »
If you would like to renew your acquaintance with CPM simulators are available on the internet that run quite fast on a modern computer.

I think I shall pass up that opportunity.
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3823
  • Thanked: 19 times
    • View Profile
How do computers work?
« Reply #13 on: 05/03/2009 15:28:03 »
I certainly remember seeing Superbrain computers in use several of the printing companies I used to visit in the early eighties had them.
 

Offline DoctorBeaver

  • Naked Science Forum GOD!
  • *******
  • Posts: 12656
  • Thanked: 3 times
  • A stitch in time would have confused Einstein.
    • View Profile
How do computers work?
« Reply #14 on: 05/03/2009 15:31:32 »
I remember programming in COBOL on Superbrains  [:I]
 

Offline MonikaS

  • Sr. Member
  • ****
  • Posts: 279
    • View Profile
How do computers work?
« Reply #15 on: 05/03/2009 17:00:55 »
COBOL? <shudder>
 

Offline LeeE

  • Neilep Level Member
  • ******
  • Posts: 3382
    • View Profile
    • Spatial
How do computers work?
« Reply #16 on: 06/03/2009 00:07:07 »
COBOL is really good for collating and presenting data.  I rather liked it.
 

Offline MonikaS

  • Sr. Member
  • ****
  • Posts: 279
    • View Profile
How do computers work?
« Reply #17 on: 06/03/2009 07:19:21 »
Sure COBOL is good for such things, shuffling around huge amounts of data on mainframes. But I hated all this typing: ADD A TO B GIVING C or just c = a + b in other programming languages. COBOL fingers...
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3823
  • Thanked: 19 times
    • View Profile
How do computers work?
« Reply #18 on: 06/03/2009 11:33:23 »
Siemens programing language for the R30/10 was much like this everything had to be specified in great detail, when you were setting up interfaces for peripherals and as the original language was German the grammar often seemed perverse
 

Offline MonikaS

  • Sr. Member
  • ****
  • Posts: 279
    • View Profile
How do computers work?
« Reply #19 on: 06/03/2009 22:31:39 »
Sometimes I feel developers of those languages are sadists...
 

Offline Don_1

  • Neilep Level Member
  • ******
  • Posts: 6890
  • Thanked: 7 times
  • A stupid comment for every occasion.
    • View Profile
    • Knight Light Haulage
How do computers work?
« Reply #20 on: 07/03/2009 14:49:14 »
Sometimes I feel developers of those languages are sadists...

Quite so, I think it's all a load of COBOLers.
 

Offline LeeE

  • Neilep Level Member
  • ******
  • Posts: 3382
    • View Profile
    • Spatial
How do computers work?
« Reply #21 on: 07/03/2009 22:49:34 »
Sure COBOL is good for such things, shuffling around huge amounts of data on mainframes. But I hated all this typing: ADD A TO B GIVING C or just c = a + b in other programming languages. COBOL fingers...
How can you complain that easily readable code is a problem, especially when your only real complaint is that you can't type very well?

The only thing that bugged me about COBOL was when you forgot a line-ending full-stop.  If you did this near the beginning of the code the compiler would complain that every subsequent line following the omitted full-stop had an error.  It could be quite alarming at first, until you got used to it, to get several thousand compilation errors ???
 

Offline DoctorBeaver

  • Naked Science Forum GOD!
  • *******
  • Posts: 12656
  • Thanked: 3 times
  • A stitch in time would have confused Einstein.
    • View Profile
How do computers work?
« Reply #22 on: 07/03/2009 23:33:18 »
LeeE - I remember that so well. A missing dot at the beginning of a 10,000+ line program. Reams & reams of printout. However, later COBOL compilers were smart enough to handle that situation and worked as if the dot were actually there.

Another good 1 was mis-spelling a peripheral device name and watching the whole machine crash.
 

Offline LeeE

  • Neilep Level Member
  • ******
  • Posts: 3382
    • View Profile
    • Spatial
How do computers work?
« Reply #23 on: 08/03/2009 14:28:05 »
Quote
Another good 1 was mis-spelling a peripheral device name and watching the whole machine crash.

Ah yes, those were the days... :D
 

Offline techmind

  • Hero Member
  • *****
  • Posts: 934
  • Un-obfuscated
    • View Profile
    • techmind.org
How do computers work?
« Reply #24 on: 09/03/2009 22:16:34 »
...
The only thing that bugged me about COBOL was when you forgot a line-ending full-stop.  If you did this near the beginning of the code the compiler would complain that every subsequent line following the omitted full-stop had an error.  It could be quite alarming at first, until you got used to it, to get several thousand compilation errors ???

C or C++ can be almost as bad if you miss out the end-of-line semicolon!
« Last Edit: 09/03/2009 22:18:20 by techmind »
 

The Naked Scientists Forum

How do computers work?
« Reply #24 on: 09/03/2009 22:16:34 »

 

SMF 2.0.10 | SMF © 2015, Simple Machines
SMFAds for Free Forums