Overview of the Computer System

The Parts of a Computer System

A computer is an electronic device used to process data, converting it into information that is useful to people. A complete computer system includes hardware, software, data, and people. Hardware consists of electronic devices, the parts you can see. Software, also known as programs, consists of organized sets of instructions for controlling the computer. Data consists of text, numbers, sounds, and images that the computer can manipulate.

Looking Inside the Machine

The hardware, or physical components, of a computer consists of a processor, memory, input and output (I/O) devices, and storage. The processing function is divided between the processor and memory. The processor, or CPU, is the brain of the machine. Memory holds data and program instructions as the CPU works with them. The units of measure for memory are the byte, kilobyte, megabyte, gigabyte, and terabyte. The role of input devices is to provide data from the user or another source. The most common input devices are a keyboard and a mouse. The function of output devices is to present processed data to the user or to another computer. The most common output devices are a monitor and a printer. Communications devices, such as modems and network interface cards, perform both input and output functions, allowing computers to share information. Storage devices hold data not currently being used by the CPU. The most common storage devices are a floppy disk, a compact disk, a Digital Video Disk.

Software: Bringing the Machine to Life

Programs are electronic instructions that tell the computer how to accomplish certain tasks. When a computer is using a particular program, it is said to be running or executing the program. The operating system tells the computer how to interact with the user and how to use the hardware devices attached to the computer. Application software tells the computer how to accomplish tasks the user requires. Some important kinds of application software are word processing programs, spreadsheets, database management software, presentation programs, graphics programs, multimedia applications, entertainment and education software, Web design tools and Web browsers, Internet applications, utilities, and networking and communications software.

Central Processing Unit (CPU)

Two components handle processing in a computer: the central processing unit, or CPU, and the memory. They are located on the computer's motherboard, the circuit board that connects the CPU to the other hardware devices.

The CPU, or processor, is the place where data is manipulated. In a personal computer, the processor usually consists of one or more microprocessors (sometimes called "chips") which are slivers of silicon or other material with many tiny electronic circuits. The CPU has two basic parts: the control unit and the arithmetic logic unit.

The Control Unit

All the computer's resources are managed from the control unit. The control unit directs the flow of data through the CPU, and to and from other devices. The CPU's instructions for carrying out commands are built into the control unit. The instructions, or instruction set, list all the operations that the CPU can perform. Each instruction in the instruction set is expressed in microcode – a series of basic directions that tells the CPU how to execute more complex operations. When the control unit encounters an instruction that involves arithmetic or logic, it passes that instruction to the second component of the CPU, the arithmetic logic unit, or ALU.

The Arithmetic Logic Unit

 

Because all computer data is stored as numbers, the processing involves comparing numbers or carrying out mathematical operations. The computer performs two types of operations: arithmetic operations and logical operations. Arithmetic operations include addition, subtraction, multiplication, and division. Logical operations include the following ones: “equal to”, “not equal to”, “greater than”, or “less than”. The ALU includes a group of registers – high-speed memory locations in the CPU that are used to hold the data currently being processed. For example, the control unit may load two numbers from memory into the registers in the ALU. Then it may tell the ALU to divide the two numbers (an arithmetic operation) or to see whether the numbers are equal (a logical operation). Each time the CPU executes an instruction, it takes a series of steps that is called a machine cycle. A machine cycle can be broken down into two smaller cycles: the instruction cycle and the execution cycle. During the instruction cycle the CPU takes two steps: fetching (the control unit retrieves, or “fetches”, a command or data from the computer's memory) and decoding (the control unit breaks down, or decodes, the command into instructions that correspond to those in the CPU's instruction set.

At this point, the CPU is ready to begin the execution cycle. When the command is executed, the CPU carries out the instructions in order by converting them into microcode. The CPU may be required to storethe results of an instruction in memory (but this condition is not always required).

Memory

The CPU contains the basic instructions to operate the computer, but it cannot store entire programs or large sets of data permanently. It contains registers which are small areas that can hold only a few bytes at a time. In addition to registers, the CPU has millions of bytes of space where it can quickly read or write programs and data in use. This area is called memory. Physically, memory consists of chips either on the motherboard or on a small circuit board attached to the motherboard. This electronic memory allows the CPU to store and retrieve data quickly.

There are two types of memory: read-only memory, or ROM, and random access memory, or RAM.

Read-only memory (ROM) is nonvolatile (or permanent); it holds instructions that run the computer when the power is first turned on. ROM contains a set of start-up instructions, which ensures that the rest of memory is functioning properly, checks for hardware devices, and checks for an operating system on the computer's disk drives. The data in ROM cannot be changed.

Random-access memory (RAM) is volatile (read/write, or temporary); programs and data can be written to and erased from RAM as needed.

The purpose of RAM is to hold programs and data while they are in use. The more RAM a computer has, the more it can do and the faster it can perform certain tasks. The CPU accesses each location in memory by using a unique number called the memory address. A memory address is a number that indicates a location on the memory chips.

There are two types of RAM: dynamic and static. Dynamic RAM (DRAM) must be refreshed, or recharged with electricity frequently; otherwise, it will lose its contents. Static RAM is not refreshed often and can hold its contents longer than dynamic RAM. SRAM is also considerably faster than DRAM.

Moving data between RAM and the CPU's registers is one of the most time-consuming operations a CPU must perform, simply because RAM is much slower than the CPU. A partial solution to this problem is to include a cache memory in the CPU. Cache memory is a type of high-speed memory that contains the most recent data and instructions loaded by the CPU. The amount of cache memory has a tremendous impact on the computer's speed.

Creating Computer Programs

A computer program is a set of commands that tell the CPU what to do. Software may contain only an executable program file, or it may have several other supporting files such as dynamic link libraries, initialization files, and help files.

An executable file (EXE) is the part of a program that sends commands to the processor that executes the commands in the file. In fact, when you run a program, you are running the executable file. A dynamic link library (DLL) is a partial EXE file, it contains a part of an executable program and does not run on its own; its commands are accessed by another running program. These files allow programmers to break large programs into small components; it makes the entire program easier to upgrade. DLL files can also be shared by several programs at one time. This feature makes them efficient for program storage. An initialization file (INI) contains configuration information, such as the size and starting point of a window, the color of the background, the user's name, and so on. Initialization files help programs start running or contain information that programs can use as they run. Although initializing files are still in use, many newer programs now store user preferences and other program variables in the Windows Registry. By including a help file (HLP), programmers can provide the user with PC-based help.

To create a program, using a programming language a programmer creates source code, which is compiled or interpreted to create object code that the computer can understand. Object code, also known as machine code, is the binary language file that tells the CPU what to do.

When you launch a program, the computer begins reading and carrying out its statements. The order in which program statements are executed is called program flow control. When mapping a program, a programmer creates a flowchart. The steps represented in a flowchart are called an algorithm and usually lead to some desired result.

To perform certain tasks, the actual programming process uses variables and functions. Variables are placeholders for data being processed (e.g. variable Age). Functions, or mini-algorithms,are discrete sets of code used to perform one task like finding the square root of a number or the average of a set of numbers.

Structured and Object-Oriented Programming

Structured Programming Structured programming evolved in the 1960s and 1970s. The name refers to the practice of building programs using a set of well-defined structures:

Sequence structure defines the default control flow in a program. This structure is built into programming languages. A computer executes lines of code in the order in which they are written. It is possible, as a result of a conditional statement or a function call, that the flow may have the option of going in one of several different directions.

Selection structures are built around the conditional statements. If the conditional statement is true, certain lines of code are executed. If the conditional statement is false, those lines of code are not executed.

Repetition structures (or looping structures) use the loops. In a repetition structure, the program checks a conditional statement and executes a loop based on the condition. If the condition is true, then a block of one or more commands is repeated until the condition is false.

Object-Oriented Programming

In the 1980s object-oriented programming (OOP) was developed. Many programmers claim that an object orientation is a natural way of thinking about the world and it makes programs simpler and programming faster.

Concepts of object-oriented programming are objects and classes. OOP enhances structured programming. Objects are composed of structured program pieces, and the logic of manipulating objects is also structured. Every object has attributes and functions and may contain other objects. For example, the car object has attributes (color, size, shape, top speed), functions (moves forward, moves backward, opens its windows) and may encapsulate other objects (tires, chassis, drive-train) with their own attributes and functions. All objects belong to classes. A class consists of attributes and functions shared by more than one object. All cars, for example, have a steering wheel and four tires. All cars can drive forward, reverse, park, and accelerate. Class attributes are called data members, and class functions are represented as member functions or methods.

Classes can be divided into subclasses. The car class, for example, could have a luxury sedan class, a sports car class, and an economy car class. Subclasses typically have all the attributes and methods of the parent class. Every sports car, for example, has a steering wheel and can drive forward. This phenomenon is called class inheritance. In addition to inherited characteristics, subclasses have unique characteristics of their own (fuel economy, trunk space, appearance).

When an object is created, it automatically has all the attributes and methods associated with that class. In the language of OOP, objects are instantiated (created).

Objects do not typically perform behaviors spontaneously. A car, for example, cannot move forward and backward at the same time or drive forward spontaneously. You send a signal to the car to move forward by pressing on the accelerator. Likewise, in OOP, messages are sent to objects, requesting them to perform a specific function. Part of designing a program is to identify the flow of sending and receiving messagesamong the objects.

Programming Languages

Programming is a way of sending instructions to the computer. To create these instructions, programmers use programming languages to create source code, and the source code is then converted into machine (or object) code, the only language that a computer understands. People, however, have difficulty understanding machine code. As a result, first assembly languages and then higher-level languages were developed. Programming languages require that information be provided in a certain order and structure, that symbols be used, and sometimes even that punctuation be used. These rules are called the syntax of the programming language, and they vary a great deal from one language to another.

Categories of Languages.

Based on evolutionary history, programming languages fall into one of the following three broad categories:

Machine Languages. Machine languages consist of the 0s and 1s of the binary number system and are defined by hardware design. A computer understands only its machine language – the commands in its instruction set that instruct the computer to perform elementary operations such as loading, storing, adding, and subtracting.

Assembly Languages. These languages were developed by using English-like mnemonics. Programmers worked in text editors to create their source files. To convert the source files into object code, researchers created translator programs called assemblers. Assembly languages are still much easier to use than machine language.

Higher-Level Languages. These languages use syntax that is close to human language, they use familiar words instead of communicating in digits. To express computer operations, they use operators, such as the plus or minus sign, that are the familiar components of mathematics. As a result, reading, writing, and understanding computer programs is easier.

Machine languages are considered first-generation languages, and assembly languages are considered second-generation languages. The higher-level languages began with the third generation. Third-generation languages (3GLs) can support structured programming, use true English-like phrasing, make it easier for programmers to share in the development of programs. Besides, they are portable, that is, you can put the source code and a compiler or interpreter on practically any computer and create working object code. Some of the third-generation languages include the following: FORTRAN, COBOL, BASIC, Pascal, C, C++, Java, ActiveX.

Fourth-generation languages (4GLs) use either a text environment, much like a 3GL, or a visual environment. In the text environment, the programmer uses English-like words when generating source code. In a 4GL visual environment, the programmer uses a toolbar to drag and drop various items like buttons, labels, and text boxes to create a visual definition of an application. Many 4GLs are database-aware; that is, you can build programs with a 4GL that work as front end (an interface that hides much of the program from the user) to databases. Programmers can also use 4GLs to develop prototypes of an application quickly. Some of the fourth-generation languages are Visual Basic and Visual Age.

A 5GL would use artificial intelligence to create software based on your description of what the software should do.

 








Дата добавления: 2015-11-18; просмотров: 4864;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.015 сек.