Friday, 26 June 2015

Computer Science Note Part-1 - BOOLEAN ALGEBRA, HOW A CPU WORKS, OPERATING SYSTEM...

Contents
1.   DEFINE BOOLEAN ALGEBRA
2.   COMPLEXITY OF THE QUICKSORT ALGORITHM
3.   BRIEFLY DESCRIBE HOW A CPU WORKS WITH THE HELP OF BASIC BUILDING BLOCK DIAGRAM WITH AN EXAMPLE
4.   ASSEMBLY  LANGUAGE
5.   OPERATING  SYSTEM
6.   ANALOG COMPUTER AND DIGITAL COMPUTER
7.   COMPUTER  PROGRAMMING  LANGUAGE


ü   DEFINE BOOLEAN ALGEBRA
   A class of elements B together with two binary operations + and . is a Boolean algebra, if the fooling for postulates hold :-
          P1:- Both the operations + and .  are commutative, i.e. for any two elements a and b of B, a+b=b+a and ab=ba.
          P2:- Each of the operations + and . are distributive over the other, i.e., for any elements a, b and c in B, a+b∙c=(a+b)∙(a+c) and a(b+c) =a∙b+a∙c .
          P3:- There exist in B distinct is identity elements 0 and 1 (0 ≠1) for the operations + and ∙ respectively, such that for any element a of B. a+0=0+a=a and a∙1=1∙a=a.
           P4:-For every element a of B, there exists an element a’ (called the complement of a) in B, such that a+a’=1 and a∙a’=0.


ü   COMPLEXITY OF THE QUICKSORT ALGORITHM

         The running time of a sorting algorithm is usually measured by the number f(n) of comparisons required to sort n elements. The algorithm has a worst-case running time of n2/2, but an average-case running time of other n log n.
          The 1st elements will require n-comparisons to recognize that it remains in the 1st position. The 1st sub list will be empty, but the 2nd sub list will have n-1 elements. The 2nd element will require n-1 comparisons to recognize that it the 2nd position. And so on. Consequently, there will be a total of f(n)= n+(n-1)+……+2+1= n(n+1)/2 = n2/2+0(n)=0(n)2 comparisons.
       The complexity f(n)=0 (n log n) of the average case come from the fact that, on the average,  each reduction step of  the algorithm produces two sub lists.   Accordingly,
1.    Reducing the initial list places 1 element and produces two sub lists.
2.    Reducing the two sub list places 2 elements and produces four sub lists.
3.    Reducing the four sub list places 4 elements and produces eight sub lists.
4.    Reducing the eight sub list places 8 elements and produces sixteen sub lists.
        And so on. Hence, here will be approximately log2n levels of reductions steps. Each level uses at most n- comparisons, so f(n)=0(n log n). Mathematical analysis and empirical evidence have both shown that, f(n)≈1∙4[n log n] is the expected number of comparisons for the quick sort algorithm.



ü   BRIEFLY DESCRIBE HOW A CPU WORKS WITH THE HELP OF BASIC BUILDING BLOCK DIAGRAM WITH AN EXAMPLE
INPUT UNIT::- A computer accepts the coded information through the input unit. The simplest is the keyboard which is electronically connected to the processing part of the computer. Other example is mouse which is one of the important components in the GUI environment. Here GUI means graphical user interface.
MEMORY UNIT::- the function of the memory unit is to store programmers and data. there are two classes of memory devices called the primary and secondary storage.
          The primary memory or the main memory or the main memory is a fast memory capable of operating at the electronic speeds. Programmes are stored in main memory during their execution. The main consists of a large number of semi conductor storage cells each capable of storing I bit of information. Instruction and data can be written into the memory and read out under the control of a processor. The secondary memory unit may be used to data information and final output.
ARITHMATIC AND LOGICAL UNIT ::- This unit does the octal processing (arithmetic and logical operations) under programmes  control. It performs the additions, subtraction, multiplication and divination as arithmetical operation and also the logical operation like AND, OR, NOT etc. The ALU works under the directions of control unit.
CONTROL UNIT::-the control unit selects, interprets and corries out the execution of program instruction in their proper sequence. The operations in the ALU are also carried out under the supervision of cu unit.
OUTPUT UNIT::- The output unit is the reverse order of the input unit. Its main function is to send information to the outside would i.e. the output devices are used to record the results obtained by the computers and present them to the outside world. Common output device are VDU, printer etc.   
         The input devices are used to transfer information into the memory unit of the computer under the direction of cu. Each instruction is retrieved in proper squeegee from the memory and interpreted. Control unit signals the ALU about the precise operation to be performed and transferred to the ALU necessary data for operation. The ALU then carries out all computations and comparisons. Results are then passed to the main memory for temporary storage and are finally terns fared to output devices. All these events take place under the direction of control unit.

ü   ASSEMBLY  LANGUAGE
   The writing of program in machine languages is very difficult, tiresome and boring job for a programmer. Moreover, it is error prone. To solve this problem and to facilitate programmer easily understandable languages have been developed. Assembly language is one of them. Programs can easily be written in alphanumeric symbols instead of 0s and 1s. Meaningful and easily remember-able symbols are selected for this purpose. For example, ADD for addition, SUB for subtraction, CMP for comparison, etc. Such symbols are known as mnemonics. A program written in mnemonics is called assembly language program. (The writing of programs in assembly language is easier and faster as compared to the writing of programs in a machine language.)



ü   OPERATING  SYSTEM
      An operating system can be regarded as a set pf ptogrammes which permit the continuous operation of a computer from programme to programme with the minimum amount of operator intervention, it acts as an interface between the operation, computer and the processing programme. According to ANSI (American National Standard Institute) the definition of an operating system is the software which control the execution of the computer programme and which may provide scheduling, debugging, input/output control, account, compilation, storage assignment, data management and related services.
        An operating system may thus be defined as a set of system programmes that control and coordinate the operation of a computer system. Some of the major facilities provided by a modern system are:-
1)    Easy interaction between human and computer.
2)    Starting computer programmes automatically when the power.
3)    Loading and scheduling users programme along with necessary computers.
4)    Controlling input and output.
5)    Controlling programme execution.
6)    Scheduling processes.
7)    Managing us of main memory.
8)    Managing and manipulating files.
9)    Providing security to users jobs and files.
10)          Accounting resource wage.
                          Every operating system is a kernel which permanently resides in the main memory of a computer to perform some and of the basic functions of operating system and access other portion as they needed. The reaming in part of the operating system are normally stored in the disc ready to be loaded into the main memory when required and order to do by the kernel.                                                                            OPERATING  SYSTEM

ü   ANALOG COMPUTER AND DIGITAL COMPUTER
       Many physical systems can be described mathematically by differential equations whose solutions as a function of time give the complete mathematical behavior of the process. An analog computer performs a direct simulation of a physical system. Each section of the computer is the analog of some particular portion of the process under study. The variables in the analog computer are represented by continuous signals, usually electric voltages that vary with time. (The signal variables are considered analogous to those of the process and behave in the same manner. The term analog signal is sometimes substituted for continuous signal because analog computer has come to mean a computer that manipulates continuous variables.)
      To simulate a physical process in a digital computer, the quantities must be quantized. When the variables of the process are presented by real-time continuous signals, the latter are quantized by an analog-to-digital conversion device. A physical system whose behavior is described by mathematical equation is simulated in a digital computer by means of numerical methods. When the problem to be processed is inherently discrete, as in commercial application, the digital computer manipulates the variables in their natural from.                                                                                                                                                                                                            ANALOG COMPUTER AND DIGITAL COMPUTER      
                                          
ü   COMPUTER  PROGRAMMING  LANGUAGE
A programming language is a language of computer programming which establishes communication between user and the computer. It easily consists of all symbols, characters and all the rules of using them so that it becomes easily understandable to the computer. Every programming language contains instruction of the following types-----1) input, output, 2) calculation/manipulation 3) logic/compression 4) storage/retrieval.
The programming language may be broadly described into two categories à             
                       1) Low level language and     2) High level language.
                                                                                                 





No comments:

Post a Comment