Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

Sunday, April 21, 2013

Analog and digital data

I thought that I would talk about digital media -- CDs, DVDs, Blu-Ray, and so forth. But then I realized that I really needed to first talk about what digital media are -- and that, in turn, means that it is important to talk about analog.

Analog data are a reflection of events that occur on a continual basis. Such things include time, temperature, sound, moving images, water flowing, and so forth. An analog watch is known by its "face" -- where the "hands" are located to allow a person to interpret the data (information).

It would be completely possible for a watch to have a single hand. All the information is present in the hour hand. However, it is difficult to "read" (interpret) the value with a single hand and, therefore, analog watches and clocks normally have a minute hand and may even have a second hand.

In my old university, they had an analog computer. Set up correctly, it would be able to be used to calculate an exact value for Pi. But this brings up further the problems with analog data -- being able to actually make use of the data in a precise manner.An analog thermometer can give a precise value but can a person really read it that clearly? Is it saying 98.6 or saying 98.53?

Digital data can only create approximations of continual information. There are a lot of non-continual data in the world -- particularly in the area of finances. However, when it comes to continual data, you are involved with sampling rates and precision. The sampling rate is how often you "mark down" the information. You take a sample of sound at 1 hour, 20 minutes, 15 seconds, and 180 milliseconds. You then take a sample of the sound every 20 milliseconds -- but, whatever interval you choose, you are also choosing to ignore the data that exists when you are not taking a sample. You will never really know what happened within that 20 millisecond gap. You can guess what it might be -- that is called interpolation -- but you cannot know.

The second part of digital data is precision. For money (or other non-continual data), the precision is self-defined by what exists (although other units may exist for formulas -- like taxes). For continual data, the precision is a choice. Do you record 98.5, 98.54, 98.536, 98.5359, or what? Once again, you lose data/information and your choice CAN make a difference if the data are used in a repetitive fashion (such as calculating trajectories for a space ship).

So, analog data are accurate but very difficult to interpret precisely. Digital data are an approximation but have ease of interpretation as a built-in aspect of the choices that are made.

And this leads into the next blog "What makes Blu-Ray (TM) Blue?"

Wednesday, September 2, 2009

Computer Literacy 101 -- what is a peripheral?


A computer system cannot often stand alone -- it needs a way to input data, it needs a way to output data and it needs a way to expand its capabilities. These devices are called peripherals. A keyboard is a peripheral. A monitor is a peripheral. The time panel on a microwave oven can properly be called a peripheral, although it may be part of the overall design and not optional.

Peripherals can be grouped in classes. One class is Input/Output (or I/O). These peripherals allow you to put in (input) data or to access (output) data. Another class would include removable storage systems -- a flash card, a hard disk, a CD-ROM unit. Other classes exist.

Input devices have a particular requirement from the operating system. Since it is unknown just WHEN data will be input, there must be a way for the operating system to notice that data are available. The two main ways of doing this are via polling and via interrupts. A poll is a periodic check for data -- like a child in a car asking "Are we there yet?". An interrupt is like a tap on the shoulder. Different systems will use different methods. A poll does not take long but there will be many times that the answer will be "no" -- and, thus, the time taken is "wasted". An interrupt takes much more time because it is necessary to save the current situation (maybe you're in the middle of a program) before the interrupt can be handled. Let's say that handling an interrupt takes 50 milliseconds and a poll takes 1 millisecond. If an event occurs once a minute, then doing an interrupt will take less time than polling once a second (50 < (60 x 1)). However, if the event occurs twice a minute, then polling is more efficient (50 > (30 x 1)).

A keyboard is an input peripheral. So is a mouse. In the case of a keyboard, a specific data value is sent when a key, or combination of keys, is pressed. This is usually kept in a temporary memory buffer that can be read by another program that is currently accepting input from keyboards (maybe a word processing program, maybe a browser window). A mouse sends two types of information -- a change in location and key presses. The key presses are handled similar to those of a keyboard. However, the change in location is done by the computer keeping track of the "location" of the mouse. When the computer starts up, the mouse is considered to be in a "default" (starting) location (often the upper left of your monitor). If you move your mouse to the right, it keeps track of how far to the right it has moved. Note that it isn't usually a one-to-one movement or your mouse pad would have to be as large as your monitor. Also, if you pick up the mouse and move it, it is as if it never moved.

Printers and monitors are typical output peripherals. Printers are fairly straightforward (although the actual data may not be such) -- your output may say "give me a new page", "print the letter 'a'", "go to the next line", and so forth but it basically is given a set of commands in sequence. A monitor, currently, is more complicated because of the idea of active windows and locations. So, in a modern operating system, the computer not only needs to keep track of where the mouse (as reflected by the cursor displayed on the monitor) but what program is making use of input while the cursor is at that location and what menu or button must be activated if there is further input (keyboard or mouse click) while at a specific location within that program's active space (or window). The input devices are actually what are causing changes about what you see -- the monitor just reflects the effects of that input.

And that pretty well covers Computer Literacy 101 -- though I would be happy to try to address any areas (of the many) that I have neglected.

Tuesday, September 1, 2009

Computer Literacy 101 -- what is an operating system?


An operating system (or OS) is a special program that allows other programs to run. This is the core of a general purpose computer -- the ability to run programs that are not pre-determined. A specialized computer (or microprocessor) may be able to run multiple programs but they are known in advance and, thus, the system can be designed to just run those programs (simpler, faster, and smaller).

As a more general definition, an operating system manages the resources of a computer. Sometimes, it is defined by a hierarchical model (sometimes known as the "onion" model) because there are services that are provided by the primary section of the operating system. Then there is another layer that provides new services plus makes use of the primary section. Then another layer that makes use of the other two layers, and so forth.

Some of the services provided by an operating system (in "layer order") are task (program) management, memory management, process (tasks communicating with one another) management, device management (such as hard disks, or CD-ROM drives, and so forth), and finally file management.

Because the applications make use of operating system services, which in turn rely on other "lower layer" services, most applications are not portable between different operating systems. This is why a program that works with Windows (a particular operating system) may not work on a Macintosh (running Mac OS X, a different specific operating system) or under a system running UNIX or Linux (two closely related operating systems).

There is an apparent exception to this -- but it really still follows the same rules. If one uses a browser that executes a program within the browser, that program may work with browsers running on computers using different OSs. It appears to be OS independent (able to work under any operating system) but, actually, it is making use of a set of services that have been defined to have the same use on multiple operating systems. Because this set of services, or interface, between the program and the next layer is the same, the program can run under different operating systems -- but the underlying program that provides that interface is still operating system dependent.

There is little agreement on what Operating System is "best". In general, the one that provides the services that you need, and the applications you need, for the lowest price and greatest speed is "best" for you. (It may not be the best for someone else with different needs.)

Friday, August 28, 2009

Computer Literacy 101 -- what are programs?


Data falls into two categories, as we saw in the previous blog. These categories are instruction data and program data. Instruction data can also be called a program -- which makes use of the program data to fulfill its purpose. Many times, a program will be called an application. Most people refer to programs as applications if they are widely used by different people. A word processing program may be considered an application. A spreadsheet program may be considered an application. Programs that people do not directly make use of are usually not called applications.

Programs consist of a sequence of instructions that tell the computer what to do. In the first blog of this series, we mentioned the types of instructions that may be given a microprocessor. These instructions are called machine language because they are sets of datum that are interpreted directly by the microprocessor. For example, the decimal value of 026002 will tell an HP 2100 computer to "jump" (change the current address for the next address) to address 002. The 026 portion is a "change the current instruction address to" code for the microprocessor and the 002 portion tells it the new value for the instruction address. Frankly, you don't really want to know much more than that unless you are involved with microprocessor design. Most microprocessors have their instructions written in binary (0s and 1s) or hexadecimal (symbols 1 through F for each numerical location) but the computers of the "early days" were not always standardized.

There is a hierarchy of languages used to program computers. At the base is machine language -- normally represented by a series of 0s and 1s -- like 10011001100011100011111101011110 -- which would be considered 32-bits. Current-day programmers almost never use machine language directly. The next level is called assembly language which uses a set of readable codes that can be directly translated into machine language. An example of assembly language might be "JMP START", where JMP is the operation to be performed and START is a symbol for an address that is the value to be used by the operation. The next level consists of many different languages in a family called high-level computer languages. A compiler changes the high-level language into assembly language (or, sometimes, directly into machine language. An assembler changes the assembly language into machine language. Finally (at least, at this current point of time) there are machine-independent languages which are used to create programs that may be run on many different computers without being changed.

Programmers write programs. Very few write machine language programs. More, but not many, write assembly language programs. Most write programs in high-level languages. An increasing number write programs in machine-independent languages (such as Java). However, all of them end up actually creating machine language -- with special programs such as Java interpreters/compilers, compilers, and assemblers acting to make it into this special, final, form.

I said earlier that some programs are visibly used by people -- and these are called applications. The ones that are NOT visibly used by people are sometimes called system programs. These are programs that enable to computer to perform the acts that people want. A printer program will be used to allow people to print a document from their application. At the core of all of the system programs is a particular program called an operating system and this will be addressed in the next blog.

Thursday, August 27, 2009

Computer Literacy 101 -- what are data?


All computers work with data. But, what are data? I say "what are data" because the word data is a plural one -- it is the plural of datum. However, almost no one ever uses the word datum and just about everyone treats data, grammatically, as singular. A datum is a single piece of information -- yes or no, it is raining or it is not raining, you have eaten breakfast or you have not eaten breakfast. You will note that a datum only indicates a yes/no or off/on, binary, condition. Most of the time, when we need information, it is really a collection of datum -- or data.

The same is true with computers -- they work on each individual datum but they pull them out of a pool of data. This data (I will use the conventional singular grammar here) is kept in storage, as I pointed out in a previous blog. It is then transferred from one storage area to the local RAM where the microprocessor can directly work with it.

Data is used by the microprocessor at many stages. The first stage, or startup (or bootup), is when the microprocessor first receives electricity. The actual hardware (the collection of semiconductor chips, and other discrete electronic components) is designed to start transferring data from a specific memory storage area and address. Often, this is address zero (0). This means that the microprocessor will transfer data from address 0 (the actual physical location, once again, depends on design of the hardware) to its working memory. It then executes the data -- it starts to perform specific operations based on the contents of that data that was at that address and then increments the address for the next instruction (usually by one -- unless the first instruction says something else) and then executes the operations for that address and on and on.

The next stage occurs once the registers (we talked about them in the storage blog) of the microprocessor have been filled with working data. At this stage, it is prepared to continue to execute instructions as it transfers them from memory. You can look at is as having two stages -- the first where the microprocessor "wakes up" with no specific contents in its registers and the second when the microprocessor has been initialized and can now proceed to work as the data tells it. Or, you can look at it as having three stages -- the first one the boot stage, the second is the startup stage where it is still getting ALL of the hardware connected to the computer ready to be used, and the third stage where any type of instructions can be executed because all of the hardware has been set up to be ready for use.

All of this works with the data. The data, for a general purpose microprocessor, is what makes it able to work differently each time it is turned on. For a specialized microprocessor, the incoming data starts the activities for which the microprocessor is designed.

Somehow, I managed to avoid the word program in this description but data are often split into two categories. Instruction data, or programs, are executable -- they contain instructions for the microprocessor while program data is used by the programs to produce more data. The difference between these categories of data is that instruction data does not change (unless someone specifically writes another program to change that instruction data -- the topic of viruses and software patches).

I'm going to swap the next two items on my original "computer literacy" list and talk about programs more in the next blog.

Wednesday, August 19, 2009

Computer literacy 101 -- what is a computer?


Back from jury duty (actually, jury selection -- I didn't have to serve). I am going to start my short series on areas that I feel are important to become computer literate. I will try to make it useful but not to go into greater detail than necessary.

A computer, of today, is based on a semiconductor chip called a microprocessor. This is also sometimes referred to as a CPU (Central Processing Unit). This microprocessor changes numbers. It does very simple things with the numbers -- moves them from one location to another, shifts them (which effectively multiplies them by 2 or divides them by 2), does "logic" operations on them (which, if you don't know what that is -- will be another topic in the future), and changes the order in which it follows directions depending on the values that it has been given or has created based on the instructions given. That's about it, although some microprocessors will have other instructions that are actually shortcuts for a sequence of operations that could be done with a long series of simpler instructions.

The microprocessor does simple things with the numbers -- but it does them very, very quickly. When you see an advertisement for a "4 GHz CPU", it is an indication of how fast the microprocessor is and an indication of how quickly instructions can be processed. Larger numbers indicate a greater potential for speed. I say potential because the final speed depends on many design factors but, in general, you can use these numbers as an indicator of speed.

Microprocessors are used in many devices in our modern world. When they are in something that allows its use for different, non predetermined, purposes, it is called a "general purpose computer" or just plain old computer. Most people are familiar with smaller computers that are referred to as Personal Computers (PCs) but computers come in many sizes from a "smart" cell phone to a large "mainframe" which might be as large as several filing cabinets (they keep getting smaller, though).

The other category of use of microprocessors is for specialized uses -- the microprocessor is used for only one thing, or for one category of uses. Televisions, amplifiers, DVD players, watches, digital clocks, refrigerators, coffee makers, fuel injection and engine monitoring systems, traffic lights, alarm systems and MP3 players are all examples of devices using specialized processors. Some devices start entering into a "grey" area where they could be used for various, non-predetermined, purposes but are actually primarily used for a single purpose.

The microprocessor does not exist just by itself. It must have access to ways of giving it information upon which to work and ways to give results. In order to do this, other electronic devices will be connected to it and they, in turn, will be connected to other devices. A digital watch is an example of a very "simple" system which has buttons for setting information and a display to give results.

One very important additional item to which the microprocessor must have access is memory, which will be the topic of the next blog.

Friday, August 14, 2009

Computer Literacy?


My 10-year-old, fifth grade, son came to me the other day -- he had a micro SD disk that he said had cheat codes on it that he wanted to use for some Wii games. I connected up my card reader to the USB connection on the Windows machine and looked at the files. I looked -- and then I rewatched the Youtube tutorial on how the program was supposed to work -- then I said to him "OK, this is the data file -- where is the program?" He responded "what is a program?".

Admittedly, only people with a historical bent are truly interested in how I started programming with little toggle switches on the front of a DEC computer -- or the huge decks of punched cards that I used in college to meet the needs of my programming classes. But, I do think that children who are in a school with a computer lab and multiple computers in the classroom should not be asking "what is a program?" by the time they're in fifth grade. And it's a good school.

Computer literacy seems to be interpreted as the ability to use particular programs (even if they don't know what a program is). My son did a couple of PowerPoint presentations last year for class and he's used Microsoft Word for a few papers. He has no problem in using a browser (even if he doesn't know what a browser is) and searching for information with Google. BUT, I still maintain that it is hard to transfer skills from one program to another without knowing some computer basics.

Many of the readers of this blog will already know most of this -- but I'm going to use my next week of blogs to talk about computer basics that I, personally, think ought to be known to be computer literate.

Subjects will include:

What is a Computer?

What is memory, files, and storage?

What are data (besides being a character on Star Trek: The Next Generation)?

What is an operating system (all my children keep complaining when a Windows program won't work on the family Macintosh)?

What are programs and how do they work?

What are peripherals -- what is I/O?

And any other topic that comes up within this realm. I once wrote a book ( never published) on computers and how they work -- let's see if I can summarize in a set of reasonably sized blogs.

Expand the Middle-Class Again: The money supply of the middle- and lower-class has been diverted for 40+ years

     Once upon a time, before Ronald Reagan’s group of associates invented the fantasy of “trickle-down” economics, many more people made a ...