AKTU 1st Year Sem 1 Solved Paper 2014-15 | COMP. SYSTEM & C PROGRAMMING | Sec A

Paper download link: Paper | Sem 1 | 2014-15

B.Tech.
(SEM-I) THEORY EXAMINATION 2014-15
COMPUTER SYSTEM & PROGRAMMING IN C

Time: 3hrs
Total Marks: 100

Note:-

  • Attempt all questions. Marks are indicated against each question.
  • Assume suitable data wherever necessary.
  • 1. Attempt any FOUR parts: (5*4 = 20)

    1. What are the classifications of computer? Explain any two in detail.

      The computer systems can be classified on the following basis:

      1. On the basis of size.
      2. On the basis of functionality.
      3. On the basis of data handling.



      Classification on the basis of size

      1. Super computers : The supercomputers are the most high performing system. A supercomputer is a computer with a high level of performance compared to a general-purpose computer. The actual Performance of a supercomputer is measured in FLOPS instead of MIPS. All of the world’s fastest 500 supercomputers run Linux-based operating systems. Additional research is being conducted in China, the US, the EU, Taiwan and Japan to build even faster, more high performing and more technologically superior supercomputers. Supercomputers actually play an important role in the field of computation and are used for intensive computation tasks in various fields, including quantum mechanics, weather forecasting, climate research, oil and gas exploration, molecular modelling, and physical simulations. and also Throughout history, supercomputers have been essential in the field of cryptanalysis.
        eg: PARAM, jaguar, roadrunner.
      2. Mainframe computers : These are commonly called as big iron, they are usually used by big organisations for bulk data processing such as statics, census data processing, transaction processing and are widely used as the servers as these systems has a higher processing capability as compared to the other classes of computers, most of these mainframe architectures were established in the 1960s, the research and development worked continuously over the years and the mainframes of today are far better than the earlier ones, in size, capacity and efficiency.
        Eg: IBM z Series, System z9 and System z10 servers.
      3. Mini computers : These computers came into the market in mid 1960s and were sold at a much cheaper price than the main frames, they were actually designed for control, instrumentation, human interaction, and communication switching as distinct from calculation and record keeping, later they became very popular for personal uses with evolution.
        In the 60s to describe the smaller computers that became possible with the use of transistors and core memory technologies, minimal instructions sets and less expensive peripherals such as the ubiquitous Teletype Model 33 ASR. They usually took up one or a few inch rack cabinets, compared with the large mainframes that could fill a room, there was a new term “MINICOMPUTERS” coined
        Eg: Personal Laptop, PC etc.
      4. Micro computers : A microcomputer is a small, relatively inexpensive computer with a microprocessor as its CPU. It includes a microprocessor, memory, and minimal I/O circuitry mounted on a single printed circuit board. The previous to these computers, mainframes and minicomputers, were comparatively much larger, hard to maintain and more expensive. They actually formed the foundation for present-day microcomputers and smart gadgets that we use in day to day life.
        Eg: Tablets, Smartwatches.

      Classification on the basis of functionality

      1. Servers : Servers are nothing but dedicated computers which are set-up to offer some services to the clients. They are named depending on the type of service they offered. Eg: security server, database server.
      2. Workstation : Those are the computers designed to primarily to be used by a single user at a time. They run multi-user operating systems. They are the ones which we use for our day to day personal/commercial work.
      3. Information Appliances : They are the portable devices which are designed to perform a limited set of tasks like basic calculations, playing multimedia, browsing internet etc. They are generally referred to as mobile devices. They have very limited memory and flexibility and generally run on “as-is” basis.
      4. Embedded computers : They are the computing devices which are used in other machines to serve a limited set of requirements. They follow instructions from the non-volatile memory and they are not required to execute a reboot or reset. The processing units used in such device work to those basic requirements only and are different from the ones that are used in personal computers- better known as workstations.

      Classification on the basis of data handling

      1. Analog : An analog computer is a form of computer that uses the continuously-changeable aspects of physical fact such as electrical, mechanical, or hydraulic quantities to model the problem being solved. Anything that is variable with respect to time and continuous can be claimed as analog just like an analog clock measures time by means of the distance travelled for the spokes of the clock around the circular dial.
      2. Digital: A computer that performs calculations and logical operations with quantities represented as digits, usually in the binary number system of “0” and “1”, “Computer capable of solving problems by processing information expressed in discrete form. from manipulation of the combinations of the binary digits, it can perform mathematical calculations, organize and analyze data, control industrial and other processes, and simulate dynamic systems such as global weather patterns.
      3. Hybrid : A computer that processes both analog and digital data, Hybrid computer is a digital computer that accepts analog signals, converts them to digital and processes them in digital form.
    2. Describe the functionalities of an operating system.

      The fundamental goal of a Computer System is to execute user programs and to make tasks easier. Various application programs along with hardware system are used to perform this work. Operating System is a software which manages and control the entire set of resources and effectively utilizes every part of a computer.

      The figure shows how OS acts as a medium between hardware unit and application programs.

      Functions of an Operating System

      An operating system has a variety of functions to perform. Some of the prominent functions of an operating system can be broadly outlined as:

      • Processor Management: This deals with management of the Central Processing Unit (CPU). The operating system takes care of the allotment of CPU time to different processes. When a process finishes its CPU processing after executing for the allotted time period, this is called scheduling.
      • Device Management:
        The Operating System communicates with hardware and the attached devices and maintains a balance between them and the CPU. This is all the more important because the CPU processing speed is much higher than that
        of I/O devices. In order to optimize the CPU time, the operating system employs two techniques – Buffering and Spooling.
      • Buffering:
        In this technique, input and output data is temporarily stored in Input Buffer and Output Buffer. Once the signal for input or output is sent to or from the CPU respectively, the operating system through the device controller moves the data from the input device to the input buffer and for the output device to the output buffer. In the case of input, if the buffer is full, the operating system sends a signal to the program which processes the data stored in the buffer. When the buffer becomes empty, the program informs the operating system which reloads the buffer and the input operation continues.
      • Spooling (Simultaneous Peripheral Operation on Line):
        This is a device management technique used for processing of different tasks on the same input/output device. When there are various users on a network sharing the same resource then it can be a possibility that more than one user might give it a command at the same point of time. So, the operating system temporarily stores the data of every user on the hard disk of the computer to which the resource is attached. The individual user need not wait for the execution process to be completed. Instead, the operating system sends the data from the hard disk to the resource one by one.
        Example: printer
      • Memory management:
        In a computer, both the CPU and the I/O devices interact with the memory. When a program needs to be executed it is loaded onto the main memory till the execution is completed. Thereafter that memory space is freed and is available for other programs. The common memory management techniques used by the operating system are Partitioning and Virtual Memory.
      • Partitioning:
        The total memory is divided into various partitions of the same size or different sizes. This helps to accommodate a number of programs in the memory. The partition can be fixed i.e. remains same for all the programs in the memory or variable i.e. memory is allocated when a program is loaded on to the memory. The later approach causes less wastage of memory but in due course of time, it may become fragmented.
      • Virtual Memory:
        This is a technique used by the operating systems which allow the user can load the programs which are larger than the main memory of the computer. In this technique, the program is executed even if the complete program cannot be loaded inside the main memory leading to efficient memory utilization.
      • File Management:
        The Operating System manages the files, folders and directory systems on a computer. Any data on a computer is stored in the form of files and the operating system keeps information about all of them using File Allocation Table (FAT). The FAT stores general information about files like filename, type (text or binary), size, starting address and access mode (sequential/indexed sequential/direct/relative). The file manager of the operating system helps to create, edit, copy, allocate memory to the files and also updates the FAT. The operating system also takes care that files are opened with proper access rights to read or edit them.
    3. Convert the hexadecimal number A9C5.DB416 to octal number

      (A9C5.DB4)16
      = (1 010 100 111 000 101.110 110 110 100)2
      = (124705.6664)8
    4. (d) Draw a flowchart to find the sum and reverse of a given number.

    5. Discuss the various functionalities of compiler, linker and loader.

      Compiler –
      The language processor that reads the complete source program written in high level language as a whole in one go and translates it into an equivalent program in machine language is called as a Compiler.
      Example: C, C++, C#, Java

      In a compiler, the source code is translated to object code successfully if it is free of errors. The compiler specifies the errors at the end of compilation with line numbers when there are any errors in the source code. The errors must be removed before the compiler can successfully recompile the source code again.>



      Linker is a program in a system which helps to link object modules of a program into a single object file. It performs the process of linking. Linker is also called link editors. Linking is the process of collecting and maintaining a piece of code and data into a single file. Linker also link a particular module into a system library. It takes object modules from assembler as input and from the executable file as output for the loader.

      Linking is performed at both compile time when the source code is translated into machine code and load time when the program is loaded into memory by the loader. Linking is performed at the last step in compiling a program.

      Source code -> compiler -> Assembler -> Object code -> Linker -> Executable file -> Loader

      Loader is the program of the operating system which loads the executable from the disk into the primary memory(RAM) for execution. It allocates the memory space to the executable module in main memory and then transfers control to the beginning instruction of the program .

    6. What is storage class? Describe automatic, register, static and extern with neat syntax.

      Storage Classes are used to describe the features of a variable/function. These features basically include the scope, visibility and lifetime which help us to trace the existence of a particular variable during the runtime of a program.

      C language uses 4 storage classes, namely:

      1. auto: This is the default storage class for all the variables declared inside a function or a block. Hence, the keyword auto is rarely used while writing programs in C language. Auto variables can be only accessed within the block/function they have been declared and not outside them (which defines their scope). Of course, these can be accessed within nested blocks within the parent block/function in which the auto variable was declared. However, they can be accessed outside their scope as well using the concept of pointers given here by pointing to the very exact memory location where the variables reside. They are assigned a garbage value by default whenever they are declared.
      2. extern: Extern storage class simply tells us that the variable is defined elsewhere and not within the same block where it is used. Basically, the value is assigned to it in a different block and this can be overwritten/changed in a different block as well. So an extern variable is nothing but a global variable initialized with a legal value where it is declared in order to be used elsewhere. It can be accessed within any function/block. Also, a normal global variable can be made extern as well by placing the ‘extern’ keyword before its declaration/definition in any function/block. This basically signifies that we are not initializing a new variable but instead we are using/accessing the global variable only. The main purpose of using extern variables is that they can be accessed between two different files which are part of a large program. For more information on how extern variables work, have a look at this link.
      3. static: This storage class is used to declare static variables which are popularly used while writing programs in C language. Static variables have a property of preserving their value even after they are out of their scope! Hence, static variables preserve the value of their last use in their scope. So we can say that they are initialized only once and exist till the termination of the program. Thus, no new memory is allocated because they are not re-declared. Their scope is local to the function to which they were defined. Global static variables can be accessed anywhere in the program. By default, they are assigned the value 0 by the compiler.
      4. register: This storage class declares register variables which have the same functionality as that of the auto variables. The only difference is that the compiler tries to store these variables in the register of the microprocessor if a free register is available. This makes the use of register variables to be much faster than that of the variables stored in the memory during the runtime of the program. If a free register is not available, these are then stored in the memory only. Usually few variables which are to be accessed very frequently in a program are declared with the register keyword which improves the running time of the program. An important and interesting point to be noted here is that we cannot obtain the address of a register variable using pointers.

      To specify the storage class for a variable, the following syntax is to be followed:

      Syntax:

      storage_class var_data_type var_name; 


    7. My Personal Notes arrow_drop_up

      Technical Content Engineer at GeeksForGeeks

      If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

      Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




      Article Tags :

      Be the First to upvote.


      Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.