The Naked Scientists

The Naked Scientists Forum

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

Offline LeeE

  • Neilep Level Member
  • ******
  • Posts: 3382
    • View Profile
    • Spatial
How do computers work?
« Reply #25 on: 09/03/2009 22:20:49 »
Different scale entirely - C/C++ compilation aborts pretty quickly but the COBOL compiler will just plough through all of the source before stopping, even if the fault was in the very first line of the logic.
 

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 #26 on: 11/03/2009 03:47:08 »
It normally happened before you even got to the logic with a dot missed in Environment Division.

For those who don't know COBOL, the Environment Division is the very first part of the program. It describes the environment on which the program will run and includes descriptions of the configuration settings and I/O devices. For instance:

 ENVIRONMENT DIVISION.
     CONFIGURATION SECTION.
         SOURCE-COMPUTER. IBM360.
         OBJECT-COMPUTER. IBM360.

 INPUT-OUTPUT SECTION.
    FILE-CONTROL.
    SELECT NAME-ADDRESS-FILE ASSIGN TO "\TMP\SAMPIN" ORGANIZATION IS LINE SEQUENTIAL.
    SELECT PRINT-FILE ASSIGN TO "\TMP\SAMPOUT".

Leave out 1 of those dots and everything from there on gets kicked out as an error. On some compilers (including 1 I worked with) it wouldn't just kick out every line,it would reject every character as it was looking for a dot. Then when it found 1 it would look for what it expected next, which of course wasn't there and so on. You could end up with a mountain of printout or errors.
« Last Edit: 11/03/2009 03:51:39 by DoctorBeaver »
 

Offline yor_on

  • Naked Science Forum GOD!
  • *******
  • Posts: 11978
  • Thanked: 4 times
  • (Ah, yes:) *a table is always good to hide under*
    • View Profile
How do computers work?
« Reply #27 on: 11/03/2009 11:33:17 »
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?   :) :)

Deep Vern, Very Deep...
And so true.

----
DB "Vista should be much easier to modify (I stress "in theory")."
(As a pure hypothesis, I would disagree to that theory:)
« Last Edit: 11/03/2009 11:37:23 by yor_on »
 

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 #28 on: 11/03/2009 14:45:56 »
Why would you disagree (apart from the fact that it's still Microsoft)?

Vista has been written in a far more modular and systematic way than any previous version of Windows. It should, therefore, be much simpler to make amendments to it.
« Last Edit: 11/03/2009 14:51:00 by DoctorBeaver »
 

Offline LeeE

  • Neilep Level Member
  • ******
  • Posts: 3382
    • View Profile
    • Spatial
How do computers work?
« Reply #29 on: 11/03/2009 17:17:31 »
I've wondered about just how modular Vista is.  It still seems to require a lot of very deep integration for the security/DRM stuff to work, and that to me remains a significant weak point; with such deep integration, problems occurring in one sub-system quickly run through the deep integration paths to the rest of the system.
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3812
  • Thanked: 19 times
    • View Profile
How do computers work?
« Reply #30 on: 11/03/2009 19:27:57 »
Could no one device a sub routine to detect a missing dot when you started the next line ?
 

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 #31 on: 12/03/2009 01:46:06 »
I've wondered about just how modular Vista is.  It still seems to require a lot of very deep integration for the security/DRM stuff to work, and that to me remains a significant weak point; with such deep integration, problems occurring in one sub-system quickly run through the deep integration paths to the rest of the system.

A lot of the problems with pre-Vista versions of Windows was that they relied on an antiquated OS running below them - MSDOS. Much of MSDOS was originally written in assembler language as there were no higher-level languages around at that time that were able to implement system level functions (The only higher-level languages were COBOL, ALGOL, Fortran, PL/1, RPG and the like; and I think Pascal was just arriving on the scene too. There weren't even any assembler IDEs). Assembler languages do not lend themselves to modularity or structured programming techniques. It was often far quicker to write a small piece of code separately wherever it was needed rather than trying to implement a kind of re-useable pseudo function call.

Consequently if an error was later discovered there were many pieces of code that needed to be changed and they could be scattered anywhere throughout the OS. If your library was not spot on (if, in fact, there was a library at all - which there often wasn't back then) then that was next to impossible. The same error would pop up again & again in different places and under different circumstances.

Nowadays, however, we have techniques such as DLLs and excellent library systems. Plus, of course, higher-level languages such as C/C++ that can be used and others that have been invented specifically for writing OS-type applications. Modular programming is the norm. Modern IDEs make the task even easier.

The upshot is that if an error is discovered it will be much easier to trace and resolve. It may involve more than 1 routine, but each of those routines will be the ones that are used throughout the system; make a change and that change is effected everywhere.

I'm not sure how integrated the very low-level code in Vista is but that too should be easily modifiable with the lowest level functions having been coded only once.
 

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 #32 on: 12/03/2009 02:05:51 »
A couple more points to consider.

It wasn't just the languages that were lacking in the old days of assembler programming. Programming itself was a very haphazard affair. Bob told Ted what needed to be done and Ted would get on with coding what he thought Bob meant. There were hardly any formal specifications and very little co-ordination. There was in large organisations, but MS was a very small company when MSDOS was originally written. It basically comprised a handful of geeks sitting in a room each with his/her own ideas of how it should work.

Nowadays even small systems have formal specs, flowcharts and copious other forms of documentation. All the functions and integration are identified before coding starts. "Egoless programming" techniques ensure that no-one guards their own code jealously so others can't steal their ideas.

Then, there is testing. Testing? What's that? Programmers used to test their own code and as a consequence most would use data that they thought would work just to make sure their code worked as it was supposed to when it was used as intended. But,of course, that isn't how things are in the real world. Users do silly things. Modern testing is on a much more scientific footing with the emphasis on trying to break the code rather than proving that it works.
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3812
  • Thanked: 19 times
    • View Profile
How do computers work?
« Reply #33 on: 13/03/2009 10:59:37 »
To return to the COBOL missing stop problem, did you have to make a carriage return at the end of each line? if so could not a simple keyboard modification have been made to insert the stop?.
 

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 #34 on: 13/03/2009 12:36:22 »
Compilers did get smarter and corrected minor errors such as missing full stops for you.

You would need to get a systems programmer to mod the keyboard mapping and they were always far too busy (Truth be told, they were too snobby to be bothered with trivial programmer's problems). I'm not entirely sure it could have been done anyway as most systems in those days used EBCDIC not ASCII.
« Last Edit: 13/03/2009 12:39:15 by DoctorBeaver »
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3812
  • Thanked: 19 times
    • View Profile
How do computers work?
« Reply #35 on: 15/03/2009 21:14:19 »
For anyone wishing to renew their aquaintence with COBOL a version that runs on a Windows machine is available on file sharing sites.
 

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 #36 on: 15/03/2009 21:26:15 »
For anyone wishing to renew their aquaintence with COBOL a version that runs on a Windows machine is available on file sharing sites.

Pass
 

Offline techmind

  • Hero Member
  • *****
  • Posts: 934
  • Un-obfuscated
    • View Profile
    • techmind.org
How do computers work?
« Reply #37 on: 16/03/2009 00:18:32 »
Modern testing is on a much more scientific footing with the emphasis on trying to break the code rather than proving that it works.

That's the ideal.
But in the real world, if the application is not life-threatening or safety-critical I think you'll often find that the nature of the testing depends on the application and how close you are to shipping-date. If the promised delivery date is 2-3 weeks time, only the most severe bugs found in testing will be remedied.
« Last Edit: 16/03/2009 00:22:06 by techmind »
 

Offline nicephotog

  • Sr. Member
  • ****
  • Posts: 387
  • Thanked: 7 times
  • H h H h H h H h H h
    • View Profile
    • Freeware Downloads
How do computers work?
« Reply #38 on: 28/03/2009 02:11:56 »
The idea of modularisation as you say, really only came about with higher languages and because the size of competitively economic software became gigantic to put together *link.
I believe the better terminology anyhow for modularisation in that context, is "OOP"  meaning Object Oriented Programming.
C(Objective C - various derivitives around the Bell Labs spec and ANSI spec) can only be modularised by DLL and .so e.t.c. under their own makes of C for the OS.
C++ is different, though in effect it's C also with the system of #IFDEF and angle bracket symbols for library joints and .h files , C++ is an OOP language of that the system of writing is not so much inline but a method of being able to join code by adding to a base module called an object with an extension tool packet called an abstract class.
OOP uses a system called classes that in effect is a/the "module" , code that has been designed to be streamlined and reusable for economic processor use in the program.
The classes are defined by a set of class variables created at startup with(and matching) a small instantiation program of the class called a constructor.



http://wiki.answers.com/Q/How_does_a_computer_work

A computer performs two functions,

1. Data processing.

2. Data storage.

and it has an Operating System(OS).


1. Data processing.

All data in a computer is represented by a binary(base 2) integer number stored within a finite quantity of binary point places(the same as a decimal place except this is the binary version) called a byte.

That byte is represented physically by the state of a special electric stored charge in the a temporary data memory storage hardware device called Random Access Memory(RAM).

To commit processing upon data The data stored in the RAM, is fed sequentially through a Central Processing Unit(CPU) that contains special circuits to re arrange the data by an action p/program-instruction called an operation through an operation circuit.
 

2. Data storage.

Two types of data exist.

Program instructions(to arrange CPU operations in a usable sequence) and user data.

Program instructions are represented exactly the same way as is user data(as binary integers in a byte) that has operations performed on it, for the computer to know which to use as data and which to use as a program the data is first located in a file with a notation to its filename-extension, different file-extensions will mean to use them for different purposes.

When data is not in use it generally is stored in permanent storage that does not require a continual power supply called a hard disc.
 

An Operating System(OS).

OS's are a special system set of instruction files that cause a computer to be able to start and cause the base minimum requirement of programs ready for a user to use it, to be easy to use, and easy to create add in programs for through a special programmers equipment called an Application Programming Interface(API) and OS compatible higher language compiler.

When a computer is started, an extremely tiny and simple permanently stored program picks up the OS first starter file that holds instructions for operations to start the OS. That program is stored in a special primitive part of a computers' main-board called a Basic Input Output System(BIOS) and uses main-board Chipset alike the ready OS uses the CPU and RAM.
« Last Edit: 28/03/2009 02:29:56 by nicephotog »
 

Offline tsr

  • First timers
  • *
  • Posts: 7
    • View Profile
How do computers work?
« Reply #39 on: 08/04/2009 05:27:33 »
In the series "The Secret Life of Machines" Tim Hunkins dedicated an episode to the "Word Processor".
Someone put it on youtube: newbielink:http://www.youtube.com/watch?v=oNkdD2OkMII [nonactive], newbielink:http://www.youtube.com/watch?v=LW_0kXK_zes [nonactive], newbielink:http://www.youtube.com/watch?v=Q4VwYDvDnbw [nonactive].
This episode focuses rather on the basics (such as transistors and microchips) of computing. But it's funny. :)

@mikemaas:
I don't think that there can be a general handbook of computers, because the software running on them varies a lot. Narrowing your search down to software that you use might help.
« Last Edit: 08/04/2009 05:51:41 by tsr »
 

Offline ButHowDoItKnow

  • First timers
  • *
  • Posts: 1
    • View Profile
How do computers work?
« Reply #40 on: 07/09/2009 16:10:22 »
Dear Mikemaas,

I have googled this subject ad nauseum, and have found hundreds of non-answers just like you.

For me, the answer was simple, because I have had a very full career in the area. Many years ago I decided that I should write a book on the subject, but never found the time.

But in the last three years, I have made the time, and have finally produced a book that explains everything that computers do and exactly how they do it. There is quite a bit of detail, but everything you need to know is contained in the book, and it is laid out in the proper order so that it is very easy to understand. It is just over the 200 pages that you mentioned.

Of course I'd like to make a living from my work, but the desire to help other people understand the basic simplicity of computers was a a major driving force that kept me working at it through to completion.

The book is called "But How Do It Know? - The Basic Principles of Computers for Everyone" ISBN-978-0615303765
and is available on Amazon. There is more info at the website, buthowdoitknow.com

Enjoy! - J Clark Scott
 

The Naked Scientists Forum

How do computers work?
« Reply #40 on: 07/09/2009 16:10:22 »

 

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