Introduction to Computer Studies PDF
Document Details
Uploaded by CleverBowenite6973
New Cairo Academy
Dr. Mahmoud Mohamed
Tags
Summary
This document provides an introduction to computer studies, covering fundamental concepts such as computer components, functionalities, different types of computers, and their characteristics.
Full Transcript
What is the computer The computer is a complex system contains elementary electronic components to perform data processing. Types of Computers There are two basic types of computers: Digital computers: operates on discrete data Examples: PC (personal computers), work station, minicomputers, m...
What is the computer The computer is a complex system contains elementary electronic components to perform data processing. Types of Computers There are two basic types of computers: Digital computers: operates on discrete data Examples: PC (personal computers), work station, minicomputers, main frame computers and super computers. analog computers. operates on continuous data Examples: thermometer Speedometer gasoline pump, electric watt meter The Functions of Computers: 1. Data processing. 2. Data storage. 3. Data movement between itself and outside world. 4. Control input – output devices. 5. Communication. CHARACTERISTICS OF COMPUTER Automatic: 1. Computers are automatic machines because it works by itself without human intervention. 2. Computer cannot start themselves. Accuracy: 1. The accuracy of a computer is very high. 2. The degree of accuracy of a particular computer depends upon its design. 3. Errors can occur by the computer. But these are due to human weakness, due to incorrect data, but not due to the technological weakness. Speed: 1. Computer is a very fast device. It can perform the amount of work in few seconds Introduction to Computer Studies Dr. Mahmoud Mohamed CHARACTERISTICS OF COMPUTER Automatic: 1. Computers are automatic machines because it works by itself without human intervention. 2. Computer cannot start themselves. Accuracy: 1. The accuracy of a computer is very high. 2. The degree of accuracy of a particular computer depends upon its design. 3. Errors can occur by the computer. But these are due to human weakness, due to incorrect data, but not due to the technological weakness. Speed: 1. Computer is a very fast device. It can perform the amount of work in few seconds CHARACTERISTICS OF COMPUTER Storage: - The Computer has an in-built memory where it can store a large amount of data. Diligence: - A computer is free from tiredness, lack of concentration, fatigue, etc. It can work for hours without creating any error. Versatility: - It means the capacity to perform completely different type of work. Power of Remembering: - Computer has the power of storing any amount of information or data. No IQ: - Computer is a dumb machine and it cannot do any work without instruction from the user. No Feeling: - It does not have feelings or emotion, taste, knowledge and experience. Categories of Computer Supercomputer A supercomputer is the fastest, most powerful, and most expensive computer used for applications that require complex and sophisticated mathematical calculations. Gigaflops= 109 arithmetic operation per second. Teraflops=1012 arithmetic operation per second. Petaflops=1015 arithmetic operation per second. Categories of Computer Mainframe A mainframe is a large, expensive, but powerful computer that can handle hundreds or thousands of connected users at the same time. Minicomputer A minicomputer is a computer of a size intermediate between a microcomputer and a mainframe. Categories of Computer Workstation A workstation is a computer intended for individual use that is faster and more capable than a personal computer. Microcomputer A microcomputer is a small, relatively inexpensive computer with a microprocessor as its central processing unit (CPU). The Generation of The Computers. First Generation: Duration: 1942-1955 Technology: vacuum tube Second Generation: Duration: 1955-1964 Technology: transistor. Third Generation: Duration: 1965-1975 Technology: IC chip The Generation of The Computers. Fourth Generation: Duration: 1975-1989 Technology: Microprocessor chip The main structural components of a computer Organization of an information system Input processing output feedback System configuration System configuration CPU ALU CU Input devices Secondary storage Output devices Communication devices Primary storage The Block Diagram of Computer The central processing unit CPU CPU is the part of the computer system where the manipulation of the data occurs. This unit is simply called a processor. its function is to control all computer operations and performs its data processing functions. These functions are written to the CPU in the form of instructions stored in memory and the CPU executes these instructions. The CPU consists of: control unit CU arithmetic and logic unit ALU The Components of the CPU 1. Temporary storage area called registers to store data, instructions and results. Registers 2. Arithmetic and logic unit (ALU): Connection buse to perform the arithmetic and logic operations. Control unit Arithmetic and 3. Control unit: to Coordinate logic unit (ALU) and control the other parts of the computer system. It also reads a stored program, one instruction at a time and directs other components of the computer system to perform tasks 4.Connection buses: to connect the components of the CPU. Register: it is temporary storage location in the ALU or control unit where small amounts of data and instructions reside for thousandths of a second just before use Cache memory: - memory area for high speed storage of frequently used instruction and data. - has small size. - inside CPU. - very expensive. Primary storage (primary memory or main memory) Its functions storing data and programs temporarily during processing storing the operating system that manage the computer The characteristics of memory: 1.Capacity: Is the amount of information accommodated in the memory, the capacity is measured by byte or word. 2.Unit of transfer: this is equal to the number of data lines into and out of the memory module. This is called the word length. 3.Access time: it is the time required to a read or write operation. 4.Transfer rate: it is the rate at which the data can be into or out of a memory. Types of internal memory RAM (Random access memory) ROM (Read Only Memory) For short term storage Can only be read from Volatile Programs already burned in Can be read from or write on it Non volatile register Main memory Cache memory PROM (programmable ROM) EPROM (erasable programmable ROM) Can be programmed once Used for device control such as in robots Used for control devices in the where the program may be changed manufactures It can be erased and reprogrammed RAM The complete name of RAM is random access memory which is also known as Primary memory. It is called read/write memory because data can be read as well as write in RAM. It is called random access because you can directly access any data from RAM The RAM chip is fixed on the mother board & the mother board is designed in such a way that its memory capacity can be enhanced by adding more RAM chip. RAM is a VOLETILE memory. RAM chips are of two types: 1- DRAM: Dynamic Random Access Memory is a volatile memory that allows fast access to data and is ideal for use as the primary store of computer systems. However, the information is stored as electrical charges and the charges need to be constantly refreshed in order for the data to be maintained. 2- SRAM: Static Random Access Memory is also a volatile memory. Once data is written into the chip, it is maintained as long as power is supplied to it; it does not need refreshing. SRAM is slower than DRAM and it is also more expensive. ROM The complete name of ROM is read only memory. The data stored permanently & can’t be altered by the programmer. Data stored in ROM chip can be read & used but cannot be changed. This memory also known a field storage permanent storage or dead storage. It is basically used to store manufacturer programmed & user program. Most of the basic operations are carried out by electronic circuits which are known as micro programs. These programs are stored in ROM. For ex. System Boot Loader. Types of ROM PROM : Programmable Read Only Memory is a non-volatile memory which allows the user to program the chip with a PROM writer. The chip can be programmed once, thereafter, it cannot be altered. EPROM & EEPROM Erasable Programmable Read Only Memory and Electrically Erasable Programmable Read Only Memory chips can be electrically programmed. Unlike ROM and PROM chips, EPROM chips can be erased and reprogrammed. Motherboard The motherboard, or the mainboard, is a crucial computer system component. It serves as a platform that connects and integrates various hardware components, allowing them to communicate and work together. Secondary Storage Devices It is the relatively long-term nonvolatile storage of data outside the CPU & primary storage. Computer systems require storage devices to store and retrieve data, files, programs, and the operating system. These devices are essential components. Types of storage devices commonly used in computers: Hard Disk Drives (HDDs): HDDs are traditional magnetic storage devices that utilize rotating platters to store data. They offer larger storage capacities at relatively lower costs, but data access speeds are slower than SSDs. Solid-State Drives (SSDs): SSDs are storage devices that use flash memory technology to store data electronically. They have no moving parts, which results in faster data access speeds, improved durability, and lower power consumption than HDDs. Secondary Storage Devices Hybrid Drives: Hybrid drives combine HDDs and SSDs, offering larger storage capacity than traditional hard drives and faster data retrieval of smaller solid-state cache. USB Flash Drives: USB flash drives, often known as thumb drives, are portable storage devices that store data on flash memory. They are small, lightweight, and offer convenient plug-and-play data transfer and storage functionality. Input Devices: These devices take input and convert it into binary language that the computer understands. The Input Unit is formed by attaching one or more input devices to a computer. The input unit is used to provide data to the processor for further processing. The devices which are used to entered data in the computer systems are known as input devices. Keyboard, mouse, scanner, microphone, light pen etc are example of input devices. Functions of Input Devices: Accept the data from the outside worlds. Convert that data into computer coded information. Supply this data to Central Processing Unit for further processing. Classification of Input Devices: Output Device. It converts the binary data coming from the CPU to human understandable form. The output unit displays or prints the processed data in a user-friendly format. Or, the devices which display the result generated by the computer are known as output devices. The output unit is formed by attaching the output devices of a computer. Functions of Output Devices Accept the result form the CPU. Convert that result into human readable form. Display the result on the output device. Paraphiles Devices The power supply unit in a computer converts the power from the wall outlet to the type of power needed by the computer. It sends power through cables to the motherboard and other components. Paraphiles Devices Video card The video card is responsible for what you see on the monitor. Most computers have a GPU (graphics processing unit) built into the motherboard instead of having a separate video card. If you like playing graphics-intensive games, you can add a faster video card to one of the expansion slots to get better performance. Sound card The sound card—also called an audio card—is responsible for what you hear in the speakers or headphones. Most motherboards have integrated sound, but you can upgrade to a dedicated sound card for higher-quality sound. Network card The network card allows your computer to communicate over a network and access the Internet. It can either connect with an Ethernet cable or through a wireless connection (often called Wi- Fi). Many motherboards have built-in network connections, and a network card can also be added to an expansion slot. Bluetooth card (or adapter) Bluetooth is a technology for wireless communication over short distances. It's often used in computers to communicate with wireless keyboards, mice, and printers. It's commonly built into the motherboard or included in a wireless network card. What is a laptop computer? A laptop is a personal computer that can be easily moved and used in a variety of locations. Most laptops are designed to have all of the functionality of a desktop computer, which means they can generally run the same software and open the same types of files. However, laptops also tend to be more expensive than comparable desktop computers. What is a mobile device? A mobile device is a general term for any type of handheld computer. These devices are designed to be extremely portable, and they can often fit in your hand. Some mobile devices—like tablets, e-readers, and smartphones—are powerful enough to do many of the same things you can do with a desktop or laptop computer. Numbering System All digital computers store numbers, letters, and other characters in coded form. The code used to represent characters is the Binary Code – i.e. a code made up of bits called Binary Digits. Every character is represented by a string of “0s” and “1s” – the only digits found in the binary numbering system. “0” or “1” = bit (Binary Digit) 8 bits = 1 Byte (1 Character) 1024 Bytes = 1 KB (Kilo Bytes) 1024 KB = 1 MB (Mega Byte) 1024 MB = 1 GB (Giga Byte) 1024 GB= 1 TB (Terra Byte) When data is typed into a computer, the key board converts each key stroke into a binary character code. This code is then transmitted to the computer. When the computer transmits the data to the any device, each individual character is communicated in binary code. It is then converted back to the specific character while displaying or printing the data. Decimal Number System (Base 10) In the decimal system the successive positions to the left of the decimal point represent units, tens, hundreds, thousands etc. The number 7762, the digit 2 represents the number of units, 6 represents the number of tens, 7 the number of hundreds and 7 the number of thousands. the number of symbols used to represent numbers in the system is called the base of that system. In short, we can say that the value of each digit in the number system is determined by: o The digit itself o The position of the digit in the number itself o The base of the system. Binary Number System (Base 2) We now come to a different number system – the Binary number system. This binary number system has a base of two, and the symbols used are “0” And “1”. In this number system, as we move to the left the value of the digit will be two times greater than its predecessor. Thus, the values of the places are: 64 32 16 8 421 Converting Decimal to Binary In conversion from decimal to any other number system, the steps to be followed are: o Divide the decimal number by the base of 2. o Note the remainder in one column and divide the quotient again with the base. Repeat this process until the quotient is reduced to a zero. Example: The decimal number is 65 The binary number of 65 is 1000001 Converting Binary to Decimal The decimal number of 100001 is = (1*26) + (0*25) +(0*24) + (0*23) +(0*22) +(0*21) +(1*20) = (1*64) + (0*32) + (0*16) + (0*8) + (0*4) + (0*2) + (1 * 1) = 64 + 0 + 0 + 0 + 0 + 0 + 1 = 65 The decimal number of 1000001 is 65 Octal Number System (Base 8) A commonly used positional system is the Octal System. The octal system has a base of 8. The values increase from left to right as 1, 8, 64, 512, 4096, …. Converting Decimal to Octal In conversion from decimal to any other number system, the steps to be followed are: o Divide the decimal number by the base of the 8. Example: The decimal number is 224 The octal number of 224 is 340 Converting Octal to Decimal The octal number is 340 = (3*82) +(4*81) +(0*80) = (3*64) + (4*8) + (0*1) = 192 + 32 + 0 = 224 The decimal number of 340 is 224 Converting Binary - Octal Converting from Binary to Octal The binary number must be divided into groups of three from the octal point – to the right in case of the fractional portion and to the left in case of the integer portion. Each group can then be replaced with their octal equivalent. Example Binary 101010101010100 101 010 101 010 100 5 2 5 2 4 So, 52524 is the Octal equivalent of binary 101010101010100 Converting Octal to Binary Each octal digit is replaced with the appropriate ‘triple’ of binary digits. e.g. 65 6 5 110 101 The binary equivalent of the Octal number 65 is 110101 Hexadecimal Number System (Base 16) There is another commonly used positional system, hexadecimal system. The hexadecimal system has a base of 16, so the value increases from left to right as 1, 16, 256, 65536,.... We need to keep a simple table in mind before we attempt any conversion from hexadecimal or vice-versa. Converting Decimal to Hexadecimal In conversion from decimal to any other number system, the steps to be followed are: Divide the decimal number by the base of 16. Example: The decimal number is 370 The hexadecimal number of 370 is 172 Converting Hexadecimal to Decimal The hexadecimal number 172 = (1*162) + (7*161) + (2*160) = (1*256) + (7*16) + (2*1) = 256+112+2 = 370 The decimal number of 172 is 370 Converting Binary to Hexadecimal Each hexadecimal digit is represented by 4 binary digits. Binary Hexadecimal To convert a binary number to its hexadecimal equivalent we split the quantity into groups of four onwards, as before. Each of this group of four is directly converted into their hexadecimal equivalent. We may add zeros to the left of the number if necessary. Example Binary 10101011000010 0010 1010 1100 0010 2 A C 2 So, the hexadecimal equivalent of binary 10101011000010 will be 2AC2 Converting Hexadecimal to Binary The conversion from hexadecimal to binary consists of writing off the binary Equivalent of each hexadecimal digit in groups of four. e.g. Hexadecimal 1901A0412C 0001 1001 0000 0001 1010 0000 0100 0001 0010 1100 1 9 0 1 A 0 4 1 2 C Thus, the required binary number can be written as: 1100100000001101000000100000100101100 Converting Hexadecimal to Octal Write 4-digit binary numbers for each hexadecimal. Arrange the entire number sequence into group of 3-bit section. If any bit is missing add 0 on leftmost section. Now write down octal equivalent of each 3-bit section. Example: The hexadecimal number is 2A35. 2 A 3 5 0010 1010 0011 0101 000 010 101 000 110 101 0 2 5 0 6 5 The octal number is 25065 Converting Octal to Hexadecimal Write 3-digit binary number for each octal. Arrange the entire number sequence into group of 4-bit section. If any bit is missing add 0 on leftmost section. Now write down hexadecimal equivalent of each 4-bit section. Example: The octal number is 25065. 2 5 0 6 5 010 101 000 110 101 0010 1010 0011 0101 2 A 3 5 The hexadecimal number is 2A35 Binary Arithmetic Addition For binary addition the following rules of binary addition are to be considered: 0+0=0 0+1=1 1+0=1 1 + 1 = 0 (carry 1 to the next column to the left) 1 + 1 + 1 = 1 (carry 1 to the next column) e.g. Add two binary numbers 11011 and 111 Carry 1 1 1 1 10111 + 111 1 0 0 0 1 0 (Answer) Numbering System Subtraction For binary subtraction the following rules of binary subtraction are to be considered: 0-0=0 1-0=1 1-1=0 0 - 1 = 1 (carry 1 from the next column to the left by 10) Example: Find the result of 11001 – 100 Carry 10 11001 100 - 10101 (answer) Though there are other methods of performing subtraction, we will consider the method of subtraction know as complementary subtraction. This is a more efficient method of subtraction while using electronic circuits. We will be following three steps to perform subtraction: o Find the complement of the number you are subtracting. o To the complement of the number we obtained in step 1, we add the number we are subtracting from. o If there is a carry of 1 add the carry to the result of the addition else re complement the sum and attach a negative sign. How do we find the complement of a binary number ? We have to invert all the bits. e.g. Number Complement 10001101 01110010 00101010 11010101 Example 1 1010101 – 1001100 Step-1. Find the complement of 1001100 0110011 Step-2. Add the number you are subtracting from Carry 1 1 1 0 1 1 1 1010101 +0110011 0001000 + 1 (Continue since there is a carry of 1) 0 0 0 1 0 0 1 (Answer) Example 2 101100 – 11100101 Step-1. Find the complement of 11100101 00011010 Step-2. Add the number you are subtracting from Carry 0 1 1 1 00101100 +00011010 01000110 Step-3. Since there is no carry, we are complementing the result 10111001 attach a negative sign - 10111001 (Answer) Multiplication Multiplication in binary follows the same rules that are followed in the decimal system. The table to be remembered is: 0x0=0 0x1=0 1x0=0 1x1=1 e.g. 1010 * 1001 1010 x 1001 1010 0000 0000 1010 101101 0 The answer is (1011010) Division Table for binary division is given as under: 0/1=1 1/1=1 The steps for binary division are: o Start from the left of the dividend. o Perform subtraction in which the divisor is subtracted from the dividend o If subtraction is possible put a 1 in the quotient and subtract the divisor from the corresponding digits of the dividend else put a 0 in the quotient o Bring down the next digit to the right of the remainder. o Execute step 2 till there are no more digits left to starting down from the dividend. Unit of Information (Codes) Most computers do not represent characters as pure binary numbers. They use a coded version of true binary to represent letters and special symbols as well as decimal numbers. Coding of characters has been standardized to enable transfer of data between computers. Codes used are: ▪ BCD ▪ ASCII ▪ EBCDIC BCD BCD stands for Binary Coded Decimal. BCD code is one of the early computer codes. It is based on the idea of converting each digit of a decimal number into its binary equivalent rather than converting the entire decimal into binary form. All decimal digits are represented in BCD by 4 bits. Each decimal digit is independently converted into a 4 bit binary number & so the conversion process is very easy. 4-bit BCD can be used to represents only decimal numbers because 4 bits are insufficient to represent various characters. By using 4-bit BCD only 16 possible characters are represented. So, the BCD code was extended from 6-bit code and it is possible to represent 64characters. ASCII ASCII stands for American Standard Code for Information Interchange. In this form of representation, each character (which includes alphabets, digits and symbols) is assigned a particular pattern of bits. For example, A is represented as binary 1000012, B as 10000102 and so on. The standard ASCII character set uses 7 bits and can be used to represent 128 different characters. It uses one extra parity bit for parity check. Other forms of ASCII codes use an extra bit to extend the representation to 256 characters. However, characters represented from binary are not universally agreed upon. The most popular form is the set used by IBM. ASCII is commonly used to exchange data between data processing and communication systems. EBCDIC EBCDIC stands for Extended Binary Coded Decimal Interchange Code. It uses 8 bits and can represent 256 distinct characters. It also uses one extra parity bit for parity check. The EBCDIC code is used in IBM mainframe models and other similar machines. Electronic Circuits are available to transform characters from ASCII to EBCDIC and vice-versa and can also be achieved using computer programs. UNICODE With the onset of globalization through Internet, there emerged a need to Cater for data interchange of the more common languages of the different nationalities like Chinese, Korea and Japanese. ASCII, EBCDIC and other forms of representation proved insufficient. The Unicode/ISO 10646 standard was devised to overcome this problem. The 16 bits used by Unicode can represent 65536 symbols, one extra parity bit for parity check, which is more than enough to represent all the worlds written characters. Although Unicode solves the problem of multi-language data representation, it is not the perfect solution as there remain issues to be addressed. Problems include the wastage of storage space, time needed for data transmission and the lack of support of current operating systems. Furthermore, Unicode does not guarantee a particular sort order. What is software? It is the detailed instructions that control the operation of a computer system Without S/W computer H/W could not perform the demand tasks The functions of S/W are: 1. Manage the computer resources of the organization 2. Provide tools for human beings to take advantage of these resources 3. Act as intermediary between organizations and stored information A S/W program is a series of statements or instructions to the computer Programming is the process of writing or coding programs Programmers are the individuals who specialized in this task Introduction A computer can only do what a programmer asks it to do. To perform a particular task programmer writes a sequence, called the program. An instruction command given to the computer to perform a certain specified operation on the given data. Now as we know only human languages and computer knows only machine language, we need some media through which we can communicate with the computer. So, we can complete our desired task. That media is Language. Languages are tools human can use to communicate with the hardware of a computer system. Each language has a systematic method of using symbols of that language. In English, this method is given by the rules of grammar. Similarly, the symbols of particular one computer language must also be used as per set of rules which are known as the “Syntax” of that language, the language which you are using. Computer Languages can be classified into three broad categories:. What Is Machine Language? Computer programs are written using many different computer Languages but the language which is understood by the computer without translating program is called machine language. Machine language is normally written as string of binary 1s and 0s. A machine language instruction has two-part format. The 1st part is the operation code which tells the computer what function to be performed. The 2nd part is the operand which tells the computer where to find & store data to be manipulated. So, each instruction tells the computer what operation to perform & the length &location of the data field which are involved in the operation. Advantages Disadvantage Programs can be executed Difficult to program immediately upon completion Difficult to modify because it doesn’t require any Time consuming to code translation. Error prone Programmer has complete Operation codes have to be control over the performance memorized of the hardware. Assignment of memory is done by programmer Time consuming for development Programs development are machine dependent Preparation of programs was slow and costly. 2. Assembly Language. Assembly language is a language which allows instruction & storage location to be represented by letters & symbols, instead of number. A program written in an assembly language is called assembly language program or symbolic program. Assembly language was introduced in 1952. Machine language was tedious to code and errors were expected to arise in bulk. To solve these problems mnemonic codes and symbolic addresses were developed. It allows using alphanumeric mnemonic codes instead of numeric code for the instructions in instruction set. The storage locations are to be represented in the form of alphanumeric addresses instead of numeric address. Format of assembly language is similar to machine language: Assembler: Assembler is a special program (translator) which translates symbolic operation codes into machine codes, and symbolic address is addressed into an actual machine address. Advantages Disadvantage Easier to use, code and Machine depended. understand. Programs have to be translated Easier to correct error. before execution. Easier to modify. Translation of programs takes up No worry about addresses. time. Easily relocatable. Knowledge of hardware is Efficiency of machine language. required. Additional storage area needed for the source programs and object code. Examples of Assembly Language: Microsoft Assembly Language (MASM), Turbo Assembler 3. High Level Language. The machine language & assembly language requires a good knowledge of internal structure of computer. The both languages are machine dependent & it is difficult to solve error. To remove this limitation the high-level language is introduced. The high-level languages machine independent so it can be easily ported & executed on any computer. The high-level language programs do not require any knowledge of internal structure of computer so the programmer concentrates on the logic of problem rather than internal structure of computer. It enables the programmer to write instructions using English words & familiar mathematical symbols & expression so the program makes easier to code & understand. It requires a translator program to convert high level program into machine language. Compiler: Compiler is a special program (translator) which translates high level programs into machine codes. Advantages Disadvantage Machine independent. Less flexible. Easier to learn, use and Lower efficiency. understand. Require more time & storage Easier to correct error. space. Easier to maintain. Less time & efforts. Easily relocatable. Program preparation cost is low. Few errors. Assembler A computer can directly execute only machine language programs so the assembly language program must be converted into its equivalent machine language program before can be executed. This translation is done with the help of a translator program which is known as assembler. Assembler translates each assembly language instruction into equivalent machine language instruction. There is one to one correspondence between the assembly language instructions of source program & the machine language instruction of its equivalent object program. In case of assembly language program, the computer not only has to run the program but also must first run assembler program to translate the original assembly language program into machine language program. So, the computer has to spend more time in getting desired answer. Compiler A computer can directly execute only machine language programs. So, the high-level language program must be converted into its equivalent machine language program before can be executed. This translation is done with the help of a translator program which is known as compiler. A compiler is a translator program which translates a high-level language program into equivalent machine language program. The process of translating is shown in below figure: High level language instructions are macro instructions. The compiler translates each high-level language instruction into set of machine language instructions rather than a single machine language instruction. There is one to many correspondences between high level language instructions of source program into equivalent object program. During the translation the source program is only translates not executed. A compiler can translate only those source programs which have written in the language for which compiler is designed. A compiler can also detect & indicates the syntax errors during the compilation process but cannot able to detect logical errors. Interpreter. An interpreter is another type of translator which is used for translating program written using high level languages. It takes one statement of high-level language, translates into machine language & immediately executes the resulting machine language instructions. The main difference between compiler & interpreter is that compiler can translates the entire code but not involve in execution. Interpreter translates & executes a high-level language program statement-by-statement. A program statement is reinterpreted every time it is encountered during program execution. The main advantage of interpreter is that interpreter makes it easier & faster to correct programs. The main disadvantage is that interpreter is slower than compilers when running a finished program. Operating System An operating system is the most important software that runs on a computer. It manages the computer's memory and processes, as well as all of its software and hardware. It also allows you to communicate with the computer without knowing how to speak the computer's language. Without an operating system, a computer is useless. An operating system is a software program that provides an interface between user & the computer and manages thousands of applications. It’s a collection of system software that co-ordinates between the hardware, provides a platform for software to run on. An operating system is an integrated set of programs that the resources (the CPU, memory, I/O devices etc) of computer system & provides an interface to the user to run the machine. The main two primary objective of operating system are: o Making a computer system convenient to use o Managing the resources of a computer system Function of Operating System 1) Process Management: The process management of OS taking care about the creation & deletion of user & system process, providing mechanism for process synchronization & process communication. 2) Memory Management: The memory management of OS taking care about the allocation & deallocation of memory space to the various programs in need of this resource. 3) File Management: The file management of OS is taking care about the file related activities such as creation, storing, retrieving, naming, sharing & organization of files. 4) Security: The security model of OS protects the resources & information of a computer system against destruction & unauthorized access. 5) Command Interpretation: This model taking care of interpreting user commands & directing the system resources to handle the requests. Types of operating systems Microsoft Windows Microsoft created the Windows operating system in the mid-1980s. There have been many different versions of Windows, but the most recent ones are Windows 10 (released in 2015), Windows 8 (2012), Windows 7 (2009), and Windows Vista (2007). Windows comes pre-loaded on most new PCs, which helps to make it the most popular operating system in the world. MacOS MacOS (previously called OS X) is a line of operating systems created by Apple. It comes preloaded on all Macintosh computers, or Macs. Some of the specific versions include Mojave (released in 2018), High Sierra (2017), and Sierra (2016). According to Stat Counter Global Stats, macOS users account for less than 10% of global operating systems—much lower than the percentage of Windows users (more than 80%). One reason for this is that Apple computers tend to be more expensive. However, many people do prefer the look and feel of macOS over Windows. Linux Linux (pronounced LINN-ux) is a family of open-source operating systems, which means they can be modified and distributed by anyone around the world. This is different from proprietary software like Windows, which can only be modified by the company that owns it. The advantages of Linux are that it is free, and there are many different distributions—or versions—you can choose from. According to Stat Counter Global Stats, Linux users account for less than 2% of global operating systems. However, most servers run Linux because it's relatively easy to customize. To learn more about different distributions of Linux, visit the Ubuntu, Linux Mint, and Fedora websites, or refer to our Linux Resources. For a more comprehensive list, you can visit Make Use Of's list of The Best Linux Distributions. Operating systems for mobile devices The operating systems we've been talking about so far were designed to run on desktop and laptop computers. Mobile devices such as phones, tablet computers, and MP3 players are different from desktop and laptop computers, so they run operating systems that are designed specifically for mobile devices. Examples of mobile operating systems include Apple iOS and Google Android. In the screenshot below, you can see iOS running on an iPad. Operating systems for mobile devices generally aren't as fully featured as those made for desktop and laptop computers, and they aren't able to run all of the same software. However, you can still do a lot of things with them, like watch movies, browse the Web, manage your calendar, and play games. Software Application An application is a type of software that allows you to perform specific tasks. Applications for desktop or laptop computers are sometimes called desktop applications, while those for mobile devices are called mobile apps. App is a common term for an application, especially for simple applications that can be downloaded inexpensively or even for free. Many apps are also available for mobile devices and even some TVs. Desktop applications There are countless desktop applications, and they fall into several categories. Some are fuller featured (like Microsoft Word), while others may only do one or two things (like a clock or calendar app). Below are just a few types of applications you might use. Word processors: A word processor allows you to write a letter, design a flyer, and create many other types of documents. The most well-known word processor is Microsoft Word. Web browsers: A web browser is the tool you use to access the Internet. Most computers come with a web browser pre-installed, but you can also download a different one if you prefer. Examples of browsers include Internet Explorer, Mozilla Firefox, Google Chrome. Media players: If you want to listen to MP3s or watch movies you've downloaded; you'll need to use a media player. Windows Media Player and iTunes are popular media players. Games: There are many types of games you can play on your computer. They range from card games like Solitaire to action games like Halo. Many action games require a lot of computing power, so they may not work unless you have a newer computer. Mobile applications Desktop and laptop computers aren't the only devices that can run applications. You can also download apps for mobile devices like smartphones and tablets. Here are a few examples of mobile apps. Gmail: You can use the Gmail app to easily view and send emails from your mobile device. It's available for Android and iOS devices. Instagram: You can use Instagram to quickly share photos with your friends and family. It's available for Android and iOS. Logic Gates The world of today is dominated by digital systems – computers, smartphones, but also smart fridges or home automation systems that make our lives easier. In this context, advanced industrial systems are just too obvious to mention. Efficient operation of all such devices largely depends on smartly designed electronic systems equipped with processors, but also storage and data processing circuits. Each of these can be treated as a separate electronic component, but in reality, these chips are made up of a huge number of smaller elements referred to as logic gates. Logic gates are in turn made up of even smaller components, i.e. transistors. Logic Gates The fundamental building block of all digital logic circuits is the gate. Logical functions are implemented by the interconnection of 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, NOR, and XOR, X-NOR. Each gate is defined in three ways: graphic symbol, algebraic notation, and truth table. Note that the inversion (NOT) operation is indicated by a circle. 1. AND The AND gate is so named because, if 0 is called "false" and 1 is called "true," the gate acts in the same way as the logical "and" operator. The following illustration and table show the circuit symbol and logic combinations for an AND gate. (In the symbol, the input terminals are at left and the output terminal is at right.) The output is "true" when both inputs are "true." Otherwise, the output is "false." In other words, the output is 1 only when both inputs one AND two are 1. 2. OR The OR gate gets its name from the fact that it behaves after the fashion of the logical inclusive "or." The output is "true" if either or both of the inputs are "true." If both inputs are "false," then the output is "false." In other words, for the output to be 1, at least input one OR two must be 1. 3. NoT A logical inverter, sometimes called a NOT gate to differentiate it from other types of electronic inverter devices, has only one input. It reverses the logic state. If the input is 1, then the output is 0. If the input is 0, then the output is 1. 4. NAND The NAND gate operates as an AND gate followed by a NOT gate. It acts in the manner of the logical operation "and" followed by negation. The output is "false" if both inputs are "true." Otherwise, the output is "true." 5. NOR The NOR gate is a combination OR gate followed by an inverter. Its output is "true" if both inputs are "false." Otherwise, the output is "false." 6. XOR The XOR (exclusive-OR) gate acts in the same way as the logical "either/or." The output is "true" if either, but not both, of the inputs are "true." The output is "false" if both inputs are "false" or if both inputs are "true." Another way of looking at this circuit is to observe that the output is 1 if the inputs are different, but 0 if the inputs are the same. Example1 Q = A AND (B AND C) Step 1 – Start with the brackets, this is the “B AND C” part. Step 2 – Add the outer expression, this is the “A AND” part Example2 Q = NOT (A OR B) Step 1 – Start with the brackets, this is the “A OR B” part. Step 2 – Add the outer expression, this is the “NOT” part. Examples Q = (A OR B) AND NOT C Step 1 – Start with the brackets, this is the “A OR B” part. Step 2 – Add the outer expression, this is the “AND NOT C” part. Example : Find truth table Q = A AND NOT B. Step 1 – Build your inputs We have two inputs A and NOT B. So, we need 4 rows. Step 2 – Check to see if any of your inputs have been NOTed Yes – B has been NOTed, so add a column for NOT B. Step 3 – Build your expressions from your initial inputs Now we need to add the expression by comparing the A column and the NOT B column. As it is an AND gate, the output will be true if both inputs are true. Step 4 – Look at the final output Our expression is Q = A AND NOT B, so the values in column four is our answer. Algorithms and Flowcharts The word algorithm comes from the name of the person author -Abu Jafar Mohammed Ibn Musa Al khowarizmi who wrote A text book entitled-”Algorithmi de numero indorum” Now term” Algorithm ”in the title of the book led to the term Algorithm. An algorithm is an effective method for finding out the solution for a given problem. It is a sequence of instruction, that conveys the method to address a problem Algorithm : Step by step procedure to solve a computational problem is called Algorithm. or An Algorithm is a step-by-step plan for a computational procedure that possibly begins with an input and yields an output value in a finite number of steps in order to solve a particular problem. An algorithm is a set of steps of operations to solve a problem performing calculation, data processing, and automated reasoning tasks. Algorithms and Flowcharts A flowchart is simply a graphical representation of steps. It shows steps in sequential order and is widely used in presenting the flow of algorithms, workflow or processes. Typically, a flowchart shows the steps as boxes of various kinds, and their order by connecting them with arrows. What is a Flowchart? A flowchart is a graphical representation of steps. It was originated from computer science as a tool for representing algorithms and programming logic but had extended to use in all other kinds of processes. Nowadays, flowcharts play an extremely important role in displaying information and assisting reasoning. They help us visualize complex processes, or make explicit the structure of problems and tasks. A flowchart can also be used to define a process or project to be implemented. Flowchart Symbols Different flowchart shapes have different conventional meanings. The meanings of some of the more common shapes are as follows: Terminator The terminator symbol represents the starting or ending point of the system. Process A box indicates some particular operation. Document This represents a printout, such as a document or a report. Decision A diamond represents a decision or branching point. Lines coming out from the diamond indicates different possible situations, leading to different sub-processes. Data It represents information entering or leaving the system. An input might be an order from a customer. Output can be a product to be delivered. On-Page Reference This symbol would contain a letter inside. It indicates that the flow continues on a matching symbol containing the same letter somewhere else on the same page. Off-Page Reference This symbol would contain a letter inside. It indicates that the flow continues on a matching symbol containing the same letter somewhere else on a different page. Flow Lines represent the flow of the sequence and direction of a process. List of most Figures of Flow Chart Start End Input Out put Operation (process) condition Using a flowchart has a variety of benefits: It helps to clarify complex processes. It identifies steps that do not add value to the internal or external customer, including delays; needless storage and transportation; unnecessary work, duplication, and added expense; breakdowns in communication. It helps team members gain a shared understanding of the process and use this knowledge to collect data, identify problems, focus discussions, and identify resources. It serves as a basis for designing new processes. Uses of Flowcharts in Computer Programming/Algorithms It is a pictorial representation of an algorithm that increases the readability of the program. Complex programs can be drawn in a simple way using a flowchart. It helps team members get an insight into the process and use this knowledge to collect data, detect problems, develop software, etc. A flowchart is a basic step for designing a new process or adding extra features. Communication with other people becomes easy by drawing flowcharts and sharing them. Flowchart Example Print a value of a number? Simple Algorithms A flowchart can also be used in visualizing algorithms, regardless of its complexity. Here is an example that shows how flowchart can be used in showing a simple summation process. Another solution Draw the flow chart to find the area and circumference(perimeter) of the rectangle? Calculate the average of two numbers? Draw a flowchart to find the greatest number among the 2 numbers. Algorithm: 1. Start 2. Input 2 variables from user 3. Now check the condition If a > b, go to step 4, else go to step 5. 4. Print a is greater, go to step 6 5. Print b is greater 6. Stop Flowchart Draw a flowchart to check whether the input number is odd or even Algorithm: 1. Start 2. Put input a 3. Now check the condition if a % 2 == 0, goto step 5. Else goto step 4 4. Now print(“number is odd”) and goto step 6 5. Print(“number is even”) 6. Stop Flowchart Draws flow chart to find the highest of three numbers? Draw a flowchart to print the input number 5 times. Algorithm: 1. Start 2. Input number a 3. Now initialize c = 1 4. Now we check the condition if c