You are on page 1of 11

1

Unit-1
Q.1: What do you mean by digital computer system? Explain
all the functional units and subunits of it.
Ans: Definition of Digital computer:
A digital computer is an electronic device, which can perform
arithmetic and logical operations on data (strings of 0’s and
1’s) and converts it into information. It is also capable of
storing data.
Functional units of a computer system:
Every computer has four basic components- Input unit,
Memory unit, Central processing unit and Output unit.
Storage Unit

Secondary
Memory

Input unit Output unit


Primary Memory

Data Information

ALU CPU
register
s

Control Unit

Central Processing Unit


Input unit: The devices used to feed the data inside the
computer system are called input units.
Example: 1. Keyboard
2. Mouse
3. Joystick
4. Scanners
5. Touch screen
Central processing unit (CPU):
CPU is composed of a control unit and an arithmetic logic
unit.
 Arithmetic Logic Unit (ALU)
The Arithmetic Logic Unit of a computer system is the
place, where the actual execution of data takes place.
 Control Unit (CU)
The control unit acts as a central nerves system of the
computer system. It controls all the attached computer
hardware and peripherals.

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
2

Memory unit:
Memory unit is used to store the data inside the computer. It
has two types-
1. Primary or Main memory
2. Secondary or Auxiliary memory
Output unit:
The devices used to present the processed information by the
computer are called output units.
Example: 1. Monitor or Visual display unit(VDU)
2. Printer
3. Plotter
4. Projector
5. Voice response system
Q.2: Differentiate among High level language, Assembly
language and Low level language.
Ans:
High Level Assembly Language Low Level
Language Language

Easily Not
Less understandable
understandable understandable
Written in User Written in Alpha- Written in String
friendly codes numeric codes of 0’s and 1’s
Debugging is Debugging not
Debugging is easier
complex possible
Programs are Portable for same Portable for
portable interpreter same processor
Suitable for Suitable for
No translation is
software generating object
required
development code
Q.3: Write short notes on – Compiler, Interpreter, Assembler,
Linker, Loader and Editor.
Ans: Compiler: A compiler is a translator software used to
translate the High level language program into Low level
language program. It translates the whole program at once.

Compiler
High Level Language Low Level Language

Error Message
Interpreter: An Interpreter is a translator software used to
translate the High level language program into Low level
language program. It translates the program line-by-line.

High Level Language Low Level Language


Interpreter

Error Message
Assembler: An Assembler is a translator software used to
translate the assembly language program into Low Level
Language program.

Assembly Language Low Level Language


Assembler
Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
3

Linker: A Linker is a system software that combines two or


more programs to form an executable program.

Loader: A Loader is a system software that loads or copies


the program into computer memory.

Source Object Executable Object


Program Translator Program Linker Code Loader program
ready for
execution

Editor: Editor is a software used to create or edit the


program. For example: Text editor, Graphics editor.

Q.4: What is Operating system? What are the functions of


OS? Explain all the types of operating systems with example.
Ans: Operating system: Operating system is a system software.
It acts as an interface between user and computer hardware.
Functions of Operating system:

1- Memory management
2- Process management
3- File management
4- Security management
5- Network management
Computer
6- Device management
7- Loading and scheduling Hardware
8- Hardware configuration
9- Act as an interface Operating System
10- Act as an internal clock
Application software
Hardware
Types of Operating system:
User
1- Single-user Operating
system: If a single command can be executed at a
time. Example: Disk operating system (DOS).

System Software

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.SApplication


E C, Greater
Software noida)
4

2- Multi-user Operating system: If multiple commands


can be executed at a time.
Example: Windows, Unix, Linux etc.

Other classification of operating systems are-

Batch processing:
In Batch processing, similar types of programs are executed
in batches.
Multiprogramming:
In multiprogramming, multiple programs can be executed at
the same time.
Multi processing:
In multiprocessing, multiple processes can be executed at
the same time.
Time Sharing:
In time sharing systems the computer resources are used in
a time dependent fashion.
Real Time System:
In Real time systems the correctness of result is required
within a given time period.

Q.5: What is Memory hierarchy? Explain.


Ans: Memory Hierarchy: Memory hierarchy is a way for
classifying the memory devices on the basis of their
processing speed and storage capacity.

CPU
Register
s Storage capacity
Speed increases Cache Memory
increases
Main Memory

Secondary Storage

CPU registers: Processor registers are internal memory to


the central processing unit.
Cache memory: This is the fastest and most costly form of
storage. The most frequently accessed data are kept in cache
memory, so that they can be made available to the CPU on
demand without any delay.
Main memory: Main memory is the place where the data
goes first to be operated. It stores a few amount of data for a
limited period.
Secondary storage: It is a type of memory, which is used for
long-term storage of data. Data must be moved from it to
main memory to be operated. It is a permanent storage
device.

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
5

Q.6: What is software? What are the types of softwares?


Ans: A sequence of instructions, written in a language, which
can be understood by a computer, is called a computer
program.
“The term software refers to the set of computer
programs, procedures, and associated documents to
accomplish a specific task or group of tasks.”
Types of Software:
Most software can be divided in to two major categories-
1. System software
2. Application software

Types of Software

System Software Application Software

Standard Software Custom Software

System software:
System software is a set of one or more programs, designed
to control the operations and extend the processing
capability of a computer system.
Examples of System software:
1. Operating system, such as DOS, windows, Unix etc.
2. Programming language Translators, such as Compilers,
Interpreters etc.
3. Communication software
4. Utility programs

Application software:
Application software is a set
of one or more programs,
designed to solve a specific
problem or to do a specific
task.
Examples of Application
softwares:
1. Word-processing Hardware
software
2. Spread-sheet software System software
3. Graphics software
4. Educational software Application Software
5. Entertainment software
6. Personal assistance System software
User
software

System
Software
Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
6

Q.7: Differentiate among various operating systems like,


DOS, Windows, Linux and Android?
Ans:

DOS Windows Linux Android


It is an open It is a It is an open It is an open
source Licensed source source
Operating Operating Operating Operating
system. system. system. system.
It is a single It is a It is a It is a
user OS. multiuser OS multiuser OS multiuser OS
It supports It supports It supports It supports
command line graphical both the Graphical
interface. user interfaces user
interface. CLI and GUI. interface.
Use is limited, Most popular Linux is It is used for
specially for operating popular Mobile
hardware system. operating phones.
configuration. system.
Security is not Not reliable Most reliable OK
an issue. for security for security
point of view. point of view.
Available free of Must be Available free Available free
cost. purchased of cost. of cost.

Q.8: What is an algorithm? What are the characteristics of


algorithm?
Ans: Algorithm: An algorithm is a step by step description of
solution for the given problem. It may be defined as a
sequence of instructions designed in a manner that if the
instructions are executed in the specified sequence the
desired result will be obtained.
Characteristics of Algorithm:
1. Each and every instruction should be précised and
unambiguous.
2. Each instruction should be such that it can be
performed in a finite time.
3. One or more instructions should not be repeated
infinitely, this ensures that the algorithm will ultimately
terminate.
4. After performing the instructions, the desired result
must be obtained.

Example: Print 1 to 20:


Step 1: Initialize X as 0,
Step 2: Increment X by 1,
Step 3: Print X,
Step 4: If X is less than 20 then go back to step 2.
Q.9: What is Flow-chart? What are the basic symbols used in
Flow-chart? Also give the advantages and limitations of Flow-
chart.
Ans: Flow-Chart:
A flow-chart is a pictorial representation of an algorithm. It is
often used by programmers as a program planning tool to
solve a problem by computer.

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
7

Basic Flow-chart symbols:


It uses different types of boxes to denote different types of
instructions.
1. Terminal symbol: The terminal symbol is used to
indicate the beginning and end in the program logic
flow. It is represented by an oval or circle.

Start / Stop

2. Input/ Output symbol: The input / output symbol is


used to indicate any function of input or output devices.
It is represented by a parallelogram.

Input/Output

3. Process symbol: The processing symbol is used to


indicate arithmetic and data movement instructions. It
is represented by a rectangle.

Process

4. Decision symbol: The decision symbol is used to


indicate a point at which a decision has to be made. It is
represented by a diamond box.

Decision

5. Flow Lines: The flow lines are used to indicate the flow
of operation. These are represented by a straight line
with an arrow head.

Flow Lines

Terminal
6. Connector: The connector symbol is used to indicate an
entry from or exit to another part of the flow chart. It is
represented by a number or an alphabet within circle.

A Connectors
1

Advantages of Flow-charts:
1. Better communication: A flow chart is a pictorial representation of algorithm hence
it is easier for a programmer to explain the logic of a program.
2. Efficient coding: The flow-chart acts as a road map, so, it becomes easy to write
the corresponding program.

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
8

3. Systematic debugging: A flow-chart is very helpful in detecting, locating and


removing mistakes (bugs) in a systematic manner.
4. Systematic testing: Testing is the process of checking whether a program
successfully do all the jobs or not.

Limitations of Flow-charts:
1. Time consuming: Flow-charts are very time consuming to draw proper symbols for
large programs.
2. Not easy to modify: Due to symbol format it is not easy to change or modify the
flow-chart.

Example: Print 1 to 20:

Q.10: What is Pseudo-code? Explain with proper example.


Ans: Pseudo code: Pseudocode is a kind of structured english for describing algorithms.
It allows the designer to focus on the logic of the algorithm without being distracted by
details of language syntax.
Example:
1. READ height of rectangle
2. READ width of rectangle
3. COMPUTE area as height times width

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
9

Q. 11 Give the general structure/ basic layout of C program with


explaination.

General Structure of a C program:

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
10

Q. 12 What is Data type? Explain all the types of data types in detail.

Data type: Data type defines the size, range, format specifier of a
variable. Data type has three types-

Data types

Primary Derived User defined


data types data types data types
int array typedef
char structure enum
float pointer
double union

Data type Format Size (Bytes) Range


specifie
r

char or %c 1 -128 to 127


signed char

unsigned %u 1 0 to 255
char

int or %d 2 -32768 to +32767


signed int

unsigned int %ud 2 0 to 65535

short int %hd 1 -128 to +127

long int %ld 4 -2147483648 to


+2147483647

float %f 4 3.4E-38 to 3.4E+38

double %lf 8 1.7E-308 to 1.7E+308

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)
11

Q. 13 What is an identifier? What are the rules for making an identifier?


Identifier:
Identifiers are the names given to the program elements such as
variables, arrays and functions etc.
Rules for making Identifier:
 The first character must be an alphabet or an underscore.
 All succeeding characters may be either letters or digits.
 Uppercase and lowercase identifiers are different in C.
 No special symbols are allowed except the underscore.
 Keywords should not be used as identifier.
 Space is not allowed.
 Two consecutive underscores are not allowed.

Q. 14 What is keyword? What are the restrictions applied on keywords?


Keyword: In C language some words are reserved for specific task.
They have standard, predefined meaning for C compiler.
Restrictions on keywords:
1. Keyword must be written in lowercase case letters.
2. Keyword can not be used as identifiers.

Q. 15 What is a constant or literal? In how many ways we can define a


constant?
Constant: Constants in C refer to fixed values that do not change
during the execution of a program. C supports several types of
constants as follows:
CONSTANTS

Numeric constants Character constants

Integer Real Single String


constants constants character constants
constants
There are two ways to define a constant-
1. Defining Symbolic constant using #define statement
Example: #define PI 3.14
2. Defining variable as Constant- Using const keyword
Example: float const PI = 3.14;
Program: #include<stdio.h>
void main()
{
float const PI=3.14;
float r, h, v;
printf(“Enter the radius and height of cylinder”);
scanf(“%f %f”, &r, &h);
v = PI*r*r*h;
printf(“Volume= %f”, v);
}

Prepared by: Ashish Kumar Gupta (Dept. of CSE, I.T.S E C, Greater noida)

You might also like