You are on page 1of 119

AAU

Introduction to Computer Science

Instructor Seble
M.T

2005

WWW.AAU.EDU.ET

Introduction to Computer Science


CHAPTER ONE :Introduction
Objectives: Define the discipline computer science Define the term computer Identify the several characteristics of computer that made them useful and popular Identify various classification of computers Application of Computers

1.1.

Introduction to Information and Communication Technology

Information and Communication Technology (ICT) is an umbrella term that covers all technical means for processing and communicating information. While this technically encompasses pre-digital technologies, including paper-based writing, it is most often used to describe digital technologies including: Methods for communication (communication protocols, transmission

techniques, communications equipment, media (communication)), as well as Techniques for storing and processing information (computing, data storage, etc.) The term has gained popularity partially due to the convergence of information technology (IT) and telecommunication technology. ICT allows users to participate in a rapidly changing world in which work and other activities are increasingly transformed by access to varied and developing technologies. By this definition, you could almost say ICT is technology's version of economic growth, to satisfy the needs and wants of the community over time. ICT tools can be used to find, explore, analyze, exchange and present information responsibly and without discrimination. ICT can be employed to give users quick access to ideas and experiences from a wide range of people, communities and cultures.

Chapter One

Page 2

Introduction to Computer Science


1.1.1. Introducing Information Technology Information Technology: i is "th e study, of design, development, implementation, systems, support or management computer-based information particularly

software applications and computer hardware." i deals with the use of electronic computers and computer software to convert, store, protect, process, transmit, and securely retrieve information. i is the combination of computer and communication technologies i is a general term that describes any technology that helps to produce, manipulate, store, communicate, and/or disseminate information Data Processing The difference between Data and Information Data: Think of data as a "raw material" - it needs to be processed before it can be turned into something useful, hence, the need for "data processing". Data comes in many forms - numbers, words, symbols. Data relates to transactions, events and facts. On its own - it is not very useful. Think of the data that is created when you buy a product from a retailer. This includes: Time and date of transaction (e.g. 10:05 Tuesday 23 December 2003) Transaction value (e.g. 55.00) Facts about what was bought (e.g. hairdryer, cosmetics pack, shaving foam) and how much was bought (quantities) How payment was made (e.g. credit card, credit card number and code) Which employee recorded the sale Whether any promotional discount applied

At its simplest, this data needs processing at the point of sale in order for the customer to receive a valid receipt. So, the data about the transaction is processed to create "information" - in this case a receipt. You can imagine that the same data would also be useful to the manager of the retail store. For example, a report showing total sales in the day, or which are the best-selling products. So, the data concerning all shop transactions in the day needs to be captured, and then processed into a management report. Chapter One Page 3

Introduction to Computer Science


Information: The above example demonstrates what information is. Information is data that has been processed in such a way as to be meaningful to the person who receives it. Note the - "processed" and "meaningful": It is not enough for data simply to be processed; it has to be of use to someone - otherwise why bother?! 1.2. What is Computer Science?

Computer Science is a science concerned with information i.e. representation, storage, manipulation or processing and presentation of information. Like any other science, which uses some devices for the practical aspect, computer Science uses a special device called COMPUTER. Computer science has different fields of specialization or sub-disciplines like other sciences. There are seven sub-disciplines of computer science. Software engineering: It is concerned about the development of a better quality software by applying scientific &basic engineering principles. Computer engineering (Architecture): deals with studying, analyzing and designing of computer hardware (organization and interconnection of computer system components) and its working principle. Automata theory: Automata Theory Is The study of machines or devices which accept a certain inputs such that the out put or at least the probabilities of output s are determined by the input. Formal Language Theory: Embraces the study of programs of programming languages, which is important for the understanding, and construction of compilers. Complexity theory: concerned with the study and analysis of algorithms, which helps in measuring the efficiency of the algorithms. Database Architecture: involves the study and design of efficient methods for information storage, process & retrieval. Artificial intelligence: Is concerned with means by which Computers may perform tasks that would be characterized as intelligent if performed by human beings.

Chapter One

Page 4

Introduction to Computer Science


1.2.1. What is Computer? A computer is an electronic device that accepts data, performs computations, and makes logical decisions according to instructions that have been given to it; then produces meaningful information in a form that is useful to humans. The name computer comes from a Latin word Computer, meaning, to compute 1.3. Characteristics of Computers

The characteristics of a computer show the capability and the potential of the computer for processing data. This saves time, space, money, labors etc. And they answer the questions why computers are used? Why have they become so popular? i Speed The ability of the computers to carry out their instructions in a very short period of time is one of the main reasons for their popularity. Computers can perform within a matter of seconds or minutes tasks that would be impossible for a person to complete by hand in lifetime. Its speed is measured by the amount of time it took to perform or carry out a basic operation.And its speed measured in terms of micro second (10-6 one millionths), nano second (10-9 one billionths), and Pico second (10-12 one trillionths). Hence a computer with speed 1 microsecond can perform 1 million instructions in just 1 second. ( For example in one second this computer can perform the following tasks: Compute the grade point average for 3000 students Calculate the total number of all books used by students in a university i Accuracy Now a days computers are being used in life-and-death situations (For example, jet pilots rely on computer computations for guidance, Hospitals rely on patientmonitoring systems in critical care units) which needs almost hundred percent accuracy. From this we can understand that computer is accurate and consistent. Unless there is an error in the input data or unreliable program the computer processes with a very accurate.

Chapter One

Page 5

Introduction to Computer Science


i Durability and reliability Generally, reliablility is the measurment of the performance of a computer, which measured against some predetermined standard for operation without any failure. The major reason behind the reliability of the computers is that, at hardware level, it does not require any human intervention between its processing operations. Moreover, computers have the built-in diagnostic capabilities, which help in continuous monitoring of the system. i Versatility Computers are quite versatile in nature. They can perform multiple tasks simultaneously with equal ease. For example, at one moment it can be used to prepare a letter , the other moment it can be used to play music and in between you can print a document as well. All this work is possible by changing the program (sequence of instructions for computers). In brief, we can say that a computer can perform various tasks by reducing the task to a series of logical steps. i Diligence A computer is free from tiredness, lack of concentration, fatigue, etc. It can work for hours without creating any error. If millions of calculations are to be performed, a computer will perform every calculation with the same accuracy. Due to this capability it overpowers human being in routine type of work. i Storage Capability Computers can store large amounts of data and it can recall the required information almost instantaneously. The memory of the computer is relatively small and it can hold only a certain amount of information, therefore, the data is stored on storage devices such as magnetic tape or disks. Small sections of the data can be accessed very quickly and brought into the storage devices, as and when required, for processing. In order to explain the idea of storage capacity, we can take an example of CD-ROM and a hard disk. A single CD-ROM can store up to 700 MB of data while a hard disk can have a capacity of around 80GB (1GB=1024 MB). Note: Even if the above main characteristics of computers are increasing with time, the cost and size of computers are decreasing.

Chapter One

Page 6

Introduction to Computer Science


1.4. Types of computers

There are different types of Computers. Their difference is depending on different categories of characteristics. Classification by the method of operation (processing) They are classified into three: I. Analog Computers

Analog computers operate by measuring. They deal with continues variables; they dont compute directly with numbers, rather, they operate by measuring physical magnitude such as pressure, temperature, voltage, current etc. Examples i Thermometer, Voltmeter, Speedometer i Gasoline pomp Contains an analog Computer that converts the flow of pumped fuel into two measurements the price of the delivered gas and the quantity of pumped fuel. Note: They are special purpose computers. Analog computers have limited accuracy II. Digital Computers

Digital computers deal with discrete variables; they operate by counting rather than measuring. They operate directly up on numbers (or digits) that represent numbers, letters, or other special symbols. Examples: i Abacus i Desk & pocket computers i The general purpose computers Digital computers have higher accuracy and speed than the analog ones. III. Hybrid Computers

The best features of analog and digital computers can be combined into a single device to form a hybrid computer. A hybrid computer processes the information by collecting input data with analog method, convert it into digital quantities, processes the digital values and convert the output from digital to analog form.

Chapter One

Page 7

Introduction to Computer Science


Example: In hospital insensitive-care unit analog devices may measure a patients heart function, temperature and other vital signs. These measurements may then be converted into numbers and supplied to a digital component in the system. This component is used to monitor the patients vital signs and to send an immediate signal to the nurses station. If any abnormal readings are detected. Classification by purpose of application Computers can be applied or used for different purposes. Based upon their application, they are classified as special purpose or general-purpose computers I. Special purpose computers

They are designed to solve a single type of problem, that is their components and function are uniquely adapted to a specific situation involving specific application. Example: i The public telephone box i Traffic control system i Ticket machines (used in grocery, super market etc.) i Pocket calculators i Counters etc.. Most analog computers are special purpose computers. II. General-purpose computers

They are designed to solve variety of problems through the use of store program concept. A program or set of instructions designed to solve a problem is read and stored into the memory and then executed by the computer one by one. The same computer can be applied to solve another set of problem using different program. General purpose computers are more flexible and versatile. Examples i Micro computers i Mini computers i Super computers etc. Chapter One Page 8

Introduction to Computer Science


Classification by physical size, price, capacity and performance At this stage, by a computer, we mean a general-purpose digital computer. There is a wide variety of general purpose digital computers on the market place today, in terms of physical size, price, capacity, and performance. They are then classified as follows by their capacity and size: Super computers: Super computers are the fastest, largest and most potential types of computer. They have speed of hundreds of millions of operation per second, a primary memory capacity of about 80 million characters, a secondary memory of capacity of about 20 times its primary memory. They are multi-user systems in intercontinental range. They can carry out enormously complex scientific calculations.

They are used to process huge amount of data and are commonly used in space technology centers, meteorology stations,astronomical observatories, inter continental communications, airline organizations. Mainframe computers: Smaller than super computers in size and capacity, lower in speed & memory capacity than the super computers. However they are multi-user systems and handle hundreds of users, usually used in large organizations. Mini computers Have relatively lower speed, can handle multi-users, are smaller in size than the mainframe computers. They use terminals for inputs and output. Mini computers are used in small organizations. Micro computers: Micro computer (personal or desktop computer) is a computer whose CPU is microprocessor. Microprocessor is a processor all of whose components are on a single integrated-circuit chip. Since its CPU is integrated in a single circuit, it can serve only a single user at a time. Most of home and personal office computers are microcomputers. The relative performance and usage of personal computer is relatively increased with a very high rate.

Chapter One

Page 9

Introduction to Computer Science


1.5. Application of Computers Why we use Computers? The following are some of the capability of Computers, which are reasons to use Computers. i Store and process large amount of information with high speed and accuracy; i Transmit information across continents via communication channels; i Simulate events; i Perform complex mathematical computations and make comparisons; i Monitor ongoing industrial operations; i Perform repetitive processes with great ease, speed, and reliability; Therefore, computers are applicable for any functions or process that requires these abilities. The main areas of computer applications can be listed as follows: Learning Aids: Example: learning toys, programs range from simple arithmetic to calculus, from English grammar to creative writing and foreign language, and from basic graphics to engineering design models,) Entertainment: Examples : Games Commercial or business applications Computers are needed to perform business operations that require handling large amounts of data. Several computer applications are available to assist business in working with large volumes of data. Examples are: Text processing Accounting and Finance management Inventory control Database management Statistical Analysis

Chapter One

Page 10

Introduction to Computer Science


Scientific engineering and research applications Using computers for scientific research, complex mathematical calculations, design work, and analysis and control of physical systems. Examples are: Space technology Meteorological observatory systems Astronomical investigations Design of machines and Control of manufacturing process Information Utilities Information utilities companies use large computers that store huge amount of information about many different subjects. These computer systems and their vast amount of data are available for personal use. For example: information utilities can allow a computer user to read the daily news , research published works, send a letter to a friend, play games, make airline reservations, obtain the latest stock market quotations, and perform many other activities. Example: Internet. Electronic Banking and Service: Example: Teller Machine (customers are issued cards that permit them to use other banks teller machines) Online banking (A bank customer can use his/ her computer to check account balances, transfer funds, pay bills) Shopping from Home Individual may now shop by computer in the comfort of their home. Household Control A growing number of the newer houses hold devices are computers controlled. For example: Security systems, refrigerators, microwave ovens, washers, stereos, and televisions. This computer controlled home security system monitors movements,

Chapter One

Page 11

Introduction to Computer Science


broken glass, unlawful entry without a security code, and so on, and alerts the local police department. Weather and Environment Computer equipment may show temperature ranges , precipitation levels and wind flow and can used in weather forecasting. Computer can also helped in overcoming environmental hazards. Transportation Computers have affected almost every kind of transportation. Many aircraft can fly under the control of the computer; in this situation, the captain simply serves as a manger by telling the computer what to do. In Cars, computers have provided functional controls such as spark and fuel control. Medical and Health Care Computers have long been used by hospitals for routine record keeping. Today, however, many people owe their lives to the computer. Computers are used in hospitals as sensors (device that detect changes in blood pressure, heart rate, temperature), testing (scan the body and provide 3-D figure), patient treatment. Routine and Dangerous Tasks Computers are used in routine tasks. And they can perform task in environments to dangerous for human workers. Consultant (Expert system) An Expert system is a computer program, which can solve problems from a specific knowledge base. These systems don't replace expert humans because the knowledge base of expert system is given from the skilled specialist. Example: Mycin (a medical diagnostic program by using sophisticated decision making process).

Chapter One

Page 12

Development of Computers

CHAPTER TWO

Two History of Computing


We have all heard stories of primitive peoples counting their sheep by moving sticks or stones. Our base ten number system undoubtedly grew from the use of 10 fingers as counting objects. Together with the development of people, the need to calculate and keep track of information had become popular issue. So they soon develop a simple computing device and had a power of storing small information. However, many thousands of years elapsed before developing mechanical calculator. Some of the calculating devises are mentioned bellow: 1. Abacus It is one of the earliest mechanical computational devices. It was in use in the Middle East as early as 2500 BC The familiar Chinese abacus ( dating approximately 1200 AD ) is composed of a frame and a number of wires. The wires correspond to position of digits in a decimal number-units, tens, hundreds, and so on-and the beads represent digits. Beads above the cross bar represent 5 and those below ,1. The abacus shows zero, if all the bead below the cross bar are at the lower frame and above are at the upper frame. Addition of two numbers on the abacus can be performed by representing the first number and the second number without resetting the first. On any wire showing 10 or more, the two beads above the cross bar are moved back, and an extra 1 (the Cary) is added two the wire on the left. This process can be easily generalized to addition and subtraction of more than two numbers. 2. Pascals calculator It is the first true mechanical calculator. In 1642, at the age of 19, the French philosopher and mathematician Blaise Pascal developed a rotating wheel calculator, the predecessor of the latter popular desktop calculator. He built largely to assist his father, who was a tax collector in the town of Rouen, Pascals calculator has one wheel corresponding to each power of 10; each wheel has 10 position, one for each of the digits (0,..9). Although Pascals Chapter Two Page 1

calculator could only add and subtract, it could be used indirectly for multiplication (by successive addition) and division( by successive subtraction) as well. 3. The difference engine It is the forerunner of the modern computer. Charles Babbage (1792-1871), a British mathematician and engineer, is considered by many to be the real father of todays computer was the developer of the difference engine and designer of the analytical engine. The difference engine also based on the rotating wheels principle, was operated by means of a single crank. This devise has a power of calculation and print the out put with out human intervention. He finally designed significantly improved version of the difference engine (but not built) called Analytic engine. It has different key components i The store: A memory wheel consisting of set of counter wheels i The mill: An arithmetic unit capable of performing the four basic arithmetic operations. It operated on pairs of mechanical registers and produced a result stored in another register, all of which were located in the store. i Operation cards: These card selected one of the four arithmetic operations by activating the mill to perform the selected function. i Variable cards: These cards selected the memory locations to be used by the mill for a particular operation ( a source of operand and the destination of the result ). i Output: was to print or a card punch device. But finally the design halt largely due to the technology of the day is not far enough too supply the required raw materials. 4. Herman Holleriths tabulating machine Herman Hollerith was a statistician that in 1880 and develop his machine commissioned by the U.S. Census Bureau to develop a technique for speeding up the processing of census data that took at least 8 years before. He develops his machine that uses the punched card to punch the census the data and tabulated by using his machine. This machine processes the 1890 American census data with in 3 years. It was really a great development. He finally began the tabulating Machine Company, which later becomes the International Business Machine Corporation (IBM) Chapter Two Page 2

Development of Computers

5. Mark I

Development of Computers

Developed by Howard Aiken at Harvard university (1944) which were the one first electromechanical computer. Instruction were provided by means of punched paper tape, which combined the functions of Babbages operation cards and variable cards. Each instruction had the format: A1 A2 OP , where A1 and A2 are registers storing the operands and OP is the operation to be performed( e.g. +,-,x,%) Mark I could do a single addition in 6 seconds and division in 12 seconds 6. ENIAC( Electronic Numerical Integrator And Computer) Developed by Eckert and Mauchly at the university of Pennsylvania. This was the first electronic calculator and first general purpose digital computer. This machine was enormous, weighing 30 tones. occupying 15,000 square feet of floor space and containing over 18,000 vacuum tubes. When operating, it consumed over 140 kWh of power. It had a capability of performing 5,000 addition per second. Its memory consisted of 20 accumulators each capable of holding a 10 digit decimal number. Each digit was represented by a ring of 10 vacuum tubes. At any time, only one of the 10 tubes was in ON state, representing one of the 10 digits. i ENIAC did not use internally stored programs. Programs were wired on boards similar to a telephone switch board. i One of the major drawbacks of ENIAC was that it had to be programmed manually by setting switches and plugging and unplugging cables. 7. The Von Neumann Machine The task of entering and altering programs for the ENIAC was extremely tedious. Von Neumann was the consultant on the ENIAC project and forward the stored program concept, i.e designing the computer to get its instruction by reading them from memory alongside the data and a program could be set or altered by setting the values of a portion of a memory. Based on this concept, the first true electronic computers were developed by the name EDVAC( electronic Discrete Variable Computer) and EDSAC( Electronic Delay Storage Automatic Computer).

Chapter Two

Page 3

8. Commercial Computers

Development of Computers

The 1950s saw the birth of computers industry with two companies, Spery and IBM, dominating the market place. In 1947, Eckert and Mauchly develop their successful Computer). UNIVAC was division of Remington Rand (later Sperry_Rand Corporation). IBM also the major manufacturer of punched card processing equipment ,delivered its first electronic stored program computer, the IBM 701, in 1953. commercial computer called UNIVAC I (Universal Automatic

Generation of Computers
Although computer professionals do not agree on exact dates or specifics, computer developments are often categorized by generations. Actually there are four generations and major characteristics that distinguish these generations are the following; i Dominant type of electronic circuit elements used. i Major secondary storage media used. i Computer language used. i Types or characteristic of operating system used. i Memory access time (time to store or retrieve a word or data from memory). Computer generations are usually categorized by dramatic improvement in the hardware, typically refold or better increases in speed and reliability. 1. First generation (1950s) i Used vacuum tubes as components for the electronic circuit. i Punched cards were the main source of inputs, and magnetic grams were used for internal storage. i Operate in a speed of milliseconds (thousands of a second) and could handle more than 10,000 additions each second. i Most applications were scientific calculations.

Chapter Two

Page 4

Development of Computers
2. Second generations (early 1960s) i Transistors were the main circuit components. (Transistors are a solid state device made from silicon which is smaller, cheaper, faster, dissipate less energy and more reliable than vacuum tube but work in the same way with the vacuum tube.) i Invented by Bell Labs. i Magnetic tapes (similar with home tape caste), used for main storage, i Operate in microseconds (millionths of a second) with more than 200,000 additions possible each second. i Business applications become more commonplace, with large data files stored on magnetic tape and disk. (Magnetic disk: is a circular platter constructed of substance.) i High-level languages COBOL and FORTRAN were introduced during this period. Batch operating systems are used that permitted rapid processing of magnetic tape files. 3. Third generation (late 1960s, early 1970s) Characterized by solid-state logic and integrated circuit (IC). (A single, selfmetal or plastic materials coated with magnetizable

contained transistor is called discrete component. In early 1960 electronic equipment composed of discrete components transistors, capacitors, resistors, . They are i manufactured separately i Packed in their own containers and soldered (wired together) on a circuit board. So the entire manufacturing process was cumbersome and expensive. Do to these and other problems in 1958 the achievement that revolutionized electronics started the era of microelectronics: the invention of integrated circuit. i Computer storage switched from magnetic cores to integrated circuit boards that provide modularity (expandable storage) and compatibility (interchangeable equipment i New input/output methods such as optical scanning and plotters. i Software become more important with sophisticated operating systems, improved programming languages, Chapter Two Page 5

4. Fourth generation (late 1970s,early 1989s,)

Development of Computers

i Greatly expanded storage capabilities and improved circuitry. i Has a large-scale integrated circuits (LSI) which has several hundred thousands transistors placed on one tiny silicon chip. i Computer memory operates at speeds of nano seconds (billionths of a second) with large computers capable of adding 15 million numbers per second. 5. Fifth generation The fifth generation computer is in progress. An architecture, which makes use of the changes in technology and allows a simple and natural methodology for solving problems, is being sought. These computers will have intelligent processors i.e., processors which can draw inferences. Users will also be able to interact with them in natural languages such as English, German etc. Japans are working intensively on the project for developing the 5th generation.
Generation Circuit element SSD Language Operating system Mem. Access time Approx. date Examples 1st Vacuum tube Punched card Machine assembly Operator control 1ms 1946-57 ENIAC, UDVAC UNIVAC, & 2nd Transistor Magnetic Tape Fortran, COBOL etc Batch system 10s 1958-64 IBM7090, 7094 3rd IC Magnetic disk Structured language Application oriented 10ns 1965-71 IBM system 1ns From 1971 above Late IBM product Time sharing LSI Mass storage device Application oriented 4th 5th VLSI

Summary of generation of computers

Chapter Two

Page 6

ORGANIZATION OF COMPUTER SYSTEMS

CHAPTER THREE
Computer System
Objective: What a computer system is and how it works to process data

3.1. Introduction
System is a group of components, consisting of subsystems or procedures that work in a coordination fashion to achieve some objective. A Computer System is composed of components that are classified either as Computer hardware or Computer software.

3.2. Computer Hardware


Computer architecture hardware is defined as to the science of selecting that and meet interconnecting components create computers

functional, performance, and cost goals. It can be described as the logical structure of the computer system. Computer hardware is the physical part of the computer that can be touched, seen, broken. What a computer in general does is, that It takes input (in various forms) Process it (according to a given set of instructions) and Produce an output (in required form). Store the information

Based on this the hardware part of a computer system is composed of a number of interacting physical parts. The different hardware parts of a computer which are responsible for these operations are illustrated by the following model.

Page 1

ORGANIZATION OF COMPUTER SYSTEMS

Page 2

ORGANIZATION OF COMPUTER SYSTEMS


Central Processing Unit Control Unit (CU) Arithmetic Logical Unit (ALU) Registers

Input Unit

Primary Memory Random Access Memory (RAM) Read Only Memory (ROM)

Output Unit

Secondary Storage Unit


Fig 3.1 Information flow in the computer hardware

3.2.1.

The Central Processing Unit (CPU)

The CPU or the microprocessor (or simply processor) is referred as the brain of the computer system; it is a VLSI chip inside the system, plugged onto the motherboard. A processor controls all internal and external devices, and performs arithmetic and logical operations. It is the most costly and main component of the computer system. A processor operates only on binary data, that is, data composed of 1s and 0s. These 1s and 0s correspond to electrical switches being switched ON or switched OFF. The processor performs, supervises, and controls the arithmetic and logic functions. It performs arithmetic operations such as additions, multiplication, division, and logical operations such as is A greater than B? The functions of a processor can be summed up as: Carrying out arithmetic and logical operations

Page 3

ORGANIZATION OF COMPUTER SYSTEMS


Controlling the use of main storage (memory) to store data and instructions Controlling the sequence of operations Controlling all the parts of the computer system The CPU consists of three main subsystems: The control unit (CU), the Arithmetic Logic Unit (ALU), and the Registers. The three subsystems work together to provide the operational capabilities of the computer. Purpose of CPU Fetch instruction: The CPU read instruction from the memory Interpret instruction: the instruction must be decoded to determine what action is required Fetch data: the execution of an instruction may require reading of data from memory or an I/O module. Process data: the execution of an instruction may require performing some arithmetic or logical operation on data. Write data: The result of an execution may require writing data to memory or an I/O module. The Control Unit

Instruction register Flags

Registers
Controls the flow of information.

Control unit

As the name implies, it performs all the control functions of the computer. It retrieves the instruction from memory. Translates those instructions into computer functions and sends signals to other computer hardware units to carry out those functions. It is also responsible for determining the next instruction to be executed by the computer. In general it serves as the computer traffic cope.

Page 4

ORGANIZATION OF COMPUTER SYSTEMS

The Arithmetic Logical Unit (ALU) Register Control unit Register flags

ALU

It is referred as the computers "number crunchier ". It performs the arithmetic calculations: addition, subtraction, multiplication, division and comparisons (and, or, xor) and it is used to keep track of and execute instruction. All modern digital computers can do is addition; multiplication is merely a continuous addition; subtraction is the addition of the complements of the number to be subtracted; Division is the addition of complements.

Registers The registers are special purpose, high speed memory units. They hold various types of information such as data, instructions, addresses, and the intermediate results of calculations. Especially, they hold the information that the CPU is currently working on. Registers can be thought of as CPUs working memory. As soon as a particular instruction or piece of data is processed, the next instruction immediately replaces it, and the information that results from the processing is returned to main memory (RAM). Data and instructions do not enter either the ALU or the CU, instead the ALU work on the data held in the registers along with the instruction on which it acts. Instruction addresses are normally stored in consecutive registers and are executed sequentially. The control unit reads an instruction in the memory by a specific address in the register and executes it. The next instruction is then fetched from the sequence and executed, and so on. This type of instruction sequencing is possible only if there is a counter to calculate the address of the

Page 5

ORGANIZATION OF COMPUTER SYSTEMS


instruction after instruction. This counter is a register, which stores intermediate data used during the execution of the instructions after it is read from the memory. The important registers within the CPU are: Register Name Program Counter (PC) Instruction Register (IR) Memory (MAR) Memory Buffer Register (MBR) Accumulator (ACC) Data Register (DR) CPU Characteristics 1. Machine Cycle time The time in which a machine cycle occurs is measured in fractions of seconds. The machine cycle time ranges from milliseconds to Pico seconds. Machine cycle time can also be measured in terms of how many instruction are executed in one second usually millions of instructions per second (MIPS) 2. Clock Speed CPU produces a series of electronic pulses at a predetermined rate, called clock Speed, which affects machine cycle time. System clock is a circuit that generates electronic pulses at a fixed rate to synchronize processing activities. One cycle or pulse is known as a hertz (HZ). Normally, megahertz (MHZ) or giga hertz (GHZ) is the measurement of cycles in millions per second. 3. World Length and Bus Line Width Address Function A program counter keeps track of next instruction to be executed Holds the instruction to be decoded by the control unit accessed Is used for storing data either coming to the CPU or data being transferred by the CPU It is a general-purpose register used for storing temporary results and results produced by arithmetic logic unit Is used for storing the operands and other data. Register Holds address of the next location in memory to be

Page 6

ORGANIZATION OF COMPUTER SYSTEMS


Data is moved in computer system in groups of bits. A bit is a Binary digit 0 or 1. The number of bits the CPU can process at one time, called the word length of the CPU, determines overall system performance. A CPU with word length of 32 (called 32 bit CPU) will process 32 bits of data in one machine cycle. Data is transferred from the CPU to the other system components or vice versa via Bus Line. Bus line is the physical wiring that connects the computer system components and transfers data between them. The number of bit a bus line can transfer at any one time is the bus line width.

Page 7

ORGANIZATION OF COMPUTER SYSTEMS

3.2.2.

Storage Units

Storage units are used to store data. There are two types of storage units: Primary and Secondary.

3.2.2.1. Primary Storage


The primary memory or the main memory is part of the main computer system. The processor directly stores and retrieves information from it. The processor accesses the main memory in random fashion, that is, the processor can access any location of this memory either to read information from it or store information in it. The primary memory is implemented by two types of memory technologies. The first is called Random Access Memory (RAM) and the other is Read Only Memory (ROM).

3.2.2.1.1.

Random Access Memory (RAM)

RAM can be defined as a block of sequential memory locations, each of which has a unique address determining the location and those locations contain a data element. It stores programs and data that are in active use. Storage locations in main memory are addressed directly by the CPUs instructions. It is volatile in nature, which means the information stored in it remains as long as the power is switched ON. As soon as the power is switched OFF, the information contained in it vanishes. RAM can be further divided into two categories: 1. Dynamic RAM (DRAM): - This type of RAM holds the data in dynamic manner with the help of a refresh circuitry. Each second or even less than that the content of each memory cell is read and reading action refreshes the contents of the memory. Due to this refreshing action, the memory is called DRAM.

Page 8

ORGANIZATION OF COMPUTER SYSTEMS


2. Static RAM (SRAM): - SRAM along with DRAM is essential for a system to run optimally, because it is very fast as compared to DRAM. It is effective because most programs access the same data repeatedly and keeping all this information in the fast SRAM allows the computer to avoid accessing the slower DRAM. SRAM is generally included in a computer system by the name of cache. Cache: - It is a piece of very fast memory, made from high-speed static RAM that reduces the access time of the data. It is very expensive and generally incorporated in the processor, where valuable data and program segments are kept. This enables the processor to access data quickly whenever it is needed. Major reason for incorporating cache in the system is that the CPU is much faster than the DRAM and needs a place to store information that can be accessed rapidly. The cache facilitates the system to catch up with the processors speed. The cache fetches the frequently used data from the DRAM, and buffers (stores) it for further processor usage. Cache can be further categorized into two categories: Level 1 Cache (L1): - It, also known as primary cache, is built into the processor chip. It is a small fast memory area that works together with the Level 2 cache to provide the processor much faster access to important and often used data. Level 2 Cache (L2): It, also known as secondary cache, is a collection of static RAM chips that are built onto the motherboard. L2 cache is a little larger and slower than L1, but is faster than the main memory. L1 and L2 cache are used together for optimal use of processor.

3.2.2.1.2.

Read Only Memory (ROM)

As the name suggests, read only memory can only be read, not written. In other words, CPU can only read from any location in the ROM but cannot write. The contents of ROM are not lost even in case of a sudden power failure, making it

Page 9

ORGANIZATION OF COMPUTER SYSTEMS


non-volatile in nature. The instructions in ROM are built into the electronic circuits of the chip. These instructions are called f irmware. ROM is also random access in nature.

Types of ROM
Masked ROM: It is a hard-wired device that contained a pre-programmed set of data or instructions. The contents of such ROMs have to be specified before chip production, so the actual data could be used to arrange the transistors inside the chip. Programmable ROM (PROM): Blank PROM chips can be coded by anyone with a special tool such as PROM-Programmers. However, once a PROM has been programmed, its contents can never be changed. It is also known as one-time programmable (OTP) device. Like other ROMs, the information stored in PROM is also non-volatile, but they are more fragile that other ROMs as a jolt of static electricity can easily cause fuses in the PROM to burn out, changing essential bit pattern from 1 to 0. Erasable Programmable ROM (EPROM): It is programmed in exactly the same manner as a PROM. However, unlike PROMs, it can be erased and reprogrammed repeatedly. An EPROM can be erased by simply exposing the device to a strong source of ultraviolet light for certain amount of time. An EPROM eraser is not selective; it will erase the entire EPROM. Electrically Erasable Programmable ROM (EEPROM): It can be erased by an electrical charge and then written to by using slightly higher-thannormal voltage. It can be erased one byte at a time. Hence, the process of reprogramming is flexible, but slow. It is often used to store programmable instructions in devices, such as printers and other peripherals. Flash ROM: Also called Flash BIOS or Flash memory, is a type of constantly powered non-volatile memory that can be erased and re-programmed in blocks. It is often used to hold control code such as the BIOS in a personal computer. It is used in Digital cellular phones, digital cameras, LAN switches, PC Cards for notebook computers, digital set-up boxes, embedded controllers, and other devices.

Page 10

ORGANIZATION OF COMPUTER SYSTEMS


3.2.2.2. Secondary Storage units

Secondary Storage: - Secondary storage or auxiliary storage, can take many forms, which have traditionally included punched cards, papers tape, magnetic tape, magnetic disk, floppies, and CD-ROMs. The information in the secondary storage device can be accessed, depending upon how the information is stored on the storage medium. Primarily, there are two methods of accessing data from the secondary storage devices: x Sequential: - Sequential access means the computer system must search the storage device from the beginning until it finds the required piece of data. The most common sequential access storage device would be a magnetic tape where data is stored sequentially and can be processed only sequentially. This access method is less expensive than other methods. The disadvantage of sequential organization is that searching for data is slow. x Direct: - Direct access, also known as random access, means that the computer can go directly to the information that the user wants. The most common direct access storage is the disk and the most popular types of disks today are magnetic and optical disks.

3.2.2.2.1.

Sequential Access Media

Punched Cards Punched cards are one of the oldest and most familiar forms of data storage. There are two types of punched cards, 80 columns, and 96 columns and the first one is a standard punched card. Using one card we can represent 80 characters. If only a numeric punch is in any column, it represents whatever number is punched out.

Page 11

ORGANIZATION OF COMPUTER SYSTEMS


Punched Paper Tape Punched paper tape is a continuous strip of paper used to store data in much the same manner as punched cards. The paper tape is approximately one inch wide & can have either six or eight channels. Eight channels paper tape is based on the ASCII code. This storage media is less expensive and more compact than punched cards. Magnetic Tapes Magnetic tapes are a particularly popular form of secondary storage because of their high data density (the number of bytes of instruction per inch of tape) and their convenience in handling. Magnetic tapes are approximately one - half inch wide and are made of Mylar based plastic film which can be magnetized. Data are stored on a magnetic tape by running the tape over the electromagnetic called read/write head which magnetizes small spots on the tape. Seven-track tapes store information as bytes of information, where each byte consists of a six-bit code and a one-bit parity bit. Nine-track tape uses an eight-bit and a parity bit. An 800 bytes per inch density of magnetic tape and has a length of 100 inch can store 80,000 bytes of information.

3.2.2.2.2. Direct (Random) Access Media


Magnetic disks Magnetic disks are metals or plastic platters coated with ferrous oxide, an easily magnetizable material. Magnetic disks allow for random access of information and overcome the slow access time commonly found in tape files. Floppy disks Also called diskette. Used to store programs and data for a longer period outside the computer system. Often used with mini and micro computers.

Page 12

ORGANIZATION OF COMPUTER SYSTEMS


Data is stored in concentric circles called tracks. Each track is further divided into sectors A sector stores the amount of information that can be read or written in single operation.

Disk drive: - is part of a computer system which reads from and writes data on a disk.

Hard Disk
A high capacity magnetic disk made up of metal which can be fixed in the system unit of the computer. Serves as a secondary storage. Enables very fast accessibility of data. Accessing data from hard disk is faster than from floppy disks. The disks, which are usually grouped together into a disk pack, are separated by small air spaces to allow access for read/write head. Each disk has approximately 200 tracks on which information is stored. Tracks of the small number on all adjacent disks are referred to as a cylinder of that disk. The disk pack is mounted on a magnetic disk drive which rotates the disk at speed up to 1,000 revolutions per second. Cross section of a disk pack The total collection of tracks available on one movement of the access mechanism is known as cylinder. The amount of time it takes to retrieve (or store) data from (or to) disk is called the disk access time.

Page 13

ORGANIZATION OF COMPUTER SYSTEMS

3.2.3.

Input/output units

Input/Output units allow people and other technologies to put data into a computer and get information out of a computer.

3.2.3.1. Input Unit


Is the unit used to enter data into the computer so that it can be processed. It converts information from a form suitable to human beings to one understandable by the computer. Examples of input devices; Keyboard (which is the most widely used input devices) Disk derives (floppy and hard-disk derives) Mouse, trackball, joystick Scanner Light pen (a photo cell to choose a displayed response to request further information). Voice synthesizer; CD-ROM Drive, etc.

3.2.3.2. Output Unit


Output is anything that comes out of a computer. The output may be a picture, text or image. An output device is any machine capable of accepting and representing information from a computer. An output unit converts the result of the only-machine understandable form to a form understandable by human beings. Examples The Visual Display Unit (VDU) or monitor or screen Printers (dot matrix, desk wheel, laser printers) Plotters Voice (audio) response unit, Disk drives

Page 14

ORGANIZATION OF COMPUTER SYSTEMS


Types of Output Devices
1. Hard Copy: The physical form of output is known as hard copy. In general, it refers to the recorded information copied from a computer onto paper or some other durable surface, such as microfilm. Hard copy output is permanent and relatively stable form of output. This type of output is also highly portable. Paper is one of the most widely used hard copy output media. Among the wide variety of hard copy output devices, the following are the most commonly used ones. a. Printers b. Plotters c. Microfilm 2. Soft Copy: The electronic version of an output, which usually resides in computer memory and/or on disk, is known as sof t copy. It is not permanent form of output. It is transient and is usually displayed on the screen. This kind of output is not tangible, that is, it cannot be touched. Soft copy output includes audio and visual form of output, which is generated using a computer. In addition, textual or graphical information displayed on a computer monitor is also a soft copy form of output. Among the wide variety of hard copy output devices, the following are the most commonly used ones. a. Monitors b. Audio response c. Projectors

Hard Copy Output Devices A. Printers


The most common output device you will encounter will be the printer. Printer is available in various forms, to suit the needs of various types of users. A printer is an output device that prints characters, symbols, and perhaps graphics on paper hardcopy.

Page 15

ORGANIZATION OF COMPUTER SYSTEMS


Printers are categorized according to whether or not the image produced is formed by physical contact of the print mechanism with the paper. Hence they classified as impact and non-impact printers. Impact printers have contact; nonimpact printers do not. 1. Impact Printers These types of printers form images by striking a mechanism such as a print hammer or wheel against an inked ribbon, leaving an image on paper like a typewriter. Impact printers are dying out, though you might still run across a dot-matrix printer. Characteristics of Impact printers: There is physical contact with the paper to produce an image Relatively low consumable(ink, ribbon, etc) costs Useful for bulky printing Very noisy Since they are mechanical in nature, they tend to slow Impact printers include: Dot matrix Printers Daisy Wheel Printers Drum Printers

Dot matrix printer


x x x x x x It is the oldest printing technology and it prints one character at a time. It can print any shape of character, which a user can specify. The speed of dot matrix printers is measured in characters per second (cps). The speed can vary from about 200 to over 500 cps. The print quality is determined by the number of pins (the mechanisms that print the dots), which can vary from 9 to 24. Most dot matrix printers have a resolution ranging from 72 360 dpi (dot per inch). Dot matrix printers are inexpensive and have low operating costs.

Page 16

ORGANIZATION OF COMPUTER SYSTEMS


x x The major limitation of dot matrix printer is that it prints only in black and white. The image printing ability is also very limited.

Daisy Wheel Printers


x x x x x x They can produce professional letter quality documents. These printers are commonly referred to as letter quality printers as the print quality is as good as that of a high-quality typewriter. They produce high-resolution output and are more reliable than dot matrix printers. They can have speeds up to 90 cps. These printers give only alphanumeric output. They cannot print graphics and cannot change fonts unless the print wheel is physically replaced. They are slower and more expensive than dot matrix printers.

Drum Printers
x x x x Drum printers can print an entire line in a single operation. Hence, these printers are known as line printers. Their printing speed varies from 150 lines to 2500 lines per minute with 96 to 160 characters on a 15-inch line. Have limited multi-font capability, and often produce lower print quality than most recent printing technologies. Line printers are designed for heavy printing applications. They are very expensive. 2. Non-impact Printers Non-impact printers are faster and quieter than impact printers, and you find them almost everywhere these days. Non-impact printers form characters and images without direct physical contact between the printing mechanism and the paper. Two types of non-impact printers often used with microcomputers are:

Page 17

ORGANIZATION OF COMPUTER SYSTEMS


Laser printers
x A laser printer creates images with dots. However, these images are created on a drum treated with magnetically charged ink-like toner (powder), and then transferred from drum to paper. x x x x x x x Laser printers produce resolutions at near-typeset quality; Color printing is available in more expensive models. Laser printers also have built-in RAM chips to store documents; Built-in ROM chips to store fonts and other formatting; and their own small, dedicated processor. Provide high speed and capabilities A toner, a black granular dust, is used in the process Prints up to 17 page per minute.

Ink Jet Printers


x Ink-jet printers also form images with dots they spray small, electrically charged droplets of ink from four nozzles through holes in a matrix at high speed onto paper. x Ink-jets can print in color; they are cheaper and quieter than laser printers; but they are slower and print in a somewhat lower resolution than laser printers.

B. Plotters
A plotter is a specialized output device designed to produce high-quality graphics in a variety of colors. Plotters are used for creating large hardcopy items, such as maps, architectural drawings, and 3-D illustrations items typically too large for regular printers.

C. Microfilm
It is an extremely high speed, low cost process, which records computer generated information directly from the computer tape or cartridge to a

Page 18

ORGANIZATION OF COMPUTER SYSTEMS


miniaturized microfilm media. The microfilm product is in fiche or roll format, which can be duplicated rapidly and inexpensively. This process can produce data in microfilm form at a highly significant speed from that of a paper printer.

Soft Copy Output Devices


A. Visual Displays (Monitors)
Monitors display softcopy output. Monitors run under the control of a graphics display adapter card plugged into an expansion slot on the system board. The adapter allows information to leave the computer and appear on the monitor. The Monitor can be:-

Cathode-Ray Tubes (CRTs)


x The cathode-ray tube (CRT) is a vacuum tube used as a display screen in a computer or video display terminal. x CRTs are the most common softcopy output devices used with desktop computers; x The CRT's screen display is made up of small picture elements called pixels. A pixel is the smallest unit on the screen that can be turned on or off or made different shades.

Flat-Panel Displays
x x Compared to CRTs, flat-panel displays are much thinner, weigh less, and consume less power. Their biggest limitations are: Cost an LCD (Liquid-crystal display) for a desktop microcomputer costs 2-3 times as much as an equivalent CRT monitor; Images are not always as good as CRT images; and Flat-panel images cannot be clearly viewed from an angle.

Page 19

ORGANIZATION OF COMPUTER SYSTEMS


Flat-panel displays consist of two plates of glass separated by a substance that may be activated in particular ways. Monitor, display screen, Video Display Terminal (VDT) is alternatively used to refer to the screen of the computer. The term monitor usually refers to the entire box, where as display screen can mean only the screen. Monitors/VDTs differ in size, color, resolution, bit mapping, refresh rate and graphic standard. Size Monitors come in many different sizes from the small screen built in to palm tops and laptop to external large monitors. The standard monitor for personal computers is 13 to 17 inch (32.5 to 42.5 cm) measured diagonally. Color Basically, considering color, monitors are grouped into two: monochrome display and color display. Monochrome displays actually display two colors: one for background, and one for foreground. These monitors show information using a single foreground color on a contrasting background color. For example, white on black, green on black or vise-versa The color monitor display many different colors. Many monitor display color combining shades of red, green, and blue (RGB). These RGB displays or monitors can create 256 colors and other several variations on them by blending shades of red, green and blue (hence they are called RGB Displays). Resolution On the computer screen, all characters and images are produced as the result of combining dot patterns, which are also, called pixels. The number of these dots or pixel per one-inch space (abbreviated as DPL) on the screen determines the quality or sharpness (resolution) of the character or the image. That means, the higher the number of pixels on one-inch space, the quality of the image will be. Common or standard resolutions are: 640 columns X 480 rows of dots (307,200 pixels on the full screen)

Page 20

ORGANIZATION OF COMPUTER SYSTEMS


800 columns X 600 rows (480,000 pixels) 1,024 columns X 768 rows (786,432 pixels)

Refresh Rate Refresh rate is the number of times per second the pixels are recharged so that their glow remains bright. Graphics Standard It is related to resolution; graphics standards combine resolution and use of color. A computer monitor is used with a graphics adapter card, an interface board between computer and monitor that performs one of severally used IBM compatible standards: color graphics adapter (CGA, the oldest and lowest resolution standard); enhanced graphics adapter (EGA), Video graphics array (VGA), and super VGA (SVGA which has the best resolution of all). There are different standards for monitors, and they support different color depths. VGA (Video Graphic Array) VGA, for video graphics array, will support 16 to 256 colors depending on the resolution. At 320 x 200 pixels it will support 256 colors; at the sharper resolution of 640 x 480 pixels it will support 16 colors, which is called 4-bit color. SVGA (Super Video Graphic Array) SVGA, for super video graphics array, will support 256 colors at higher resolution than VGA. SVGA has two graphics modes: 800 x 600 pixels and 1024 x 768. SVGA is called 8-bit color. Most new computers offer SVGA.

Page 21

ORGANIZATION OF COMPUTER SYSTEMS


XGA (Extended Video Graphic Array) Also referred to as high-resolution display, XGA, for extended graphics array, supports up to 16.7 million colors at a resolution of 1024 x 768 pixels. Depending on the video display adapter memory chip, XGA will support 256, 65,536, or 16, 777,216 colors. At its highest quality, XGA is called 24-bit color, or true color. Note: Hard Disk Drive and Floppy Disk Drive are a special type of input and output devices.

3.2.4.

The bus system

Interconnecting Components in a Computer and Information Movement in a Computer System. We have seen that there are different components of a computer and each performs a specific function. But to perform a given task in synchronized form there should be some mechanism of communication. For this reason there is an electronic circuit which produces communication path between the different components of a computer system along which data are transferred, that is Bus. The bus, which communicates the different parts of the CPU, is called Internal Bus. And the bus, which communicates the CPU with memory and peripheral devices, is called External Bus. The size of the bus determines the speed of efficiency of the computer. Address Bus: - is a unidirectional bus over which digital information is transferred to identify either a particular memory location or particular I/O address. Data Bus: - a bus system which interconnects the CPU, memory and all the peripheral Input / Output devices of a computer system for the purpose of exchanging data.

Page 22

ORGANIZATION OF COMPUTER SYSTEMS


Control Bus: - a bus used to select and enable an area of main storage and transmit signals required to regulate the computer operation. It carries control signals that allow the CPU to control the transfer of information along the bus. For example, the CPU must be able to indicate whether information is to be transferred from memory or to memory; it must be able to signal when to start the transfer and so on. It is important to realize that a computer system may have a number of separate bus systems so that information can be transferred between more than one pair of components at the same time. For example, it is common to have one bus for communicating between memory and the CPU at high speeds. This bus is called a CPU-memory bus. In addition, this bus would be connected to a second I/O bus via a bus adapter, as illustrated in the figure shown below. This second bus would be used for the slower I/O devices.

This arrangement allows the processor more efficient access to memory, as the CPU-memory bus can operate at very high speeds. These high speeds are only possible, if the physical bus length is quite short. Thus, by providing a second I/O bus to accommodate the various I/O devices that may be connected to the computer, the length of the CPU-memory bus can be kept shorter than it would be if the I/O devices were to be directly attached to a single system bus. On the other hand, to keep the cost of a computer system low, a single bus running at a slower speed, may be used to connect all devices to the CPU.

Page 23

ORGANIZATION OF COMPUTER SYSTEMS


In order to attach any device to a computer, it must be connected to the computers bus system. This means that we need a unit that connects the device to the bus. The terms device controller and device interface are used to refer to such a unit. So, for example, a disk controller would be used to connect a disk drive to the system bus and the term I/O controller refers to the controller for any I/O device to be connected to the bus system. A computer system will have some standard interfaces such as a serial interface, which can be used with a number of different I/O devices. The serial interface, for example, can be used to attach a printer, a mouse or a modem (device for communications over a telephone line) to the computer. So, if you wish to construct a new type of I/O device, you could use the standard laid down for the serial interface (the RS-232 standard) and you could then attach your device to the computer, using the serial interface.

Page 24

ORGANIZATION OF COMPUTER SYSTEMS

3.3. Computer Software


The computer hardware is an electronic device which has the potential of performing the task of solving a problem. However one has to give precise instructions to the hardware in order to solve problem. The finite set of instructions (steps) that the computer follow to perform a given job is called a program. Any program to be executed first it should reside / loaded/ in the memory. Software:- is a collection of programs and routines that support the operations of performing a task using a computer. Software also includes documentations, rules and operational procedures. Software makes the interface between the user and the electronic components of the computer. USER Software Hardware Computer software is classified into two 1. System software 2. Application software

3.3.1. System Software


Constitutes those programs which facilitate the work of the computer hardware. It organizes and manages the machines resources, handles the input/output devices. It controls the hardware by performing functions that users shouldnt have to or are unable to handle. System programs make complex hardware more user friendly.

Page 25

ORGANIZATION OF COMPUTER SYSTEMS


It acts as intermediate between the user and the hardware. It enables the computer understand programming languages i.e. it serves as means of communication between user and a computer. The important categories of system software are: A. Operating system B. Language software

A. Operating system
Operating system coordinates the activity between the user and the computer. An operating system has three major functions. i. Controlling operations (control program) Coordinates, or supervises the activity of the computer system. Decides where programs and data should be stored in the computer memory. Handles communications among the computer components, applications software and the user. Controls the saving and retrieving of files to and from disks in the disk drive. It performs all its controlling tasks without the involvement or awareness of the user. ii. Input/output Management The I/O manager coordinates the computers communication with outside world, flow of data to the display screen and other output devices (printers/ plotters) and from the key board or other input devices. Handles the flow of data to and from the disk drives (file management). Handles the process of preparing a disk for use, the copying, renaming, erasing task of a file. iii. Command Processing ( command Interpreter) It interprets the commands or what you enter using the keyboard or other input devices. If you write an internal command it carries out the function of that

Page 26

ORGANIZATION OF COMPUTER SYSTEMS


command if it is external command or other executable file it searches for the corresponding file in the default (current disk) or the user specified disk, loads the file into memory and transfers control to that program. Once this program is terminated, control returns to command and the program for that command or file is discarded from memory.

Types of Operating Systems


Operating systems can be classified by: The number of programs they can handle at a time and The number of users they serve at once at one or different stations (i.e. terminals or micro-computers connected to a central computer). i. Single tasking operating systems With single tasking operating systems: only one program can be run on a computer at a time. In order to run another program, one must remove the first program loaded in the computers main memory and load the other one(i.e. it cant handle two or more programs at a time) These types of operating systems are single user or can serve only one user at a time. ii. Multi user operating system It supports a number of work stations connected to a central system. A number of users can use the resources of one high capacity computer by the help of terminals. iii. Real Time Operating System A real time is a system that is capable of processing data so quickly that the results are available to influence the activity currently taking place. Its primary characteristics is that it responds to an event within a well defined time. Example: - Air plane seat reservations and computer controlled plant.

Page 27

ORGANIZATION OF COMPUTER SYSTEMS B. Language Software


It is software which is used by programmers to develop application softwares and translates programs to machine code. Language software is a generic name consisting of various programs that serve as editors & translators to develop programs in a number of programming languages. Translator: - is a program that converts one or more languages to another language. x x x Three types of translators are Assemblers, Compilers & interpreters. Assemblers: - is a program that translates assembly languages into machine code. Compiler: - is a program that translates a high level language into machine code. (Pascal, Fortran Cobol) Interpreter: - is a program that translates each instruction of high level language & executes the instruction before translating the next instruction. i The general-purpose routine and utilities include programs which are used to handle file processing, editing and debugging. i High level language software are software which have their own compilers to detect syntax errors of the users program code. Example Cobol, Fortran, Pascal. Etc. There are different types of language software and each of them briefly discussed in the following sections.

Machine Language (Low-Level Language)


Consists of strings of binary numbers (0s and 1s) and is the only language that the CPU directly understands. It is referred to as a low level language because the programmer has to think about the type of instructions that a particular machine can execute and know the binary equivalent of the instruction set. Each computer design has its own unique machine codes Advantage Machine Languages make efficient use of memory

Page 28

ORGANIZATION OF COMPUTER SYSTEMS


Instructions of a machine language program are immediately executable. Machine language instructions can be used to manipulate the individual bits in a byte of computer storage. Disadvantage Difficult to learn Prone to errors Difficult to correct or modify errors Not portable Machine Languages are machine dependent Machine languages require a high level of programming skill. Assembly language is a bit higher than machine language, but it is still low. This language lies between high-level languages and machine languages. Its easier for programmers to write instructions in an assembly language than to prepare instructions in machine language codes. An assembler is a program that enables the computer to convert the programmers assembly language instructions into its own machine code.

Assembly Language

Source code (Assembly Langrage)

Assembler

Object code (Machine Code)

It is machine dependent. It is not portable from one machine to another. It uses symbolic codes (mnemonic) instead of binary digits A mnemonic code is usually a strict abbreviation of the words it stands e.g. Add for Addition, SUB for subtraction, etc It is still used to write disk drive programs Advantage Writing in Assembly Language saves time and reduces the need for detail. Fewer errors are made and those made are easier to find. These programs are easier to modify. Easier to learn Easier to locate correct errors

Page 29

ORGANIZATION OF COMPUTER SYSTEMS


Disadvantage Coding is time consuming. It is also machine-oriented program. The programmers must know the machine characteristics and requirements The program size is big like machine codes It is usually unique to a particular computer series It is not directly executable by the computer. It needs assembler to translate it into machine codes

High Level Programming Language


The high level programming languages are problem oriented unlike the machine language, which is machine oriented programming language. The high level languages are symbolic languages that use English like words and/or mathematical symbols rather than mnemonic codes. A programmer may not be needed to know the details of the internal logical structure of a computer. Some of the Common High Level Languages: FORTRAN, COBOL, PASCAL, C, C++, Java, etc. Advantage Easier to learn and write the codes Codes are written with out any particular machine in mind Portable Small program size These languages may be used with different makes of computers with little modifications. They are easier to learn. They require less time to write. Require more time to run and more computer memory space Cannot access all components of the computer hardware such computer accessories. In that case we have to use lower level languages They require additional time during translation They are less efficient compared to the machine code languages.

Disadvantage

Page 30

ORGANIZATION OF COMPUTER SYSTEMS

3.3.2.

Application Software

Is software that is designed to perform tasks for the specific area or areas. But for use in more than one installation. Are usually called application packages as they may include a number of programs along with operating instruction, documentation and so forth. Depending on their function or task they are categorized in to the following. 1. Word Processors/ Word processing is a computerized typewriter which permits the electronic creation, editing, formatting, filing and printing text. Is the most common application of microcomputers. Until recently, word processing could be done only dedicated word processors. A dedicated word processor is a computer that denies its users the opportunity to execute any other program. Example: WordStar, WordPerfect, Microsoft word 2. Spreadsheet is an electronic worksheet display on the VDU. Until recently, financial analysis and other mathematical calculation were done by entering numbers on pages of an accountants ruled ledger pad. You can quickly create a model of a situation on a spreadsheet by entering labels, numbers & formulas. Using the programs built-in function you can perform complicated calculations such as net percent value, internal rates of return, and monthly payments on a loan. Example: Lotus 1-2-3, Microsoft Excel, Quatropro 3. Database management system. Allow you to store information on a computer, retrieve it when you need it and update it when necessary. You can do this with index cards, but database management programs do them more quickly and easily. Example: You can store large mailing list, inventory record or billing and

Page 31

ORGANIZATION OF COMPUTER SYSTEMS


collect information in lists stored in files and manipulate this information, one file at a time with database management program. You can record or create a database about employee information as Name, sex,Marital status, salary, Date of Birth, Date of employment, Post, Department, Level of education, Field of study, etc. Then you can ask the computer the following question How many female workers are there? List employees with a salary of birr 500 and above List those employees who are department head and have Bachelor degree or higher and so on. Example: Dbase IV, FoxPro, Microsoft Access.

Page 32

DATA REPRESENTATION IN COMPUTERS

CHAPTER FOUR

4.1 Units of Data Representation


We enter data into a computer or review (see) output data from a computer using the letter of alphabet, various special symbols, and the numerals in the decimal number system. But since computer is an electronic device, which understands electrical flow (signal), there is no letter, symbol or number inside the computer. Computer works with binary numbers. As a semiconductor is conducting or isnt conducting; a switch is closed or opened. So data are represented in the form of a code that can have a corresponding electrical signal. When data is stored, processed or communicated within the computer system, it is packed in units. Arranged from the smallest to the largest, the units are called bit, byte, and word; These units are based on the binary number system. BIT: x x x Bits are the smallest units and can convey only two possible states 0 or 1; Bit stands for Binary digits; A bit is a single element in the computer, on a disk that stands for either ON indicating 1 or OFF indicating 0;

In the computer ON is represented by the existence of current and OFF is represented by the non-existence of current. On a magnetic disk, the same information is stored by changing the polarity of magnetized particles on the disks surface. BYTE: Bits can be organized into large units to make them represent more and

1 of 22

meaningful information. This large unit is called a byte and is the basic unit of data representation in a computer system. The commonly used byte contains 8 bits. Since each bit has two states and there are 8 bits in a byte, the total amount of data that can be represented using a single byte is 28 or 256 possible combinations. Each byte can represent a character (a character is either a letter, a number or a special symbol such as +,-,?,*, $, etc). A byte is then used as a unit of measurement in the computer memory, processing unit, external storage and during communication. If the computer memory is 524288 byte, this is expressed in short by saying 512KB, where KB stands for kilobyte. WORD: Word refers the number of bits that a computer process at a time or a transmission media transmits at a time. Although bytes can store or transmit information, the process can even be faster if more than one byte is processed at a once. A combination of bytes, then form a word. A word can contain one, two, three or four bytes based on the capacity of the computer. Word length is usually given in bits. We say that a computer is an 8-bit, a 16 bit, a 32 bit or a 64 bit computer to indicate that the amount of data it can process at a time. The larger the word length a computer has the more powerful and faster it is. 4.2 Concept of Number Systems and Binary Arithmetic Since the early days of human civilization, people have been using their fingers, sticks, and other things for counting. As daily activities became more complex, numbers became more important in trade, time, distance, and in all spheres of human life. A number system defines a set of values used to represent quantity. There are various number systems e.g. decimal, binary, octal, hexadecimal, etc 1 Kilobyte (1KB) is 210 or 1024 bytes 1 Megabyte (MB) is 220 bytes or 210 kilobytes 1 Gigabyte (GB) is 230 bytes or 220 kilobytes or 210 megabytes

DATA REPRESENTATION IN COMPUTERS

2 of 22

each differs one another by the number of symbols used in the system. Each numbering system used different symbols to represent a given quantity.For a computer, everything is a number whether it may be numbers, alphabets, punctuation marks, its own instructions, etc. The number systems that are generally used by computers are: decimal, binary, octal, and hexadecimal. 4.2.1 The Decimal Number System The primary number system used is a base ten number system or decimal number system. The Decimal number system is based on the ten different digits or symbols (0,1,2,3,4,5,6,7,8,9). Starting at the decimal point and moving to the left, each position is represented by the base (radix) value (10 for decimal) raised to power. The power starts at Zero for the position just to the left of the decimal point. The power incremented for each positions that continues to the left. Moving to the right of the decimal point is just like moving to the left except that we will need to place a minus sign in front of each power. For example: (8762)10 = (8*103) + (7*102) + (6*101) + (2*100) (0.475)10= (4*10-1) + (7*10-2) + (5*10-3)

DATA REPRESENTATION IN COMPUTERS

4.2.2 The Binary number system Computers do not use the ten digits of the decimal system for counting and arithmetic. Their internal structure (mainly the CPU and memory) are made up of millions of tiny switches that can be either in an ON or OFF states. Two digits, 0 and 1, are used to refer for these two states. Binary number system is based on the two different digits; 0 and 1. With binary number system, it is very easier for the hardware to represent the data. Binary number system is base two number system. For example: (01100)2 , (10110.011)2 , etc

3 of 22

4.2.3 Octal number system 8 system.

DATA REPRESENTATION IN COMPUTERS

The octal number system with its eight symbols (0, 1, 2, 3, 4, 5, 6, 7) is a base

For example: (322)8, (10.25)8, etc 4.2.4 Hex adecimal number system Hexadecimal number system is another number system that works exactly like the decimal and binary number systems, except that the base is 16. It uses 16 symbols (0-9, and A-F characters to represent 10-15). For example: (8F0)16 , (D.45)16, etc 4.2.5 Conversion between Number Systems Computers use binary numbers for internal data representation whereas they use decimal numbers externally. Therefore, there should be some conversion between number systems in order to represent data in a computer that is originally represented in other number systems. Some conversion methods are discussed below. Decimal to Binary It is important to note that every decimal number system has its equivalent binary number. For example:

Binary 0 01 10 11 100

Decimal 0 1 2 3 4

Binary 101 110 111 1000 1001

Decimal 5 6 7 8 9 etc.

Conversion from binary to its equivalent decimal and from decimal to its equivalent binary is possible. The method, which is used for the conversion of decimal into binary, is often called as the remainder method. This method involves the following steps. Begin by dividing the decimal number by 2 (the base of binary number system) 4 of 22

Note the remainder separately as the rightmost digit of the binary equivalent Continually repeat the process of dividing by 2 until quotient is zero and keep writing the remainders after each step of division (these remainders will either be 0 or 1) Finally, when no more division can occur, write down the remainders in reverse order (last remainder written first)

DATA REPRESENTATION IN COMPUTERS

Example: Determine the binary equivalent of (44)10 2 2 2 2 2 2 44 22 11 5 2 1 1 Remainder 0 0 1 1 0 LSB (List Significant Bit) MSB (Most Significant Bit)

Taking the remainder in reverse order we have 101100. Thus the binary equivalent of (44)10 is (101100)2 In general to convert a decimal number X to a number in base M, divide X by M, store the remainder, again divide the quotient by M, store the remainder, and continue until the quotient is 0. And concatenate (collect) the remainders starting from the last up to the first. Example: Convert 7810 to base eight (Octal) 7810=1168 Example: Convert 3010 to base sixteen (hexadecimal) 3010=1E16

Binary to Decimal
In the binary to decimal conversion, each digit of the binary number is multiplied by its weighted position, and each of the weighted values is added together to get the decimal number. Example: Determine the decimal equivalent of (100100)2 1*25 + 0*24 + 0*23 + 1*22 + 0*21 +0*20 = 32+4 =36 5 of 22

Therefore, the decimal equivalent of (100100)2 is 36 simply expand the number with base m. That is

DATA REPRESENTATION IN COMPUTERS

In general To convert a number X consists of digits X1 X2 X3 Xn in base m to decimal;

(X1X2X3Xn) m =X1*mn-1+X2*mn-2 +X3*mn-3+...+ Xi*mn-i+ Xn-1m1+Xn*m0


=Y10 Example: convert (234)8 to decimal =2*82 + 3*81 + 4*80 = 128+24+4 = 156 Example: convert (A1B) 16 to decimal =A*162 + 1*161 + B*160 = 2587

Binary (base2) to Octal (base 8) or hexadecimal (base16) and vice versa


To convert a number in binary to octal group three binary digits together starting from the last digit (right) and if there are no enough digits add zeros to the front end (left) and find the corresponding Octal of each group. Example: Convert 1001001 to octal 1001001=001,001,001 = 1118 Convert 101101001 to octal 101101001 =101,101,001 =5518

To convert binary to hexadecimal group four binary digits together starting from right and if there are no enough digits add zeros at the left. Example: hexadecimal 111100100 =0001 1110 =1 =1 14 E 0100 4 4 = (1E4)16 To convert from Octal to binary, convert each octal digit to its equivalent 3 bit binary starting from right. Example: Convert (675) eight to binary 675eight =110 111 101 =(110111101)two Convert 231eight to binary 231eight = 010 011 001 =(10011001)two Convert 111100100 to Convert 111001111 to Hexadecimal 111001111 =0001 1100 1111 =1 =1 12 B 15 F

=(1BF)16

6 of 22

To convert from Hexadecimal to binary convert each hex. Digit to its equivalent 4-bit binary starting from right. Example: Convert 23416 to binary 23416 =0010 0011 0100 = 10001101002 Convert 2AC to binary 2AC16 =0010 1010 1100 =10101011002

DATA REPRESENTATION IN COMPUTERS

Octal to hexadecimal and Vise versa


To convert from Octal to hexadecimal, first we have to convert to binary and the binary to hexadecimal. To convert from hexadecimal to Octal, first we have to convert to binary and then the binary to Octal. Example: Convert 2358 to hexadecimal 2388=010 011 101 =0000 1001 1101 =0 =9D16 9 13 Convert (1A)16 to Octal 1A=0001 1010 =000 011 010 = 0 =328 3 2

Summary of conversion from One base to another base


From base 2 10 2 8 2 16 8 10 16 10 8 16 To base 10 2 8 2 16 2 10 8 10 16 16 8 Method Expand binary number in powers of 2 Factor the decimal number by 2 Group 3 binary digits together Each Octal digit is converted to 3 binary digits Group 4 binary digits together Each hexadecimal digit is converted to 4 binary digits Expand the number in powers of 8 Factor the decimal number by 8 Expand the number in powers of 16 Factor the decimal number by 16 Go from 8 .2.16 Go from 16 .2.8

7 of 22

DATA REPRESENTATION IN COMPUTERS


Converting Decimal Number with Fractions to Binary
First change the integer part to its equivalent binary. Multiply the fractional part by 2 and take out the integer value, and again multiply the fractional part of the result by 2 and take out the integer part, continue this until the product is 0. Collect the integer values from top to bottom & concatenate with the integer part. A) Convert 12.2510 to binary 1100.01 11.0011 B) Convert3.1875 to binary Example.

Converting Binary with Fraction to Decimal


To convert a binary number Y1Y2Y3Y4Yn.d1d2d3dm to decimal first convert the integer part to decimal by using Convert the fractional part to decimal by using Then decimal equivalence of y1 y2 y3 y4..yn.d1d2dm will be Q+R where Q is the integer part and R is the fractional part. Ex1 : Convert 11001-0101 to decimal 11001 0101 = 1x24 + 1x23 +0x22+0x21+1x20= 16+8+1= 25= Q =0x2-1+1x2-2+0x2-3+1x2-4 = 0++0+1/16 = 0.3125 = R =>11001.0101 = 25.3125. Ex 2: Convert 1000.1 to decimal 1000 = 1+23 +0+0+0=8 1= 1x2-1= = 0.5 1000.1 = 8.510 y1 y2 y3 y4yn= y1*2n-1+y2*2n-2+.yj*2n-j+.+yn-1*21+yn*20=Q and

d1d2d3dm=d1*2-1+d2*2-2+d3*2-3++dj*2-j+..+dm*2-m=R
-

Conversion from Binary with Fraction to Octal/Hexadecimal


i Group three/four digits together starting from the last digit of the integer part, and if there is less number of digits add some zeros in the beginning. i Group three/ four digits together starting from the first digit of the fractional part, and if there is less number of digits add some zeros to the end.

8 of 22

i Covert each group of the integer and the fractional part to their equivalent Octal/hexadecimal and collect the results by adding point (.) to separate the integer part from the fractional part. Ex 1:- Covert 1010.01112 to octal Ex2:- Covert 1110101.101112 to hexadecimal

DATA REPRESENTATION IN COMPUTERS

Conversion from Octal or Hexadecimal with Fraction to Binary


i Convert each Octal/hexadecimal digit to its equivalent 3/4-bit binary digit. i Collect the binary sequences by separating the integer part binaries from the fractional part binaries with point (.)

Conversion from Octal with Fraction to Hexadecimal


i To convert from Octal to hexadecimal, first convert the Octal to binary and then the binary to hexadecimal

Conversion from Hexadecimal with Fraction to Octal


i To convert from hexadecimal to Octal, first convert the hexadecimal to binary and then the binary to Octal.

Conversion from Octal/Hexadecimal with Fraction to Decimal.


i To convert from Octal/hexadecimal to decimal, first convert to binary and then the binary to decimal. 4.2.6 Binary Arithmetic Arithmetic in binary is much like arithmetic in other numeral systems. Addition, subtraction, multiplication, and division can be performed on binary numerals. The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple: 0+0=0 0+1=1 1+0=1 1 + 1 = 10 (carry:1) Adding two "1" values produces the value "10" (spoken as "one-zero"), equivalent to the decimal value 2. This is similar to what happens in decimal when certain single-digit numbers are added together; if the result equals or exceeds the value of the radix (10), the digit to the left is incremented: e. g 5 + 5 = 10 , 7 + 9 = 16 .This is known as carrying in 9 of 22

most numeral systems. When the result of an addition exceeds the value of the radix, the procedure is to "carry the one" to the left, adding it to the next positional value. Carrying works the same way in binary:
1 1 1 1 1 (carried digits) 01101 +10111 ------------=100100

DATA REPRESENTATION IN COMPUTERS

In this example, two numerals are being added together: 011012 (13 decimal) and 101112 (23 decimal). The top row shows the carry bits used. Starting in the rightmost column, 1 + 1 = 102. The 1 is carried to the left, and the 0 is written at the bottom of the rightmost column. The second column from the right is added: 1 + 0 + 1 = 102 again; the 1 is carried, and 0 is written at the bottom. The third column: 1 + 1 + 1 = 112. This time, a 1 is carried, and a 1 is written in the bottom row. Proceeding like this gives the final answer 1001002 (36 decimal). Subtraction works in much the same way: 00=0 0 1 = 1 (with borrow) 10=1 11=0 One binary numeral can be subtracted from another as follows:
** * (starred columns are borrowed from) 100101 1011 ---------------=011010

The following steps are involved: First, for the least significant bit(the right most bit) , 1-1 is 0 For the next bit, 0-1 cannot be computed since the subtrahend is smaller than the minuend. Borrow 1 from the third bit to form the binary number 10 (decimal 2) and do the subtraction. The operation is 10-1=1 which in decimal number system is 2-1=1 10 of 22

For the third bit, since we borrowed 1 for the second bit, we have 0-0 that is 0 For the forth bit again, we cannot perform the subtraction. However the fifth bit in the minuend is zero, so we must borrow from the sixth bit. This makes the fifth bit 10 (decimal 2). Borrowing from the fifth bit makes it 1 and the fourth bit become 10 (decimal 2). Now the subtraction in binary is 10-1=1 which is the result of the fourth bit.

DATA REPRESENTATION IN COMPUTERS

For the fifth bit, we now have 1-0=1 Since we borrowed 1 from the sixth bit for the fourth bit, so for the sixth bit, the subtraction is 0-0=0

Multiplication in binary is similar to its decimal counterpart. Two numbers A and B can be multiplied by partial products: for each digit in B, the product of that digit in A is calculated and written on a new line, shifted leftward so that its rightmost digit lines up with the digit in B that was used. The sum of all these partial products gives the final result. Since there are only two digits in binary, there are only two possible outcomes of each partial multiplication:
x x

If the digit in B is 0, the partial product is also 0 If the digit in B is 1, the partial product is equal to A 1 0 1 1 (A) 1 0 1 0 (B) --------0 0 0 0 Corresponds to a zero in B

For example, the binary numbers 1011 and 1010 are multiplied as follows:

1011

Corresponds to a one in B

+ 0000 +1011 --------------=1101110 Binary Division is again similar to its decimal counterpart:
__________ 101 |11011

11 of 22

Here, the divisor is 1012, or 5 decimal, while the dividend is 110112, or 27 decimal. The procedure is the same as that of decimal long division; here, the divisor 1012 goes into the first three digits 1102 of the dividend one time, so a "1" is written on the top line. This result is multiplied by the divisor, and subtracted from the first three digits of the dividend; the next digit (a "1") is included to obtain a new three-digit sequence:
1 __________ 101 |11011 101 ----011

DATA REPRESENTATION IN COMPUTERS

The procedure is then repeated with the new sequence, continuing until the digits in the dividend have been exhausted:
101 __________ 101 |11011 101 ----011 000 ----111 101 ----10

Thus, the quotient of 110112 divided by 1012 is 1012, as shown on the top line, while the remainder, shown on the bottom line, is 102. In decimal, 27 divided by 5 is 5, with a remainder of 2.

4.3 CODING METHODS


In todays technology, the binary number system is used by the computer system to represent the data in the computer in understandable format. There are a lot of ways to represent, numeric, alphabetic, and special characters in computers internal storage area. It is possible to represent any of the character in our language in a way as a series of electrical switches in arranged manner. These switch arrangements can therefore be 12 of 22

coded as a series of equivalent arrangements of bits. In this way, every character can be represented by a combination of bits that is different from any other combination. There are different coding systems that convert one or more character sets into computer codes. Some are: EBCDIC, BCD, ASCII-7 & ASCII-8, Unicode, etc. In these encodings, binary coding schemes separate the characters, known as character set, in to zones. Zone groups characters together so as to make the coding scheme to decipher and the data easier to process. With in each zone, the individual characters are identified by digit code. EBCDIC: Pronounced as Eb-see-dick and stands for Extended Binary Coded Decimal Interchange Code. It is an 8-bit coding scheme: (00000000 11111111), i.e. it uses 8 bits to represent each character. It accommodates to code 28 or 256 different characters. This provides a unique code for each decimal value 0 to 9 , each upper and lower case English letter (for total of 52), and for a variety of special characters. Since it is an 8-bit code, each group of the eight bits makes up one alphabetic, numeric, or special character. It is a standard coding scheme for the large computers. Coding Examples EBCDIC Character 0-9 a-i j-r s-z A-I J-R S-Z zone (4 Bit) 15 8 9 10 12 13 14 digit (4 Bit) 0-9 1-9 1-9 2-9 1-9 1-9 2-9 a b A B 0 9 1000 1000 1100 1100 1111 1111 0001 0010 0001 0010 0000 1001 Character Zone Digit

DATA REPRESENTATION IN COMPUTERS

BCD (Binary Coded Decimal) There were two types of BCD coding techniques used before. The 4 bit BCD, which represent any digit of decimal number by four bits of binary numbers. If you want to represent 219 using 4 bit BCD you have to say 0010 0001 1001

13 of 22

i 4 bits BCD numbers are useful whenever decimal information is transferred into or out of a digital system. Examples of BCD systems are electronic ousters, digital voltmeter, and digital clocks; their circuits can work with BCD numbers. i BCDs are easy for conversion but slower for processing than binary. And they have limited numbers because with BCD we can represent only numbers 0000 for 0 and 1001 for 9 . BCD (6-bits) It uses 6-bits to code a Character (2 for zone bit and 4 for digit bit) it can represent 26 = 64 characters (10 digits, 26 capital characters and some other special characters). Some Coding Examples Character 0-9 A-I Character A Q 8 9 ASCII-7 ASCII stands for American Standard Code for Information Interchange. ASCII-7 used widely before the introduction of ASCII-8 (the Extended ASCII). It uses 7 bits to represent a character. With the seven bits, 27( or 128) different characters can be coded (0000000-1111111). It has 3 zone and 4 digit bits positions Coding examples: Charter 0-9 A-O P-Z zone (3 bit) 3 4 5 digit(4 bit) 0-9 1-15 1-10 $ % A a b 010 010 100 110 110 0100 0101 0001 0001 0010 Zone 11 10 00 00 zone (2 Bit) 0 3 digit(4 Bit) 0-9 1-9 digits 0001 1000 1000 1001

DATA REPRESENTATION IN COMPUTERS

14 of 22

The ASCII System

DATA REPRESENTATION IN COMPUTERS

Also referred as ASCII-8 or Extended ASCII. It is commonly used in the transmission of data through data communication and is used almost exclusively to represent data internally in microcomputers. ASCII uses 8-bits to represent alphanumeric characters (letters, digits and special symbols). With the 8-bits, ASCII can represent 28 or 256 different characters (00000000-11111111). It assigns 4 bits for the zone and the rest for the digit. Coding Examples: Character 0-9 A-O P-Z a-o p-z Unicode Unicode has started to replace ASCII and other coding methods at all levels. It enables users to handle not only practically any script and language used on this planet; it also supports a comprehensive set of mathematical and technical symbols to simplify scientific information exchange. Unicode provides a unique number for every character, no matter what the platform, no matter what the program, no matter what the language. Unicode was originally designed to be a 16-bit code, but it was extended so that currently code positions are expressed as integers in the hexadecimal range 0..10FFFF (decimal 0..1 114 111). zone (3 BIT) digit (4 BIT) 3 4 5 6 7 0-9 1-15 0-10 1-15 0-10 a b A B ? + 1 0110 0110 0100 0100 0011 0010 0011 0001 0010 0001 0010 1111 1011 0001

15 of 22

4.4 Representation of Negative Numbers and Arithmetic


I. Sign- magnitude representation.

DATA REPRESENTATION IN COMPUTERS

There are different ways of representing negative numbers in a computer. In signed binary representation, the left-most bit is used to indicate the sign of the number. Traditionally, 0 is used to denote a positive number and 1 is used to denote a negative number. But the magnitude part will be the same for the negative and positive values. For example, 11111111 represents-127 while, 01111111 represents + 127. We can now represent positive and negative numbers, but we have reduced the maximum magnitude of these numbers to 127. In a 5- bit representation we use the first bit for sign and the remaining 4- bits for the magnitude. So using this 5 bit representation the range of number that can be represented is from -15 (11111) to 15 (01111) Example 1: Represent-12 using 5-bits sign magnitude representation first we convert 12 to binary i. e 1100 Now -12 = 11100

Example 2: Represent 24 using 8-bits sign magnitude representation 24=00011000 -24 = 10011000 In general for n-bit sign magnitude representation the range of values that can be represented are (2 n-1-1 ) to (2 n-1-1). Note: In sign magnitude representation zero can be represented as 0 or -0 This representation has two problems one is it reduces the maximum size of magnitude, and the second one is speed efficiency to perform arithmetic and other operations. For sign magnitude representation, correct addition and subtraction are relatively complex, involving the comparison of signs and relative magnitude of the two numbers. The solution to this problem is called the complement representation. II. Ones Complement In ones complement representation, all positive integers are represented in their correct binary format. For example +3 is represented as usual by 00000011. However, its complement, -3, is obtained by complementing every bit in the original representation. Each 0 is transformed into a 1 and each 1 into a 0. In our example, the ones complement 16 of 22

representation of -3 is 11111100. Example: +2 is 00000010 -2 is 11111101

DATA REPRESENTATION IN COMPUTERS

Note that in this representation positive numbers start with a 0 on the left, and negative numbers start with a 1 on the left most bit. Example 1: add 3 and 3 with word size 4 3 = 0011 -3=1100 sum =1111 (=0) Ex2. Add -4 and +6 - 4 is 11111011 + 6 is 00000110 The sum is (1) 00000001 Where 1 indicates a carry. The correct result should be 2 or 00000010. In ones complement addition and subtraction, if there is an external carry it should be added to get the correct result. This indicates it requires additional circuitry for implementing this operation. III. Twos Complement Representation In twos complement representation, positive numbers are represented, as usual, in singed binary, just like in ones complement. The difference lies in the representation of negative numbers. A negative number represented in twos complement is obtained by first computing the ones complement and then add one. Example: +3 is represented in signed binary as 00000011 Its ones complement representation is 11111100. The twos complement is obtained by adding one. It is 11111101. Example: lets try addition. (3) 00000011 + (5) +00000101 (8) 0001000 The result is correct

17 of 22

Example: Lets try subtraction (3) 00000011 (-5) + 111111011 11111110

DATA REPRESENTATION IN COMPUTERS

Example : add +4 and -3(the subtraction is performed by adding the twos complement). +4 is 00000100 -3 is 111111101 The result is [1] 000000001 If we ignore the external carry the result is 00000001 ( i. e 1 In decimal). This is the correct result. In twos complement, it is possible to add or subtract signed numbers, regardless of the sign. Using the usual rules of binary addition, the result comes out correct, including the sign. The carry is ignored. Ones complement may be used, but if ones complement is used, special circuitry is required to correct the result. Carry and overflow Ex (128) 10000000 +(129) 10000001 [257]=(1) 00000001 Where 1 indicates a carry. The result requires a ninth bit (bit 8, since the right- most bit is 0). It is the carry bit. The twos complement representation has one anomaly not found with sign magnitude or ones complement. The bit pattern 1 followed by N-1 zeros is its own 2s complement. To maintain sign bit consistency, this bit pattern is assigned the value 2 for 8-bit word, -128 = 10000000 its 1s complement =01111111 +1 =100000000 = -128
N

for example,

18 of 22

Overflow will occur in four situations, including: 1. 2. 3. 4.

DATA REPRESENTATION IN COMPUTERS

The addition of large positive numbers. The addition of large negative numbers. The subtraction of a large positive number from a large negative numbers. The subtraction of a large negative number from a large positive number.

Overflow indicates that the result of an addition or subtraction requires more bits than are available in the standard 8-bit register used to contain the result. Fixed format representation: We now know how to represent signed integers: however, we have not yet resolved the problem of magnitude. If we want to represent large integers, we will need several bytes. In order to perform arithmetic operations efficiently, it is necessary to use a fixed number of bytes, rather than a variable number. Therefore, once the number of bytes is chosen, the maximum magnitude of the number that can be represented is fixed. Subtraction by Use of Complements. i Complements are mainly used for representing negative numbers and subtraction. i In performing binary subtraction or addition of negative number by use of binary complements only one procedure, addition, is needed as one can subtract by adding its complements. i To subtract any number, positive or negative, substitute the required complement for the numbers to be subtracted and then add. If the result is An (n+1)-bit number, and the arithmetic is in Ones complement the (n+1) carry. If it is in Twos complement discard the (n+1) th bit. An n-bit number and the arithmetic is in Ones complement, to read the binary value calculate the ones complement of the magnitude bits and place a minus sign in front of it. Twos complement, to read the binary value calculate the twos complement of the magnitude bits and place a minus sign in front of it.
th

bit, a

carry, is added to the right most bit of the result. This process is called an end-around

19 of 22

Example:

DATA REPRESENTATION IN COMPUTERS

Perform the following in ones and twos complements in 5-bits. A. 12-6 B. 6-12 C. -12-6 A = 12 B = 6, A = 01100 B = 00110 Ones complement of -A=10011 & -B=11001 Twos complement of - A= 10100 & -B= 11010 Example c: Is wrong this is because the occurrence of overflow. Arithmetic overflow is that part of the result of an operation which is lost because of the resulting value exceeds the capacity of the intended storage location.
x

Arithmetic overflow occurs when the sign bits of A and B are the same but the sign bit of the result is different.

4.5 Floating-point representation


In this representation decimal numbers are represented with a fixed length format. In order not to waste bits, the representation will normalize all the numbers. For example, 0.000123 wastes three zeroes on the left before non -zero digits. These zeroes have no meaning except to indicate the position of the Decimal point. Normalizing this number result in .123x10
-3

.123 is the normalized mantissa; -3 is the exponent.

We have

normalized this by eliminating all the meaningless zeroes to the left of the first non-zero digit and by adjusting the exponent. Example: 22.1 is normalized as .221x102. The general form of floating point representation is rMx10
rE

where M is the mantissa,

and E is the exponent. It can be seen that a normalized number is characterized by a mantissa less than 1 and greater than or equal to.1 all cases when the number is not zero. To represent floating numbers in the computer system it should be normalized after converting to binary number representation system. Example: 111.01 is normalized as .11101x23. The mantissa is 11101. The exponent is 3.

20 of 22

The general structure of floating point is

DATA REPRESENTATION IN COMPUTERS

Sign

Exponent

Mantissa (significand)

In representing a number in floating point we use 1 bit for sign, some bits for exponent and the remaining bit for mantissa. In floating point representation the exponent is represented by a biased exponent (Characteristics). Biased exponent = true exponent + excess 2 the exponent. Example: mantissa. First we have to change to normalized binary i. e 234 = 11100010 0.375= 0.011 234.375 = 11100010.011 = 0.11100010011x28 true exponent = 8 excess 2 n-1 = 2 7-1= 26= 64 Biased exponent = 8+26 =8+64 = 72 = (100 1000) 2 Therefore 234.375 is represented as 1 Sign mantissa. 34.25 = 100010.012 The normalized form of 34.25 = .10001001x 26 True exponent = 6 Excess 2 n-1 = 2 Biased exponent
7-1 n-1

, where n is the number of bits reserved for

Represent 234.375 in floating point using 7 bit for exponent and 16 bit for

1001000 7-bits

1110001001100000 16 bits

Example: Represent 34.25 in floating point using 7 bit for exponent and 24 bits for

= 6+2

=6+64=70

21 of 22

70 = 10001102 0 1000110

DATA REPRESENTATION IN COMPUTERS


100010010000..0

Therefore, 34.25 is represented as To represent a number in floating point: i Represent the number in normalized binary form. i Find the biased exponent i Change the biased exponent to binary i Write the sign, the exponent in the exponent part and the mantissa in the mantissa part i If there are fewer digits in the exponent add zeros to the left and for mantissa add zeros to the right.

Floating-point Arithmetic
To perform floating-point arithmetic: i First correct the numbers to binary with the same exponent (the highest) i Apply the operator on the mantissa and take one of the exponent i Normalize the result Example: Find 23.375 + 41.25 using 7-bit for exponent and 10 bit for mantissa. 23.375 = 10111.011 = 0.1011101x2 = 0.010111011x2 41.25 = 111001.01 = 0.11100101x26 23.37+41.25 = 0.01011101 x 26+0.1110010x26 = (0.010111011+0.11100101) x 26 = 0.1010000101x26
5 6

22 of 22

CHAPTER FIVE
Computer System Architecture
Objective:x To know the different layers of a computer system x To know the basic building blocks of computer and how they work

1.1 Hierarchical Structuring of a Computer System Architecture


Actually a computer system is composed of many layers of software and hardware. But for simplicity we see the computer in Abstract way. This avoids details and makes the user to concern about the outer layer that is easy for the user to communicate with the computer. Generally modern computers consist of multi-layers or levels. The following figure shows the different levels. 7 6 5 4 Language depends on application program Hide operational details of lower levels
Program can transfer from one to another comp. easily

Application level

Machine-independent programming language Assembly language

Software level

High-order languages level Assembly level Operating system level

Masks details of hardware from programmer and responsible for program creation, execution, access to I/O and access to a file Machine language Basic hardware component construction and their interaction Basic component for microprogramming Transistors, capacitors & resistors

3 2 Hardware part 1 0

Machine level

Micro programming level

Logic gate level

Device level

Fig. The level structure of a typical computer system

1.2 Logic gates (elements)


In the hierarchical structuring of a computer, the logic gate level is above the device level. These logical elements are primary components of the computer hardware. Given a desired function, Boolean algebra can be applied to develop a simplified implementation of that function using interconnection of logical gates. A gate is an electronic circuit that produces an output signal that is a simple Boolean operation on its input signals. The basic gates used in digital logic are AND, OR, NOT, NAND, and NOR. We have also XOR gate for defining Boolean algebra with other gates. Each gate is defined in three ways: graphical symbols, algebraic notation, and truth table. A truth table is a table that shows the output of a logical function for all possible combinations of input values. Each gate has one or two or more inputs and only one-output signals. The signals are either 0 or 1. When the values at the input are changed, the correct output signal appear almost instantaneously, delayed by the propagation time of signals through the gate (known as gate delay) 1. NOT gate: The NOT gate performs a basic logic function called inversion or complementation. The purpose of this gate to change one logic level (HIGH/LOW) to the opposite logic level. X Algebraic notation: Logic symbol of NOT gate: Truth table of NOT gate: X 1 0 X 0 1

2. OR gate: The OR gate is composed of two or more inputs and a single output and performs Logical addition. The logical operation of the OR gate is such that the output is HIGH (1) when any of the inputs are HIGH; otherwise it is LOW (0).A plus (+) is used to show the OR operation. In other words, the OR gate is an electronic circuit that gives a high output if one or more of its inputs are high.

Algebraic notation: X+Y Logic symbol of OR gate:

X Y Z=X +Y

Truth table of OR gate: x 0 0 1 1 Y 0 1 0 1 Z=x +y 0 1 1 1

3. AND gate: The AND gate is composed of two or more inputs and a single output and performs logical multiplication. The logical operation of the AND gate is such that the output is HIGH (1) when all the input are HIGH, otherwise it is LOW (0). A dot (.) is used to show the AND operation. Algebraic notation: X.Y Logic symbol of AND gate: x 0 0 1 1 Combination of logic gates Using combination of logic gates, complex operation can be performed. Some basic combinations of gates include: i NAND gate i NOR gate i Exclusive-OR(XOR) i Exclusive-NOR(XNOR) Y 0 1 0 1 Z= x.y 0 0 0 1

NAND gate The NAND gate is formed by the combination of NOT-AND and implies and AND function with an inverted output. The logical operation of the NAND gate is such that the output is LOW (0) only when all the inputs are HIGH (1). Algebraic notation: (X.Y) Logic symbol of AND gate:

X (X.Y) Y Truth table for NAND gate x 0 0 1 1 Y 0 1 0 1 Z= (x.y) 1 1 1 0

NOR gate The NOR gate is formed by the combination of NOT-OR implies and OR function with an inverted output. The logical operation of the NOR gate is such that the output is HIGH (1) only when all the inputs are LOW (0). Algebraic notation: (X+Y) Logic symbol of NOR gate: X Y Z= (X+Y)

Truth table for NOR gate X 0 0 1 1 Y 0 1 0 1 Z= (x+y) 1 0 0 0

Exclusive-OR (XOR) gate: This gate is usually formed from the combination of the other logic gates. The exclusive-OR is an inequality function and the output is HIGH (1), when the inputs are not equal to each other. Algebraic notation: (X + Y) Logic symbol of XOR gate: Truth table for XOR gate x 0 0 1 1 Y Z 0 1 0 1 0 1 1 0

Exclusive-NOR (XNOR) gate: This gate is usually formed from the combination of the other logic gates. The exclusive-NOR is an equality function and the output is HIGH (1), when the inputs are equal to each other. Algebraic notation: (X . Y) Logic symbol of XNOR gate

Truth table for XNOR gate x 0 0 1 1 Note: 1. X + Y= X.Y + X.Y 2. X . Y= X.Y + X.Y Y Z 0 1 0 1 1 0 0 1

Typically, not all gates are used in implementation. Design and fabrication are simpler if only one or two types of gates are used. Thus it is important to identify functionally complete set of gates. This means that Boolean function can be implemented using only the gates in the set. AND, OR and NOT gates constitute functionally complete set because they represent the three operation of Boolean algebra. If there are any functionally complete sets of gates, they should synthesize these sets of Boolean operators. List of functionally complete set of gates: AND, OR, NOT AND, NOT OR, NOT NAND NOR It is preferable to construct circuitry system using only NAND or NOR gates. EXERCISES: 1. Show that, all these are functionally complete set of gates. 2. Construct XOR gate using only NAND gate. 3. Construct XOR gate using only NOR gate.

1.3 Boolean algebra


The digital circuitry in digital computers and other digital systems is designed, and its behavior is analyzed, with the use of mathematical discipline known as Boolean algebra. The name is in honor of an English mathematician George Boole, who proposed the basic principles of this algebra in 1854. This Boolean algebra becomes very convenient in two areas: Analysis: It is an economical way of describing the function of digital circuitry. Design: given a desired function, Boolean algebra can be applied to develop a simplified implementation that function. As any algebra, it makes use of logical variables, which will have a value true or false (1 or 0), and logical operations. A Boolean function is described as follows: F: X Y where X and Y are set of 0s and 1s

A Boolean function with n input variables could operate on 2n possible combinations. There are 3 basic Boolean operators NOT, AND, OR (-, .,+) Complex logic circuits can be constructed using the basic logic circuits. Any logic circuit can be represented by a Boolean function and vice versa. Generally, before constructing any logical circuit, it has to be simplified based on the rules of Boolean equations in order to minimize the number of required logical gates.

Rules of the Boolean (Equation) Operators


x. x = x x. x = 0 x. 1 =x x(x +y)=x x .y = y .x (x .y) .z =x.(y. z) A( +B) = AB x.(y +z) = x. y + x. z x .y = x + y X =x A + AB = A x+x=x x + x=1 x + 0 =x x + x .y = x x+y=y+x (x + y) + z = x + (y + z) A + B = A + B (x +y) (x + z) =x + y z x + y = x. y x =x A(A +B)= A Idempotent Inverse Identity Absorbtion Commutative Associative Absorbition Distributive DeMorgans Double Negative

To construct the logic circuit of a Boolean equation, first we have to simplify the Boolean function using the rules of the operators (theorems) Even though we have different types of gates for construction we use some basic gates, and the rest can be constructed using the basic gates. The NAND or NOR gates can be used to construct the other gates. The NOT using NAND X AND using NAND X X.Y X

OR using NAND X X+Y

Y The NOT using NOR X AND using NOR X X.Y X

OR using NOR X Y X+Y

The XOR can be derived from the AND, NOT and OR operations i. e x + y = x. y + x. y (draw the circuit)

1.4 Construction of Logical Circuit from Logical Function and Truth Table
Any Boolean function can be implemented in electronic form as a network of gates. If you have the truth table you can generate the Boolean function and you can also use the Boolean function to construct the logical circuit. The reverse is also possible.

1.4.1 Construction of Logical Circuit from Logical Function


To construct the logic circuit of a Boolean equation first we have to simplify the Boolean function using the rules of the operators (theorems) Example: Construct the logic circuit of: F = ABC + ABC + ABC

Algebraic Simplification Algebraic simplification involves the application of the identities to reduce the Boolean expression to one with fewer elements. 9

Example: Simplify: 1. F = ABC + ABC + ABC Sol: F = ABC + ABC + ABC = AB(C+C) + ABC = AB(1) + ABC
= AB + ABC Distributive property Complement property Identity property Distributive property

= B(A + AC) = B(A + C)

Absorbtion property

Fig. Simplified implementation of F 2. F=ABC + ABC + ABC + ABC Soln: F= ABC + ABC + ABC + ABC = ABC + ABC + AB(C +C) = ABC + ABC + AB(1) = ABC + ABC + AB Distributive property Complement property Identity property

Ex: Draw circuit diagram for the reduced function F.

1.4.2 Construction Boolean of Function/Logic Circuit from Truth Table


Minterms and Maxterms Any boolean expression may be expressed in terms of either minterms or maxterms. To do this we must first define the concept of a literal. A literal is a single variable within a term which may or may not be complemented. For an expression with N variables, minterms and maxterms are defined as follows: Minterms For a Boolean function of n variables , a product term in which each of the n variables appears once (in either its complemented or un-complemented form) is called

10

a minterm. Thus, a minterm is a logical expression of n variables that employs only the complement operator and the conjunction operator. There are 2n minterms of n variables, since a variable in the minterm expression can be in either its direct or its complemented form--two choices per n variables. In general, one assigns each minterm an index based on a conventional binary encoding of the complementation pattern of the variables. This convention assigns the value 1 to the direct form (xi) and 0 to the complemented form (x'i). For example, we assign the index 6 to the minterm abc' (110) and denote that minterm as m6. Similarly, m0 of the same three variables is a'b'c' (000), and m7 is abc (111).
x

A minterm is the product of N distinct literals which results in 1 where each literal occurs exactly once.

Maxterms For a Boolean function of n variables , a sum term in which each of the n variables appears once (in either its complemented or un-complemented form) is called a maxterm. Thus, a maxterm is a logical expression of n variables that employs only the complement operator and the disjunction operator. Instead of using ANDs and complements, we use ORs and complements and proceed similarly. For example, the following are two of the eight maxterms of three variables: a + b' + c a' + b + c There are again 2n maxterms of n variables, since a variable in the maxterm expression can also be in either its direct or its complemented form--two choices per n variables. Each maxterm is assigned an index based on the opposite conventional binary encoding used for minterms. The maxterm convention assigns the value 0 to the direct form (xi) and 1 to the complemented form (x'i). For example, we assign the index 6 to the maxterm a' + b' + c (110) and denote that maxterm as M6. Similarly M0 of these three variables is a + b + c (000) and M7 is a' + b' + c' (111).
x

A maxterm is the sum of N distinct literals results in 0 where each literal occurs exactly once.

11

For a two-variable expression, the minterms and maxterms are as follows X Y Minterm Maxterm 0 0 X'.Y' X+Y 0 1 X'.Y X+Y' 1 0 X.Y' X'+Y 1 1 X.Y X'+Y' For a three-variable expression, the minterms and maxterms are as follows X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1 Minterm X'.Y'.Z' X'.Y'.Z X'.Y.Z' X'.Y.Z X.Y'.Z' X.Y'.Z X.Y.Z' X.Y.Z Maxterm X+Y+Z X+Y+Z' X+Y'+Z X+Y'+Z' X'+Y+Z X'+Y+Z' X'+Y'+Z X'+Y'+Z'

This allows us to represent expressions in either Sum of Products or Product of Sums forms I. SOP (Sum of Product method) It expresses that the output is 1 if any of the input combinations that produce 1 is true. i.e. Insert a column for the inverse of all the variables Find the rows with functional value 1 and variable value one then use them as an input for an AND operator Connect each of them using the OR gate. II. POS (Product of Sum) It expresses that the output is 1 if none of the input combinations that produce 0 is 1. i.e. Insert a column for the inverse of all the variables Find the rows with functional value 0 and variable value 0 then use them as an input for an OR operator Connect each of them using the AND gate.

12

Example
Construct the Boolean function for the following truth table: Row# 1 2 3 4 5 6 7 8 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F 0 0 1 1 0 0 1 0 ABC A+B+C ABC ABC A+B+C A+B+C MinTerm MaxTerm A+B+C A+B+C

SOP considers row 3, 4, and 7 with out put equals 1 F(A,B,C) = A B C + ABC +ABC POS considers row 1, 2,5,6,8 F (A, B, C) = (A+B+C) (A+B+C) (A+B+C) (A+B+C) (A+ B+ C ) To construct the logic circuit first simplify the given Boolean function and construct the network as required using the Boolean function. Exercise: which method SOP or POS require less number of logical gate to construct logic circuit?

13

1.5 Types of Circuit


There are two types of circuits in designing logical circuits: Combinational circuits and sequential circuits. Combinational circuits are circuits that constitute interconnection of sets of gates whose output at any time is a function of only the input at that time. In general terms, a combinational circuit consists of n binary inputs and m binary outputs. Combinational circuits implement the essential functions of a digital computer. However, except for the special case ROM, they provide no memory or state information. Examples: ADDER, ROM, PLA (Programmable Logic Array), Decoder, Multiplexers, etc. Sequential circuits are circuits which are designed to have a memory or state information (i.e. the current out put of sequential circuit depends on the current input and the current state of that circuit). Examples: Flip-Flop, Registers, Counters, etc.

1.5.1 Adders (Half Adder and Full Adder)


I. Half adders The simplest form of electronic binary arithmetic is performed in a half adder circuit. A half adder circuit adds 2 bits and generates sum and carry output bits. The half adder is an example of a simple, functional digital circuit built from two logic gates. The half adder adds two one-bit binary numbers (AB). The output is the sum of the two bits (S) and the carry (C). Binary addition differs from Boolean algebra in that the result includes a carry term. A 0 0 1 1 S= AB + AB= A + Co = AB carry output B 0 1 0 1 S 0 1 1 0 Co 0 0 0 1

B sum output

14

The digital circuit of a half adder is shown below: A B S

Co

II. Full-Adders We are not interested in performing addition on just a single pair of bits. Rather we wish to add two n bit numbers. This can be done, by putting together a set of adders so that the carry from one adder is provided as input to the next. The circuitry that can perform complete binary addition is called full adder. It accepts three separate inputs bits, the two bits to be added and a carry in. A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Ci 0 1 0 1 0 1 0 1 Carry 0 0 0 1 0 1 1 1 Sum 0 1 1 0 1 0 0 1

Sum = ABCi+ ABCi + ABCi +ABCi Carry = AB + AC + BC

15

Construct the logic circuit for Sum and Carry of full adder

Fig. Implementation of Full Adder Exercise Construct a binary adder of 4-bits Eg. 1001 1011 10100 A3A2A1A0 B3B2B1A0 C4S3S2S1S0

Fig: Bit Adder

16

Flip Flops
Combinational circuits implement the essential functions of a digital computer. However, except for the special case of ROM, they provide no memory or state information. To store state information, a more complex form of digital circuit is used: the sequential circuit. The current output of a sequential circuit depends not only on the current input, but also on the past history of inputs. The current output of a sequential circuit depends on the current input and the current state of that circuit. The simplest form of sequential circuit is the flip-flop. There are a variety of flip-flops, all of which share two properties: A flip-flop is a bi-stable device. It exists in one of two states, and in the absence of input remains in that state. Thus, the flip-flop can function as a 1-bit memory. The flip-flop has two outputs, which are always the complements of each other. These are generally labeled Q and Q. Flip flops are the building blocks of sequential circuits. They are used to construct memories and registers. There are different types of flip flops. The simplest flip flop is the SR-latch (S-set and R-Reset) type of the SR-latch can store 1-bit of information. The S-R Latch The figure below shows configuration known as the S-R flip-flop or S-R latch. The circuit has two inputs, S (Set) and R (Reset), and two outputs, Q and Q and consists of two NOR gates hooked together in a feedback arrangement. Set-sets to one Reset-sets to zero RS latch using NOR

Fig. S-R Latch Logic Diagram Implemented with NOR Gates

17

S Q Q S Q Fig. S-R Latch Block Diagram. Table a): Characteristics table Current inputs S 0 0 0 0 1 1 1 1 R 0 0 1 1 0 0 1 1 Qn 0 1 0 1 0 1 0 1 Qn+1 0 1 0 0 1 1 Comment Previous output is stored Previous output is stored Reset Reset Set Set Must be prevented Must be prevented Current state Next State

Table b): Simplified characteristics table R 0 0 1 1 S 0 1 0 1 Q NC 1 0 *

From the truth table we can see that when R= S= 0, Q = NC .That means there will not be any change that can occur in the output. That is the circuit remains latched in the last state. When R= 0 and S = 1, the circuit sets the Q output to 1. On the other hand, if R= 1 and S= 0 the Q output resets to 0. R= S=1 is never used because it leads to unpredictable operation.

18

CHAPTER SIX
Data Communications and Computer Networks
Objective: To know basic component used in data transmission To know, what a computer network is and different protocols of networks To know what is Internet and what services the Internet has

Basics of Data Communication


Data communication: is the process of sharing ideas, information and messages with others in a particular time and place. It is exchange of data between two or more parties. It includes : o Writing and talking o Nonverbal communication (such as facial expressions, body language or gestures) o Visual communication (the use of images of pictures such as painting, photography, video or film) o Electronic Communication o Such as telephone calls, electronic mail, cable television, satellite broadcasts.

Data Transmission
The need of information has increased from time to time. This leads to the need of sharing of information among different agents (individual), which may be at different places or locations. Data communication is the exchange of information between two agents. For exchange of information, the information should be transmitted from one point to another through a transmission media called Channel. The following figure shows the different components of data communication. Agent Input 1 device 2
Transmi tter

Transmiss ion medium

Receiver

Output device

1|Page

Source System 1. Input information (m) 2. Input data q or signal q(t) 3. Transmitted signal s(t) 4. Received signal r(t) 5. Output data q or signal q (t) 6. Out put information m

Destination system

Information is transmitted in a form of packets. The information is divided into packets and one packet is transmitted at a time. When a packet of information is transmitted the sender must be sure that the receiver receives the information and the receiver must check that it receives correct information. The information is transmitted successfully the receiver must send an acknowledgment to the sender.

Mode of transmission
The transmission medium may be physical (it connects the transmitter and receivers through wire) or logical (There are different mode of transmission) Simplex transmission: In this transmission, signals are transmitted in only one direction: One station is transmitter and the other is receiver. Half-duplex transmission In this transmission signals are transmitted in both directions, both stations may transmit, but only one at a time. Full-duplex transmission In this transmission signals transmitted in both directions, both stations may transmit simultaneously. The medium carries signals in both directions at the same time.

Data Transmission Channels


A channel is a medium that carries a signal from the transmitter to the receiver. The range of frequencies that can be transmitted over a transmission medium is called band Width of a channel. The rate of data transmission is directly proportional to the band width.
2|Page

There are three types of data transmission channels:A. Narrow-band:-It is the smaller band and has slow data transmission rate. E.g. telegraph line. B. Voice- band: It is the wider band and has better data transmission rate than the narrow band. Ex telephone lines are used for voice-band channel. C. Broad-band: - It is the widest band and has used to transmit large volume of data with high speed. Ex. (Oxide cable such as TV aerial lead), circuits, communications sate bites and optical fibers are used for broad band channels. Information is transmitted in the form of analog or digital. Most communication lines are designed to carry analog signals. Digital transmissions are used for telecommunications. Therefore, technique must be used to represent a digital signal in analog carrier. The process of modifying the carrier signal to transmit digital information is called Modulation. When the transmitted signal is received, the information must be reconverted into digital data. handled by a device called a modem, an acronym for modulator and demodulator. This process is called Demodulation .These conversions between digital data and analog data are

Types of signals
In communication system, data is transmitted from one point to another by means of electrical signal. There are two types of signals that can travel over the various transmission media. 1. Analog Signal: Continuously varying electromagnetic waves that may be propagated over a variety of media. For example, Wire media, twisted pair and coaxial cable. 2. Digital Signals Normally, it comprises only two states. It uses separate ON/OFF pulses that create a square rather than a continuous wave. Are considered as sequence of voltage pulses that may be transmitted over a wire medium. Transmits data faster and more accurately than analog signals.
3|Page

For example, a constant positive voltage level may represent binary 1 and a constant negative voltage level may represent binary 0.

Computer Networks
It is a collection of computers and peripheral devices connected by communication links that allow the network components to work together.

Importance of Networking
1. Resource sharing ( To share hardware such as the server To share computer CPU and hard disk) 2. To share databases 3. To share application programs 4. To undertake parallel processing 5. High reliability by having alternative sources of supply. 6. Money saving 7. Increase system performance. 8. Powerful communication medium among widely separated people.

Hardware requirements of a computer network


1. Computers - A minimum of two computers is required to establish a computer network. 2. Network Interface Card/Network Adapter Card It is an expansion card that physically connects a computer to the network. Each computer in the network must have a network card. It takes the data from the computers internal bus and converts it into standard packets of information that it then sends along the cable. It takes the data from the computer and adds header. When receiving data, it looks at each packet and checks the destination address in the header. If it recognizes its own address, it checks that it has no errors and signals the CPU that there is data to be processed. 3. Cables
4|Page

Cables are used to physically connect the computers on the network Types of cables i. Co-axial cables ii. Twisted Pair Cables iii. Fiber Optics

4. Modem- Modulator/Demodulator It lets computers exchange information though telephone lines. When transmitting information, the modulator changes the computers digital signal to analog signal. When receiving information, the demodulator translates the analog signal Back to a digital signal. Modulator Digital to Analog Demodulator Analog to Digital Terms used in computer networking 1. Server Computers that provide shared resources to network users. 2. Clients- Computers that access shred network resources provided by a server. 3. Media The wires that make the physical connections 4. Shared data- Files provided to clients by servers across the network. 5. Shared printers and other peripherals Additional resources provided by the server 6. Resources- Any service or device, such as files, printers or other items.

Types of Networks
Based on geographical span of coverage, computer networks are broadly classified into three major categories. 1. Local Area Network (LAN) x x x x Computers are connected close together to each other with in the same local area ( ex. building, office, school ,Lab ) computers are connected directly on-premises -usually through wiring and sometimes with infrared signals (similar to your TV remote control) or low-powered radio signals It is the basic building block of any computer network. It is confined in a limited geographical area.

5|Page

Characteristics of LAN: 1. Physically limited 2. High bandwidth 3. Inexpensive cable media (Co-axial or twisted pair) 4. Used for data and hardware sharing 2. Metropolitan Area Network (MAN) x x Covers large geographic areas Uses Fiber Optics cables For example: Colleges, Universities, banks etc. 3. Wide Area Networks (WAN) x x x x x x x Communication is established through telephone lines, microwave links and satellites etc. It has no geographical limit It is made up of a number of interconnected LANs. E.g. The internet The computers are attached spread apart geographically such as a state, the country, or the world Computers in a network are situated in a wider geographical area. It may contain a number of local area network uses external communication facilities such as phone lines, cable, television lines, or satellite transmission to carry data over longer distance

How to connect
x x x x x

On-demand connection: a phone line that has a dial tone and can be accessed as needed
Dedicated communication connection-connected at all times Internet international network of networks (WAN) that provides access to a vast array of information stored in computer systems throughout the world. world wide interconnection scheme for accessing various computer networks from other computers It is a network of networks.

Internet

Based on the architecture, networks are divided into two broad categories:
6|Page

1. Peer-to-peer Networks 2. Server based Networks The type of network you choose to implement depends on i. Size of the organization ii. Level of security required iii. Level of administrative support available iv. Amount of network traffic v. Needs of the networks use vi. Network budget

1. Peer-to-peer Networks
In the peer-to-peer configuration, only two computers are directly connected by cable and one computer can directly access the resources located in the other computer.
x x x x x x x x No dedicated server Every computer acts as both a client and a server Good for 10 or few users Less security User at each computer determines what data on that computer is shared on the network., also called work groups all computers on the network belong to users and are equal as far as the network is concerned Computers simply connect with each other in a workgroup to share files, printers and Internet access. This is most commonly found in home configurations and is only practical for workgroups of a dozen or less computers

2. Server-Based
x x x x In the workgroup configuration, more than two computers are connected but the maximum number of computers is not greater than ten. In server based, one computer can directly access the resources located in other computer provided that the other computer gives permission to use the resources. There is usually a Server Machine to which all of the computers log on This server can provide various services, including

centrally routed Internet Access,


7|Page

mail (including e-mail), file sharing and printer access, ensuring security across the network.
x x x x x Supports large number of users Needs dedicated server (acts only as a server, but not as a client) Security is an issue Size is limited by a server and network hardware Requires at least one professional administrator.

Network Topology
Topology: specifies the geometric arrangement of the network. Common topologies are: bus, ring, star, mesh The physical topology of a network refers to the layout of cables, computers and other peripherals. Logical topology is the method used to pass the information between the computers

8|Page

Protocol: Specifies a common set of rules and signals the computers on the network use to communicate. Protocols define the format, timing, sequence, and error checking used on the network. Common Protocols are: TCP: Transmission Control Protocol IP: Internet Protocol UDP: User Datagram Protocol FTP: File Transfer protocol HTTP: Hyper Text Transfer Protocol

Standard Topologies
1. Bus Topology All workstations are connected directly to the main backbone that carries the data. Consists of devices connected to a common, shared cable. Traffic generated by any computer will travel across the backbone and be received by all workstations This works well in a small network of 2-5 computers As the number of computers increases so will the network traffic and this can greatly decrease the performance and available bandwidth of your network Is used for a Local Area Network Is the simplest Messages are detected by all nodes and are accepted by the nodes to which they are addressed. Relies on collision detection or token passing to regulate traffic. If one node fails, the rest of the network can continue to function normally.

9|Page

Advantages of Bus Topology - Easy to implement - Low cost Disadvantages of Bus Topology - Limited cable length and workstation - Difficult to isolate network fault. x Cable fault affects all workstations One of the most common network topologies found in most offices and home networks Becomes very popular in contrast to the bus type (which we just spoke about), because of the cost and the ease of troubleshooting. Cable segments from each computer (node) are connected to a centralized component called a hub. Hub - is a device that processes and switches the messages from one incoming line to another. - Signals are transmitted from the sending computer through the hub to all computers on the network. - Failure of one computer doesnt affect the network - Failure of the hub affects the network - Cabling cost is high 2. Star Topology

Advantage of Star Topology - Easy to add new workstations - Centralized control - Centralized network - Easy to modify
10 | P a g e

if one computer on the star topology fails, then only the failed computer is unable to send or receive data

Disadvantages of Star Topology - Hubs are expensive Each computer is connected to a central hub or switch, if this device fails, the entire network fails!

3. Ring Topology x x x x x Computers are connected on a single circle of cable. Unlike the bus topology, there are no terminated ends. signals travel around the loop in one direction and pass through each computer The method by which the data is transmitted around the ring is called token passing A token is a special series of bits that contains control information Each computer acts as a repeater to boost the signal and send it to the next computer. Failure of one computer can have an impact on the entire network. Allows signals to travel farther by regenerating signals Cable failures affect limited users. Logically, a ring topology is a circular arrangement of computers where the signals from one node travel around the ring in clockwise direction .Because the signals pass through each computer, the failure of one computer or a break in a cable could bring the entire network failure.

11 | P a g e

4. Mesh Topology
Each computer is connected to every other computer by a separate cable. Provides redundant paths through the new work

Hybrid Topology Types

12 | P a g e

Transmission Cables
The kind of cable or other medium that is used to connect the various computers in a network Common types: Twisted-pair wire, Coaxial cable, and Fiber optic cable

1. Twisted-pair wire
Is a copper wire similar to the common telephone line each of the pair of wire are twisted It can be Shielded (STP) or Unshielded (UTP) UTP: the most popular cable around the world used not only for networking but also for the traditional telephone

13 | P a g e

2. Coaxial cable
A type of wire that consists of a center wire surrounded by insulation and then a grounded shield of braided wire. The shield minimizes electrical and radio frequency interference. more expensive than standard telephone wire much less susceptible to interference and can carry much more data

3. Fiber Optic Cables


can be used over greater distances 2km without the use of repeaters. one fiber could replace hundreds of copper cables high bandwidth Low loss of signals The diameter could be millionths of a meter.

Comparison

Brief Introduction to Internet


Sometime in the mid 1960's, during the Cold War, it became apparent that there was a need for a bombproof communications system. A concept was devised to link computers together throughout the country. With such a system in place large sections of the country could be linked and messages could still get through.

14 | P a g e

Basically the Internet was an emergency military communications system operated by the Department of Defense's Advanced Research Project Agency (ARPA). The whole operation was referred to as ARPANET. In time, ARPANET computers were installed at every university in the United States that had defense related funding. Gradually, the Internet had gone from a military pipeline to a communications tool for scientists. As more scholars came online, the administration of the system transferred from ARPA to the National Science Foundation. Years later, businesses began using the Internet and the administrative responsibilities were once again transferred. At this time no one party "operates" the Internet, there are several entities that "oversee" the system and the protocols that are involved. The speed of the Internet has changed the way people receive information. It combines the immediacy of broadcast with the in-depth coverage of newspapers...making it a perfect source for news and weather information.

About the Web


Think of the web as the illustrated version of the Internet. It began in the late 1980's when a Swiss physicist Dr. Berners-Lee wrote a small computer program for his own personal use. This program allowed pages, within his computer, to be linked together using keywords. It soon became possible to link documents in different computers, as long as they were connected to the Internet. The document formatting language used to link documents is called HTML (Hypertext Markup Language.) The Web remained primarily text based until 1992. Two events occurred that year that would forever change the way the Web looked. Marc Andreesen developed a new computer program called the NCSA Mosaic (National Center for Supercomputing Applications at the University of Illinois) and gave it away! The NCSA Mosaic was the first Web browser. The browser made it easier to access the different Web sites that had started to appear. Soon Web sites contained more than just text, they also had sound and video files.

15 | P a g e

These pages, written in the hyper-text markup language, have "links" that allow the user to quickly move from one document to another...even when the documents are stored in different computers. Web browsers "read" the html text and convert it into a page like the one you see on the browser windows. Each web site has an address, or Uniform Resource Locator (URL). The URL contains a set of instructions that are read by the browser.

The beginning of the URL contains the protocol. This is usually "http" (Hypertext Transfer Protocol) or "ftp" (File Transfer Protocol). The second section of the URL reveals the domain. Directories follow the domain. Lastly is the name of the document. (If no document is named the browser will automatically open any document in the directory named "default" or "index." Internet Services: E-mail transfer USENET World Wide Web (WWW, Web, W3) File transfer/access (FTP) Remote login/ execution (Telnet) Video Conferencing

E-mails Even with the multimedia excitement of the Web, Electronic Mail (email) is the most frequently used application of the Internet. Many people who have access to the Internet at school, home, and work, use the Internet for no other purpose than to send and receive email. According to International Data Corporation (IDC), on an average day in the year 2000, 5.1 billion emails are sent in the US and 8.2 billion worldwide. By 2005, 11.5 billion emails are sent each day on average in the US and 26.1 billion worldwide. (This includes
16 | P a g e

emails sent by individuals for business and personal purposes, but not mass emails sent to large lists.) It's all very easy. You create the message, log onto the Internet, and send it. The message first goes to your Internet Service Provider's mail server, which in turn sends it to the recipient's mail server. On the way your message may go through several servers, each reading the domain name in order to route it to the appropriate server. The message then remains in the recipient's mail server until he requests it by "checking his mail." Each email address you send is made up of certain components that help route it to the proper recipient: Every user, which belongs to the network, has his/her account and computer system that provides the account. To send a message User name: identifies the sender or the recipients. Domain name: identifies the computer system on which the user has an account. Examples: haile@ethionet.et

info@aau.edu.et
User Name Domain Name

Country or type Institution

The benefits of email are obvious...mostly it's quick. Also, many people feel that the rules for regular mail don't apply to email*, making it less formal, which in turn makes email easier to compose and send. It's not just friends and coworkers that are receiving email. Wherever you look, the Web is providing email addresses. This has made communication between strangers easier than ever. When you visit a Web site, click on the Web masters email address to let them
17 | P a g e

know what you think. You can read an interesting article online and immediately send the author an email. World Wide Web (WWW) x x x x x x Is one of the newest Internet services The WWW allows you to combine text, a video, graphics, and even animation to make a document a viewed easy. Links within WWW documents can take you quickly to other related documents. WWW is a set of sites that you can go o for information. The process of sharing common information of the world by the help of the Internet services. It requires special software programs like Netscape, Internet Explorer, or others. Web Browsers For Example: http://www.cnn.com Use Net x It is one of the Internet services which allow users from any where on the Internet to participate a discussion groups (News groups). It is an organized electronic mail (e-mail) system, except there is no single user that mail is sent to. x x A world wide distributed discussion group consists of a set of newsgroups. Articles or messages are posted to news groups and the articles are then broadcasted to other interconnected computer systems. Telnet:- It is a program that lets you log into a remote computer directly through the Internet and you can work on that computer. File Transfer Protocol (FTP) x x x This enables you to examine the files of remote hosts on the Internet and to transfer files between your hosts and the others. Using FTP programs we can upload or download files. But to do this there should be an admission from the remote computer. Helps to transfer files and programs from one system to another.

18 | P a g e

Video Conferencing x The Internet is, in its raw form, communication. x Video conferencing means making a conference on the Internet by individuals who live in different locations. x The individuals speak and see each other. x It is similar to conference in a hall except they are at distant.

Ethical and social issues in the information age


Though the advantage of information technology outweighed the disadvantage, there are some issues that come as a result of information technology. Ethics Responsibility and accountability Privacy Property rights to information and intellectual property. The right of an individual to be left alone and control the flow of information about himself or herself. System quality Integrity of a system (avoiding malfunctioning) Quality of work life Job satisfaction Responsibility Variety Challenge Health and safety Stress Computer vision syndrome

19 | P a g e

IT in the future:
Predicting the future is always risky business. But some things are relatively certain. In the next five to ten years the following will be some of the developments in information technology. Network convergence- TV, radio, the Internet and the telephone system into a single integrated network. Why not we use TV to watch video, switch channels and surf the Internet, switch channels again and listen to some music on an FM radio station, and then switch channel again and write a term paper? Wireless mobile computing (handheld)- a new generation of wireless digital devices that combine computing and two-way communication capabilities Inexpensive supercomputer

20 | P a g e

CHAPTER SEVEN
Computer Security
Introduction to Computer Security
Security: The prevention and protection of computer assets from unauthorized access, use, alteration, degradation, destruction, and other threats.
x

Computer systems should have a set of protection policies to restrict and control the system resources Considering: Unauthorized access Malicious modification or destruction Accidental introduction of inconsistency

Security Goals
x

Data Confidentiality It is concerned with having secret data remain secret Unauthorized users should not be able to modify any data without the owners permission Includes removing data and adding false data Means nobody can disturb the system to make it unusable Privacy - the ability to keep things private/confidential Trust - do we trust data from an individual or a host? Could they be used against us?
x

Data Integrity

System Availability
x x

Security is thus based on the following independent issues:

Authenticity - are security credentials in order? Are we talking to whom? We think we are talking to, privately or not. Integrity - has the system been compromised/altered already?

Why Computer Security?


Computer security is required because computer systems are vulnerable to many threats that can inflict various types of damage resulting in significant losses. This damage can range from errors harming database integrity to fires destroying entire computer centers. There may be several forms of damage, which are obviously interrelated. These include:
x x x x x

Damage or destruction of computer systems. Damage or destruction of internal data. Loss of sensitive information to hostile parties. Use of sensitive information to steal items of monetary value. Use of sensitive information against the organization's customers, which may result in legal action by customers against the organization and loss of customers. Damage to the reputation of an organization. Monetary damage due to loss of sensitive information, destruction of data, hostile use of sensitive data, or damage to the organization's reputation. Losing the ability to use the system

x x

Security Threats
A threat is a potential violation of security. The effects of various threats vary considerably: some affect the confidentiality or integrity of data while others affect the availability of a system. A computer security threat can be any person, act, or object that poses a danger to computer security. Generally, environments can be hostile because of
x x x

Physical threats - weather, natural disaster, bombs, power failures, etc. Human threats - stealing, trickery, bribery, spying, sabotage, accidents. Software threats - viruses, Trojan horses, logic bombs, denial of service, trap door.

1. Fraud and Theft Computer systems can be exploited for both fraud and theft both by "automating" traditional methods of fraud and by using new methods. For example, individuals may use a computer to skim small amounts of money from a large number of financial accounts, assuming that small discrepancies may not be investigated. Financial systems 2

are not the only ones at risk. Systems that control access to any resource are targets (e.g., time and attendance systems, inventory systems, school grading systems, and longdistance telephone systems). Insiders or outsiders can commit computer fraud and theft. Insiders (i.e., authorized users of a system) are responsible for the majority of fraud. Since insiders have both access to and familiarity with the victim computer system (including what resources it controls and its flaws), authorized system users are in a better position to commit crimes. Insiders can be both general users (such as clerks) and technical staff members. An organization's former employees, with their knowledge of an organization's operations, may also pose a threat, particularly if their access is not terminated promptly. 2. Loss of Physical and Infrastructure Support The loss of supporting infrastructure includes power failures (outages, spikes, and brownouts), loss of communications, water outages and leaks, sewer problems, lack of transportation services, fire, flood, civil unrest, and strikes. 3. Malicious Hackers The term malicious hackers, sometimes called crackers, refer to those who break into computers without authorization. They can include both outsiders and insiders. Much of the rise of hacker activity is often attributed to increases in connectivity in both government and industry. One 1992 study of a particular Internet site (i.e., one computer system) found that hackers attempted to break in at least once every other day. The hacker threat should be considered in terms of past and potential future damage. Although current losses due to hacker attacks are significantly smaller than losses due to insider theft and sabotage, the hacker problem is widespread and serious. 4. Threats to Personal Privacy The accumulation of vast amounts of electronic information about individuals by governments, credit bureaus, and private companies, combined with the ability of computers to monitor, process, and aggregate large amounts of information about individuals have created a threat to individual privacy. The possibility that all of this information and technology may be able to be linked together has arisen as a specter of the modern information age.

5. Malicious Code Malicious code refers to viruses, worms, Trojan horses, logic bombs, and other "uninvited" software. Sometimes mistakenly associated only with personal computers, malicious code can attack other platforms.
x

Viruses A small program that replicates and hides itself inside other programs usually without your knowledge. It gets attached to some part of an operating system or any other computer program. It may attach itself to any executable code, including but not limited to boot sectors and /or partition sectors of hard and/or floppy disks. A computer virus can perform: x corrupt or destroy data x increase file size x format the hard disk x degrade system performance x manipulate the directory contents x rename all files with different name

Types of viruses
A. Multi-Partite x A virus that attempts to attack both the boot sector and the executable, or program, files at the same time. x When the virus attaches to the boot sector, it will in turn affect the systems files, and when the virus attaches to the files, it will in turn infect the boot sector. x Such viruses are highly infectious. B. Companion Virus x A virus which infects executable files by creating a companion file with the same name but an .COM extension. x Since DOS executes .COM files, followed by .EXE files, and finally .BAT files, the virus loads before the executable file. 4

C. Boot sector or MBR virus x A virus which infects the boot sector of disks Boot sector x Hard disk drives, floppy diskettes, and logical drives (partitions) all have boot sectors where critical drive information is stored. Master Boot Record x On all PC fixed disks, the first physical sector is reserved for a short bootstrap program. This sector is the master Boot (MBR). D. Stealth Virus x A computer virus that actively hides itself from antivirus software by either masking the size of the file that it hides in or temporarily removing itself from the infected file and placing a copy of itself in another location on the drive, replacing the infected file with an uninfected one that it has stored on the hard drive. x A stealth virus is one that conceals the changes it makes x A stealth virus is programmed as such that it is able to conceal itself from discovery or defends itself against attempts to analyze or remove it E. Macro Virus x A macro virus is a virus written in one of the many macro languages. x The macro viruses spread via infected files, which can be documents, spreadsheets, databases, or any computer program which allows use of a macro language. x At present these viruses can infect Microsoft Word and Lotus Ami Pro documents. x This virus attaches itself to a word processing or spreadsheet file(mainly Microsoft Word or Excel file) F. Trojan (Trojan Horse) x A Trojan (or Trojan Horse) is a program which carries out an unauthorized function while hidden inside an authorized program. x It is designed to do something other than what it claims to, and frequently is destructive in its actions 5

x Seemingly innocent program contains code to perform an expected and undesirable action x Code segment that misuses its environment x Exploits mechanisms for allowing programs written by users to be executed by other users G. Worm x An independent program that reproduces by copying itself from one computer to another x Worms are self-contained and generally use networks to spread. x Self replicating program 6. Denial of Service Blocking access from legitimate users Overload the targeted computer preventing it from doing any useful work 7. Trap door Created by code inserted into system by a system programmer to bypass some normal checks Specific user identifier or password that circumvents normal security procedures

Security Solutions
There are a number of basic ways that a computer can be made more secure.

1. Backups (redundancy)
Just about everyone who has used a computer system has experienced losing important data in some kind of accident. There are many reasons why data get lost: it might be due to carelessness or natural disaster. The purpose of a backup is to make a copy of data, which is unlikely to be lost or destroyed by the same act as the original. In older times, backups of disks were always made to tape. Tape was chosen because it is a relatively cheap medium, which is easily transported. If we want a backup to be protected from the same accident that would destroy the original, we have to store it in a different physical location. Today, the economics of backup have changed and data can often be mirrored to a disk at a different physical location, by using network copying. Tapes are relatively unreliable, so they have low security compared to disks. Operating

systems have different preferred ways of making backups, using different software and media. Some things are common to all systems however. The key principle of backups is redundancy. Redundancy means making multiple copies of data, so that we always have something to fall back on. We can have backups of data, but we can also have backup of services, in case we lose an important piece of hardware. Redundancy is like an insurance policy. Clearly, making backups of every file is a time-consuming process, and it requires a lot of storage. There are two kinds of backup
x x

Full dump: copies every file on a source medium to a backup medium. Incremental or differential dump: copies files according to the level of the dump. A level 0 dump copies everything. A level 1 dump copies everything, which has changed since the last level 0 dump. A level 2 dump copies everything which has changed since the last level 1 dump or level 0 dump and so on. (i.e. all levels which are lower)

2. Encryption
The term encryption refers to the practice of obscuring the meaning of a piece of information by encoding it in such a way that it can only be decoded, read and understood by people for whom the information is intended. It is the process of encoding data to prevent unauthorized parties from viewing or modifying it. Encryption is said to occur when data is passed through a series of mathematical operations that generate an alternate form of that data; the sequence of these operations is called an algorithm. To help distinguish between the two forms of data, the unencrypted data is referred to as the plaintext and the encrypted data as ciphertext. The security of encryption lies in the ability of an algorithm to generate ciphertext that is not easily reverted to the original plaintext. Common Uses of Encryption Authentication Authentication is the process of logging in, signing on or otherwise presenting information or oneself in a manner that proves his or her identity. The most common example of authentication is the use of a username and password to gain access to a system, network or web site. The username and password combination is often referred to 7

as a persons credentials and it is frequently sent over networks. Encryption is used to protect these credentials. If no encryption is used to protect the information as it is sent over the network, an attacker could capture those credentials and assume the identity of the originator. Validation Validation describes the ability to provide assurance that a senders identity is true and that a message, document or file has not been modified. Encryption can be used to provide validation by making a digital fingerprint of the information contained within a message. A digital fingerprint is a code that uniquely identifies a file or a message by reflecting the content of the file with tremendous specificity. Data Protection Probably the most widely used application of encryption is in the area of data protection. Encryption of files protects the data that is written to the hard disk on the computer. This information protection is vital in the event of theft of the computer itself or if an attacker successfully breaks into the system. However, file encryption becomes more difficult to use and manage if the office has multiple employees. Because each employee needs the encryption key, protection of the key becomes a more difficult task. The more people who have access to encryption keys, the less effective encryption becomes. The risk of loss, theft or compromise of information rises as the number of users increases. Files that have been encrypted are also vulnerable to employees who leave the organization or who are disgruntled and may want to cause the organization harm.

3. Remedy for Viruses


Organizations and single-users should establish some kind of internal routines for data handling, for running a virus free computing environment. To prevent viruses from entering a system there are two options. Isolate the machine: to avoid the virus entering into the computer

Disconnect it from the Internet or any other network Not using floppy disks, CD-ROMs or any other removable disks. Antivirus is software utility, which (upon installing on a computer) searches the hard disk for viruses and removes which are found.
Popular antivirus software programs available are Norton and McAfee Antivirus programs

Install an Antivirus program.

Functions of anti-viruses
o o o o o o o o o

Identification of known viruses Detection of suspected viruses Blocking of possible viruses Disinfection of infected objects Deletion and overwriting of infected objects

Computer security controls/Making the system Secure Authentication Using passwords, smart card, fingerprint Anti-virus Scan the system using anti-virus software Firewall Limits network access b/n trusted and untrusted hosts Encryption Encrypt clear text to cipher text

You might also like