Thursday, September 11, 2014

Global warming and green house effect

 The heating up of the earth surface due to trapping of infrared radiations reflected by earth's surface by CO2 layer in the atmosphere is called green house effect.

Some major green house gases and their sources:


GasSources
Carbon Dioxide
(CO2)
1)Fossil fuel combination (coal,oil,natural gas)
2) Deforestation and land use changes
Methane
(CH4)
1) Enteric fermentation in cattle and insects.
2) Biomass burning and garbage land fills
3) Leakage of gases from coal mines and natural gas.
4) Rice paddies
5) Swamps and tundra
Chloro fluoro carbon
(CFC'S)
1) Plastic foams
2) Refrigeration and air-conditioning
3) Aerosols (spray propellants) CFC'
4) Industrial solvents
Nitrous oxide
(N2O)
1) Fertilizer use
2) Fossil fuel combustion
3) Biomass burning
4) Changing land use

Global warming and green house effect

An increase in average temperature  of the earth's atmosphere due to green house effect which can have effects on climate and key life, support system of planet.
An increase in global temperature is also likely to increase the incidences of infections diseases like malaria, dengue, sleeping sickness and yellow fever.

Computer model predicts that during next 50 years the average temperature rise from 1.5 0 C to 3.5 0C.
Such a change ,which is very rapid by natural standards ,could have far reaching effects , especially at extreme levels .These could be in the form of
1) a rise in sea levels up-to 5 to 6 meters from the melting of ice cap and glaciers and the thermal expansions of sea water.
2) altered climate pattern altering ecosystems and
3) more extremes of weather .

Wednesday, September 10, 2014

Logarithm


LogarithmDefinition Logarithm :
If m= a x, where a>0 ,a not equal to 1 , m>0 then x is called the logarithm of m to the base a and is written as x = log a m, where m, a, x are real numbers.

Laws of logarithms:
1. Law of Product: log (A.B) =log A +log B
2. Law of Quotient : log(A/B) =log A - log B
3. Law of Exponent : log m n = n log m

Properties:
1)We have m = a x if and only if x = log a m.
2)Logarithms of negative numbers and zero are not defined.
3) a0 =1 Hence, 0 = log a 1
i.e. logarithm of 1 to any base is always zero.
4) a1 =a Hence , 1 = log a a
i.e. logarithm of any number to the same base is 1.
5) x = log a ax
6) If log a m = log a n then m = n
7)If a>1 and m>n then log a m > log a n and conversely.

Write logarithm form:
1) 5 3 = 125
Solution:
3 = log 5 125   (By definition of logarithm)

2) 8 3 =512
Solution:
3 = log 8 512   (By definition of logarithm)


Express in exponential form:
1) log 2 128 = 7
Solution: 128 = 2 (By definition of logarithm)

2) log 9 6561 =4
Solution: 6561 = 2 (By definition of logarithm)


Simplify : 
1) log 5 + 2 log 4
Solution:
=log 5 + log 42 (By Law of Exponent)
=log 5 + log 16
=log (5 . 16) (By law of Product)
=log 80

2) 2 log 7 - log 14
Solution:
=log 7 2 - log 14 (By Law of Exponent)
=log 49 - log 14
=log (49/14) (By law of Quotient)
=log (7/2)

3)log 3 + log 2 - 2 log 5
Solution:
=log 3 + log 2 - log 52 (By Law of Exponent)
=log 3 + log 2 - log 25
=log (3 . 2) - log 25 (By Law of Product)
=log 6 - log 25
=log (6/25) (By Law of Quotient)

4) 2 log 3 - 1/2 log 16 + log 12
Solution:
=log 3 2 - log 16 1/2 + log 12 (By Law of Exponent)
=log 9 - log4 + log 12
=log (9/4) + log 12 (By Law of Quotient)
=log (9/4 .12) (By Law of Product)
=log (9. 3)
=log 27


Prove that:
1) log 540 = 2 log 2 + 3 log 3 + log 5
Solution:
L.H.S = log (540)
=log (4 X 27 X 5)
=log ( 22 X 33 X 5)
=log 22 + log 33 + log 5 (By Law of Product)
=2 log 2 + 3 log 3 +log 5 (By Law of Exponent)
=R.H.S.
Hence, log 540 = 2 log 2 + 3 log 3 + log 5

OR

R.H.S =2 log 2 + 3 log 3 + log5
=log 2 2 + log 33 + log 5 (By Law of Exponent)
=log 4 + log 27 + log 5
=log (4 X 27 X 5) (By Law of Product)
=log 540
=L.H.S.
Hence, log 540 = 2 log 2 + 3 log 3 + log 5

2) log 360 = 3 log 2 + 2 log 3 + log 5
R.H.S =3 log 2 + 2 log 3 + log5
=log 2 3 + log 32 + log 5 (By Law of Exponent)
=log 8 + log 9 + log 5
=log (8 X 9 X 5) (By Law of Product)
=log 360
=L.H.S.
Hence, log 360 = 3 log 2 + 2 log 3 + log 5

OR

L.H.S = log (360)
=log (8 X 9 X 5)
=log ( 23 X 32 X 5)
=log 23 + log 32 + log 5 (By Law of Product)
=3 log 2 + 2 log 3 + log 5 (By Law of Exponent)
=R.H.S.
Hence, log 360 = 3 log 2 + 2 log 3 + log 5


Evaluate:
1) log 81/log 9
=log 92 / log 9
=2 log 9 / log 9   (By Law of Exponent)
=2

2)log 2 5 / log2 11 - log4 5 / log4 11
Solution :
We know ,Change of Base formula is log a m = log m /log a

=log 5/log 2/log 11/log 2 - log 5/log 4/ log 11 /log 4
=log 5 . log 2 / log 11 . log 2 - log 5 .log 4 / log 11 .log 4
=log 5 / log 11 - log5 / log 11
=0

Embedded systems


Difference between Static RAM Dynamic RAM.

Static RAM Dynamic RAM
1. SRAM1. DRAM
2. It retains it levels so no require refreshing2. It requires some refreshing.
3. Power consumption is more3. Power consumption is less.
4. Speed is fast.4. Speed is less.
5. Package density is low.5. Package density is high.
6. Size can't be increase.6. Size can increase.
7. More expensive.7. Less expensive.
8. Made up of 6 CMOS transistors(MOSFET).8. Made up of a MOSFET and a capacitor.



Difference between RISC and CISC processors/controllers.

RISCCISC
1. It stands for Reduced Instruction Set Computing.1. It stands for Complex Instruction Set Computing.
2. Lesser number of instructions.2. Greater number of Instructions
3. Instruction pipe-lining and increased execution speed.3. Generally no instruction pipe-lining feature.
4. Orthogonal instruction set.4. Non-Orthogonal instruction set.
5. Operations are performed on register only, the only memory operations are load and store.5. Operations are performed on register or memory depending on the instruction.
6. A large number of registers are available6. Limited number of general purpose register.
7. Programmer needs to write more code to execute a task since the instruction are simpler ones.7. Instructions are like macros in C language. A programmer can achieve the desired functionality with a single instruction.
8. Single, fixed length instructions.8. Variable length instructions
9. Less silicon usage and pin count.9. More silicon usage since more additional decoder logic as required.
10. With Harvard Architecture.10. Can be Harvard or Von- Neumann Architecture.



Difference between microprocessor and micro-controller.

MicroprocessorMicro-controller
1.A silicon chip representing a central processing unit (CPU), which is capable of performing arithmetic as well as logical operations according to a pre defined set of instructions.1.A micro-controller is a highly integrated chip that contains a CPU, scratchpad RAM, special and general purpose register arrays, on chip ROM / FLASH memory for program storage, timer and interrupt control units and dedicated  I/O ports.
2.It is a dependent unit .It requires the combination of other chips like timers, program and data memory chips, interrupt controllers, etc. for functioning.2.It is a self-contained unit and it doesn't require external interrupt controller , timer , UART , etc. for its functioning.
3.Most of the time general purpose in design and operation .3.Mostly application-oriented or domain - specific.
4. Doesn't, contain a built in I/O port.The I/O port functionality needs to be implemented with the help of external programmable peripheral interface chips like 8255.4.Most of the processor contain multiple built-in I/O ports which can be operated as a single 8 or 16 or 32 bit port or as individual port pins.
5.Targeted for high end market where performance is important.5.Targeted for embedded market where performance is not critical.
6.Limited power saving options compared to micro-controllers.6.Includes lot of power saving features.



Difference between Harvard Architecture and Von-Neumann Architecture.

Harvard ArchitectureVon-Neumann Architecture.
1.Separate buses for instruction and data fetching.1.Single shared bus for instruction and data fetching.
2.Easier to pipeline , so high performance can be achieved .2. Low performance compared to Harvard architecture
3.Comparatively high cost.3. Cheaper
4.No memory alignment problems.4. Allow self modifying codes.
5.Since data memory and program memory are stores physically in different locations, no chances for accidental corruption of program memory.5. Since data memory and program memory are stores physically in the same chip , chances for accidental corruption of program memory.



Sunday, August 31, 2014

Higher knowledge in education system

Education is a continuous process.In the new education system , more emphasis is put on the student and his learning abilities.The learning process has been given its due importance as compared to the teaching process.Hence, it is the aim of all the teaching aids like diagrams,charts,video clips,slides,etc. and methods to make the learning process simple,effective and enjoyable .In fact,rectification of all the queries  and difficulties of a student and motivating him to acquire higher and higher knowledge is the true aim of an education system.

Computers programs can also be developed to test a particular skill and knowledge of a student . Nowadays , some of the examinations are conducted on the computer itself and the results are declared within minutes. Hence the traditional evaluation methods can be replaced by automated evaluation methods.
Moreover,depending on the results of the evaluation,computers can also suggest the methods to improve the skill and knowledge of the student. We should not forget the fact that even some of the websites on the Internet conduct courses on various subjects.If required ,a student can also learn and obtain certificates or degrees on the Internet itself.



Taking into consideration all these facts, we come to the conclusion that the computer is becoming an integral part of our education system .Computers can be used as a valuable tool or resource in teaching and learning at all levels. All students must be encouraged to use computers for learning as well as solving of their problems.Expensive books,remote areas,over population,traditional and less effective teaching and learning aids and all other problems will be eliminated with the implementation of Computers Education in our education in our system.

Nowadays, Internet has become a valuable tool for education system. It is a great source of knowledge.Internet is useful for students as well as experts for obtaining the reference materials and related information on a variety  of subjects like history ,civics,commerce, science and technology , painting, music, entertainment , geography , mathematics , politics , etc. with help of various websites.Presentation is the most important factor of the learning process.For the  students of higher education , computer acts as a computational tool. It can be used to learn various languages.

Monday, August 25, 2014

Basic Programming

Basic Programming 



The way we have different editions of a book ,a programming language also advances by each version.

BASIC also has many versions. John Kemeny and Thomas Kurtz originally developed it at Dartmouth College around the mid -1960 s.It soon became very popular because of its simplicity .Later ,others followed it and developed MS-BASIC, GWBASIC, BASICA and QBASIC.Initally , Microsoft Corporation developed MS-BASIC. Writing programs and getting results was a slow process  and to overcome this limitation ,Microsoft developed its faster version QBASIC .Full form of QBASIC is Quick Beginners All Purpose Symbolic Instruction Code.

It is simple and easily available.

QBASIC has an inbuilt editor .Editor helps in creating ,editing and storing text program files.We can create ,execute and debug a program without leaving QBASIC which speeds up our work.

How to start QBASIC :

It can be started as stated below :

1.By double clicking QBASIC icon on the desktop ,if it exists on the desktop .
2.Clicking on Start  -->Run and typing qbasic.exe along with its full path in the open text box thereafter confirming it by clicking on O.K.
Whichever way we start ,the welcome dialog box gets displayed first and which can be cleared by pressing the Esc key .Thereafter ,we can continue programming.

Rules of BASIC language :

1. Ther should be one statement per line .
2. If a statement does not fit in one line, we can continue it in the next line by inserting semicolon (;) at the end of the first line .
3. A statement should be completed in maximum two lines.
4. Each statement should be numbered .Normally we give number at the interval of 10 .First of all ,it is easy to write and secondly ,if need  arises ,we can insert a statement without changing the other line numbers.

Components of the BASIC language :

Our language comprises of sentences. A sentence is nothing but a combination of words ,and while combining these words ,we follow some rules and norms which we call grammar .Similarly ,any programming language has sentences like statements . These statements comprise of commands and expressions .We can combine commands and expressions to create a set of instructions (program ) which solves a particular program .Each programming language has its own rule for writing statements .Each statement should be written with proper order of command and expression ,which is termed as syntax .Each command has its own syntax.

Some BASIC commands:

1. REM
Syntax  :  <Line no>REM<text message>
Using the REM command ,we can write comments wherever required.

2. LET
Syntax  :  <Line no >LET<text message>
example:
LET A=20
LET SUM=A+B

3. INPUT
Syntax  : <Line no>INPUT<text message>
example:
INPUT "Enter name and age";Name$,AGE

4. PRINT
Syntax  : <Line no >PRINT<print item>separator<print item>......
To print more than 1 item ,we have to use separator like comma or a semicolon.
example :
50 PRINT X,Y,Z
60 PRINT "X=";X,"Y=";Y
70 PRINT
80 PRINT A;B;C

5. READ-DATA
Syntax : <line no>READ<variable 1,variable 2,....>
<line no>DATA<value 1,value 2,....>
example
40 READ name$,age
50 PRINT "Your name is";name$
60 PRINT "Your age is ";age
70 DATA "Vijay",40

6. GO TO
Syntax: <line no>GO TO<line no>
example :150 GO TO 50

7. IF...THEN...ELSE
Syntax: <line no>IF condition >THEN n

8. FOR.....NEXT:
Syntax: <line no> FOR<variable>=formvalue >TO <to value>STEP <value>
<statement to be repeated>


 <statement to be repeated>

<statement to be repeated>


NEXT <variable>

9.LOCATE
Syntax: <line no > LOCATE x,y

10 CLS
Syntax :CLS command clears the screen .Normally it is used to start the program .
Example: 10 CLS

11. END :This command is used to instruct the end of the program
example: 70 END



Program to find area of a circle :

10 CLS
20 REM Program to find Area of Circle.
30 INPUT "Enter Radius";R...
40 LET Area = 3.14 *R^2
50 PRINT "Area of Circle with radius "R;"is";Area
60 END

Program :FOR ...NEXT LOOP

10 CLS
20 REM Repeat Action
30 FOR I=1 TO 5
40 PRINT "I Love My India"
50 NEXT I
60 ENd

RUN  (For this Pres F5)

I Love My India
I Love My India
I Love My India
I Love My India
I Love My India

 Program to print the squares of first 50 odd numbers:

10 REM Program to print the squares of first 50 odd numbers
20 CLS
30 PRINT "Number","Square"
40 PRINT "-----------------"
50 FOR I=1 To 99 STEP 2
60 LET SQ=I^2
70 PRINT I,SQ
80 NEXT I
90 END

Output:

Number      Square
   1                  1
   3                  9
   5                  25
   7                  49
    .                  .
    .                  .
   97                 9409
   99                9801

Program to prepare a table of any number

5  CLS
10 REM Program to prepare table of any number
20 INPUT "Enter Any Number -",N
30 LET X=1
40 S=N*X
50 PRINT N;"X";X;"=";S
60 X=X+1
70 IF X<11 THEN GO TO 40 ELSE PRINT "OVER"
100 END
RUN ---------------(Press F5 key)
Enter Any Number -----------(Suppose we have entered  17)

We get output:

17x1=17
17x2=34
and so on
17x10=170
OVER

GRAPHICS IN BASIC

Program to draw a circle

10 CLS
20 REM Program to draw a circle
30 SCREEN 1
40 CIRCLE(70,85),25
50 END





Wednesday, August 13, 2014

MS-Excel



1)Specify any one type of charts available in spreadsheet.
 

Answer: 
Bar graph, Column graph, Pie chart, Line graph, etc.

2)Give any one built-in function of spread sheet.
 

Answer:
 SUM(range) : This function returns the sum of all the numbers
in the list of arguments.
Example: =SUM(A2:E2)



3)What are macros in ESS?
 

Answer:
 Macro is a small program that caries out pre-defined series of steps by giving a few
keyboard shortcuts.
Macro is like a batch file created in dos. It contains a series of commands.
When a macro is called and run, the instructions given in it are executed one by one.



4)Differentiate between MAX( ) and MIN( ) built-in functions in a spread sheet.
 

Answer: 
MAX(num 1, num 2,……) : Returns the largest value in a set of values.
Example: =MAX(15, 25, 8, 14) returns 25
MIN(num 1,num 2……) : Returns the lowest value in a set of values.
Example: =MIN(15, 25, 8, 14) returns 8



5)Explain briefly built in functions in spreadsheet.
 

Answer:
SUM(range) : this function returns the sum of all the numbers
in the list of arguments.
Example: =SUM(A2:E2)
ABS(number) : It returns absolute value of a number.
Example: =ABS(-35)=35
SQRT(number) : This function returns a positive square root.
Example: =SQRT(5) equals 2.1928.
AVERAGE(num 1, num 2……) : Returns the average of the set of numbers.
Example: =AVERAGE(15, 25, 50) returns 30.




6)Explain Arithmetic functions of MS-Excel.
 

Answer:
SUM(range) : this function returns the sum of all the numbers
in the list of arguments.
Example: =SUM(A2:E2)
ABS(number) : It returns absolute value of a number.
Example: =ABS(-35)=35
SQRT(number) : This function returns a positive square root.
Example: =SQRT(5) equals 2.1928.
PRODUCT(num1, num2…) : It returns the product of all the
numbers given as arguments.
Example: =PRODUCT(5,8,2)=80





7)Explain DATE functions used in spreadsheets.
 

Answer: 
DAY(serial number) : It returns the day of the days corresponding to serial number or
date.
Example: DAY (“5-jan”)=5
MONTH(serial number) : It returns the month corresponding to serial number or date.
Example: MONTH(“6-may”)=5
NOW( ) : This function returns the serial number of the current date and time.
DATE(year, month, day) : Returns the serial number of a particular date.
Example: DATE: (2005,3,23) returns 38434.




8)Briefly explain advantages of spreadsheet.
 

Answer:
i. Built-in Functions: It has rich set of built-in functions to perform all types of
calculations such as sum, max, abs, product, etc.,
ii. Copying formula: Similar formula can be copied into any number of cells.
iii. Fill series: It is used to fill automatically fill numbers or data in a series of cells.
iv. Sorting: The data can be arranged in a specific order in a table.



9)Explain Logical functions in Ms-Excel.

Answer:
1. AND(logical1, logical2………) : This function returns TRUE if all its
arguments are true, returns FALSE if one or more arguments are FALSE.
Example: =AND(3<5, 8=8) returns TRUE
=AND(3>5, 8=8) returns FALSE
2. OR(logical, logical 2………) : It returns TRUE if one or more arguments are
TRUE, returns FALSE if all its arguments are FALSE.
Example: =OR(3<5, 8<>8) returns TRUE
=OR(3>5, 8<>8) returns FALSE
3. NOT(logical) : Reverses the value of its arguments.
Example: =NOT(3<5) returns FALSE
=NOT(3>5) returns TRUE
4. If(logical-test, value1, value2) : It returns value1 if logical test is true. If logical test is
false it returns value2.
Example: =If(85>80, “Dist”, “I Class”) returns “Dist”
=If(40>50, 100, 200) returns 200





Sunday, August 3, 2014

MOTHERBOARD

What is motherboard ? 
Or
Short Note on motherboard.

Answer:-

1)Motherboard specifically refers to a printed circuit board(PCB) with expansion capability and as the name suggests, this board is the "mother" of all components attached to it, which often include sound cards, video cards, network cards, hard drives, or other forms of persistent storage; TV tuner cards, cards providing extra USB or FireWire slots and a variety of other custom components .

2)It is the main circuit board in a computer.

3)A motherboard provides a way for hardware in a computer to communicate with each other.

4)The term mainboard is applied to devices with a single board and no additional expansions or capability, such as controlling boards in televisions, washing machines and other embedded systems.

5)An important component of a motherboard is the microprocessor's supporting chipset, which provides the supporting interfaces between the CPU and the various buses and external components. This chipset determines, to an extent, the features and capabilities of the motherboard.

6)It holds many of the crucial electronic components of the system, such as the central processing unit (CPU) and memory, and provides connectors for other peripherals.

7)Motherboards contain some non-volatile memory to initialize the system and load some start up software, usually an operating system, from some external peripheral device.






                                                           Figure :- Motherboard

Saturday, August 2, 2014

Solve sums of arithmetic



1. Find the smallest number which when diminished by 3,is exactly divisible by 21,28,36 and 45.

  Answer:-   1263  


2.If we multiply a fraction by itself and divide the product by its reciprocal , we get 1826/27. Find the original fraction.

Answer :-   2  2   
                       3



3. By what least number must 21,600 be multiplied to make it a perfect cube?

Answer :-  10


4.Solve
  0.5 * 0.05 * 0.005 * 50

Answer:-  0.006250


5. The value of a machine depreciates at the rate 10% every year. It was purchased 3 years ago.If its present value is Rs 8,748 , find its purchase price.

Answer :-  Rs 12,000



6. On a journey across Delhi , a taxi averages 30 kmph for 60% of the distance,20kmph for 20% of it and 10 kmph for the remainder. Find the average speed for the whole journey.

Answer:-  20 km per hr


7. A mixture contains alcohol and water in the ratio of 4:3 .If  7 litres of water is added to the mixture, the ratio of alcohol and water becomes 3:4 . Find the quantity of alcohol in the mixture.

Answer:-  12 litres


8. A and B can do a piece of work in 12 days, B and C in 15 days,C and A in 20 days.In how many days A alone will do the work?

Answer:-  30 days


9. At a certain rate of simple interest, a certain sum doubles itself on 10 years,it will treble itself?

Answer:-  20 years



10. If the ratio of the areas of two squares is 9:1 ,then what will be the ratio of their parameters?

Answer:-  3:1


11. If a commission of 10% is given on the written price of an article ,the gain is 20 % .Find the gain percent if the commission is increased to 20 %.

Answer:-  6  2 %
                     3



Wednesday, July 30, 2014

Question and answer




1. Name the components of CPU
Answer:
a) ALU    b) PC   c) Accumulator   d) MAR   e) IR    f) ID   g) MDR



2. What is the use of registers in CPU?
Answer:
It is used to store intermediate data and instructions.



3. What is the function of MAR?
Answer:
It specifies the address of memory location from which data or instruction is to be accessed or to which the data is to be stored.



4. What is the function of MDR / MBR?
Answer:
It contains the data to be written into or read from memory location addressed by MAR.



5. What is program counter?
Answer:
It keeps track of the memory address of the instruction that is to be executed next.


6. What is the function of IR?
Answer:
It contains the instruction that is being executed.


7. What is the purpose of Instruction Decoder?
Answer:
It decodes the instructions.


8. What is a data bus?
Answer:
It carries a word to or from memory.


9. What is an address bus?
Answer:
It carries memory address. The width of address bus equals the number of bits in the MAR.


10. What is the function of control bus?
Answer:
It carries signals between the units of the computer.


11. Name different I/O ports.
Answer:
Port is a socket on the back of computer. Different types of ports are serial ports, parallel ports and USB ports.


12. What is meant by plug and play cards?
Answer:
It enables the user to add devices to computer.


13. Expand SD RAM.
Answer:
Synchronous Dynamic Random Access Memory.


14. Expand DDR RAM.
Answer:
Double Data Rate Random Access Memory.


15. Write a note on components of motherboard.
Answer:
1) Bus : -
a. Address Bus
b. Data Bus
c. Control Bus
2) Expansion slots: They serve the purpose of adding functionality to the computer.
a. ISA : Industrial standard architecture.
b. PCI : Peripheral component interface
c. AGP : Accelerated Graphic port.
3) CACHE Memory: It is a small fast memory that resides between CPU and main memory.
4) CMOS : Complementary Metal Oxide Semiconductor Battery
5) I-O Ports ( Input –Output Ports ): Serial , Parallel , USB etc.


16. Explain the different factors affecting the processing speed of CPU.
Answer:-
CPU Speed/Clock speed: Speed of CPU also known as clock speed. The clock speed is the
number of instructions executed by the CPU in one second It is measured in megahertz(million
instructions per second). The average speed of a new CPU is about 1000MHz to 4000 MHz.(1 to 4 gigahertz).
Instruction set: The number of instructions decide the efficiency of a CPU. More the instructions, less efficient is the CPU and less the instructions, More efficient is the CPU.
Word size/Register size: The size of registers determines the amount of data the computer can work with at a time. Normally it is 32 bits. Smaller the size of register, slower will be the computer. . It is also known as Word size. It varies from 16 bits to 128 bits.
Data bus capacity: Width of a data bus determines the largest number of bits that can be transported at one time.
Cache Memory size: Cache memory is a high speed memory. Greater the cache, faster a processor runs. Most modern processors can execute multiple instructions per clock cycle which speeds up a program. Some CPU’s have storage for instructions and data built inside the processor chip . This is called internal cache or L1 cache memory.
Memory Size: The amount of PRIMARY STORAGE (RAM) determines the size of program that can be kept in primary storage, which is faster than secondary storage. There by the speed of computer increases. The size of RAM varies from 64 MB to 4 GB.


17. Explain USB Port (Universal Serial Bus).
Answer:
a. It is a high speed serial bus
b. It is a plug and play interface between computers and add on devices.


18. Give the specifications of Laser printer.
Answer:
a. Resolution varies from 600 to 1200 dots per inch.
b. Speed varies from 4 PPM to 24 PPM.
c. Buffer size varies from 4MB to 32 MB
d. Can print color images.


19. Give the specifications of dot matrix printer.
Answer:
a. Print head normally has 9 pins to 24 pins.
b. Speed varies from 30 to 300 characters per second.
c. Buffer size varies from 1K to 64 K.


20. Give the specifications of inkjet printer.
Answer:
a. Resolution is around 300 dots per inch.
b. Speed varies from 1PPM to 12 PPM
c. Buffer size varies from 1 MB to 4 MB.


21. Write a note on computer maintenance.
Answer:
a. Avoid heat dust and noise
b. Periodic updates and enhancements
c. Installing fire walls and anti virus.
d. In house software maintenance
e. Computer periodic checkup.


22. What are the possible threats to a computer system and how to provide security?
Answer:
Threats
a. Privacy
b. Integrity
c. Environmental damage
d. Human threats
e. Software threats
f. Unauthorized access
g. Computer viruses
Security
a. Physical protection of machine and media.
b. Giving passwords and users ID
c. Using Licensed software
d. Use of Cryptography
e. Use of Spike busters and UPS


23. Explain the typical causes of computer failures.
Answer:
a. Break down of components.
b. Excessive dust or humidity
c. Virus
d. Voltage fluctuation
e. Corrosion


24.Write a note on Computer virus.
Answer:
Viruses are collection of coded instructions which are self replicating. When a virus attaches itself to another file it infects it. They are normally inactive until infected program is run.
They are broadly classified into three categories.
a. Boot infectors
b. System infectors
c. Executable program infectors
a.Boot infectors: Create bad sectors. They remain in the memory until the system is shutdown.
b.System infectors: It infects the hard disk or boot-able floppies which may contain system files.
c.Executable program infectors: These are dangerous and devastating. They spread to almost any executable program attaching themselves to programming files.


25. Explain the General Structure of CPU.
Answer:
Program counter: This register stores address of next instruction to be executed.
Memory address register (MAR): This register specifies address in memory where information can be found. This register is also used to point to a memory locations where information can be stored.
Memory buffer register: This register acts as an interface between CPU and memory. When CPU issues a Read Memory command, instruction is fetched and placed in MB register.
Instruction register:This stores a copy of current instruction.
Instruction decoder (ID): ID is an electronic hardware, which decodes instructions. The instructions are further broken down into a set of micro operations, so that they can be executed directly.
General purpose registers: They are used to store data. There are 6 GP registers. These are used for storage of data as needed by the program.
Arithmetic Logic Unit: The basic arithmetic operations such as addition, subtraction, multiplication and division are carried out here. These operations need at least two operands, one which is stored in accumulator and the other in the MBR. After the manipulation of data in ALU, the result is transferred to accumulator.
Accumulator: During processing the intermediate data needed for future processing is stored in
accumulator. The contents of ACC are used by ALU for operations and later by MBR holds the final result for further action.


26. Explain the cache memory in detail.
Answer: 
Cache memory is a small and fast memory between CPU and main memory. It is extremely fast compared to normal memory. Transferring data between main memory and CPU causes delay because RAM is slower than CPU. Cache memory stores copies of data from most frequently used main memory locations. When processor needs to read from or write to a location in main memory, it first checks whether a copy of data is in the cache. If so processor immediately reads or writes to cache. Computers use multilevel of cache such as Level1(smallest)and Level2 cache.CPU resident cache is known as L1 or primary cache (16 to 32 KB) to 512 KB.Cache is also added to mother board also known as L2 cache (512 KB to 1024 KB). Higher end systems can have as much as 2 MB of L2 cache on mother board.



Monday, July 28, 2014

Functions based Qs and answer in C programming

1. What is a function?
Answer:-
A function is a small segment of the program(sub program) designed to perform a specific task and return a result to the main or calling program.


2. What are the different types of functions supported in “C” language?
Answer:-
C supports two types of functions. They are
1. Built-in / Library functions
2. User defined functions



3. What are library functions?
Answer:-
Some of the operations are programmed and stored in C library so that they can be called in the program. These functions are called as library functions.
Eg : printf(), sqrt(), pow()


4. What is a user defined function?
Answer:-
A user-defined function is a complete and independent program unit, which can be used(or invoked) by the main program or by other sub-programs.



5. Mention the need for a function
Answer:-
If there are a number of statements that are repeatedly needed in the same program at different locations,then a function may be used.




6. What do you mean by a calling function?
Answer:-
Once the function is created it can be called from the main program or from any other function. This main program or the function which calls another function is called calling function.




7. What is a called function?
Answer:-
The user-defined function which is called by the main program or from any other function is known as called function.




8. What does the return-type-specifier of a function identify?
Answer:-
It identifies the type of value, which will be sent back after the function has performed its task (eg: int, float).




9. Why is the return type void used?
Answer:-
The return type void is used if the function does not return any value to the calling function.




10. What is an argument?
Answer:-
Information or values are passed to the function through special identifiers are called arguments.




11. What are actual parameters?
Answer:-
The arguments (values) which are passed to the function when a function call is made are called actual parameters.



12. What are formal parameters?
Answer:-
The arguments which are used in the argument list of the function header to receive the values from the calling program are called formal parameters or dummy parameters.




13. Give the syntax of a function call?
Answer:-
A function call has the following syntax:
variable = function_name(arg1,arg2…);
where arg1, arg2… are the actual parameters.




14. How is a function invoked?
Answer:-
A function is invoked(or called) through an output statement or through an assignment statement by using the function name followed by the list of arguments.Example: p = prod(x, y);



15. What is the use of the return statement?
Answer:-
The return statement is used in the body of the function which contains the value that has to be sent back to the main program.




16. Give the syntax of return statement?
Answer:-
The return statement can take one of the following forms return; Or return(expression);The first form does not return any value, where the second function returns the value of the expression.




17. What are local variables?
Answer:-
Variables declared inside a block or function are said to belong only to that block and these are called as local variables. Values of these variables are valid only in that block.




18. What are global variables?
Answer:-
Variables declared before the main function block are called global variables. Values of these variables are available in every block of that program.




19. What is function prototype?
Answer:-
A function must be declared before it is actually called. The declaration of a function is known as function prototype.




20. Give the syntax of a function prototype.
Answer:-
return-type function-name (type1, type2);
Ex: float power(float, int);




21. Define the term recursion.
Answer:-
A function which calls itself directly or indirectly again and again until a condition is satisfied is called as recursive function. This process is called recursion.




22. How do we pass an entire array to a function?
Answer:-
To pass an entire array to a called function only the array name without a subscript is used as argument(actual parameter).
Ex: void main( )
{
int a[100], n;
. . . . . . . . . .
sort(a, n); (where sort is the function name)
}




23 What is meant by scope of a variable?
Answer:-
1. The name of the variable.
2. The amount of space required to store that variable.
3. Address of the memory location.
4. The possible operations, which can be performed with the variable.




24. What are storage classes?
Answer:-
A storage class refers to the scope and life time of a variable i.e., the portion of program where the variable is valid and how long a variable can retain its value is defined
in the storage class.




25. What are the different types of storage classes?
Answer:-
1. Automatic storage class
2. External storage class
3. Static storage class
4. Register storage class



26 does Register variable have address?
Answer:-
No. (CPU registers do not have addresses).




27. Give the differences between library functions and user-defined functions.

Answer:-
Library functions :-
i. Some of the operations are programmed and stored in C library so that they can be called in the program. These functions are called as library functions.
ii. Library functions are in-built functions.

User-defined functions :-
i. Large programs can be broken down into smaller sub programs or modules. These sub programs are called user-defined functions.
ii. User-defined functions are created by the user.




28. What is a function call? What is the syntax of a function call?
Answer:-
To execute a function we will have to call the function. A function call establishes a link between the called function and the calling program.
A function call has the following syntax:
variable = Function_name (arg1, arg2…);
where arg1, arg2… are the actual parameters.




29. Why is the return statement is required in a function body?
Answer:-
When a function is called control is transferred from the calling function (main program) to the called function (sub-program). The statements of the called function are executed and finally the called function is terminated and sends the required result back to the calling function. The return statement is used to send the result from the function to the main program, thus terminating the called function.
The syntax is: return;
Or
return(expression);
The first form does not return any value, where the second function returns the value of the expression.




30. What is a function prototype? When is a function prototype necessary?
Answer:-
The declaration of a function before it is used is called as function prototype. A function prototype contains the data type of arguments sent as input to the function and data type of the result sent back from the function
Syntax: data_type function_name(data_type1,data_type2,….);
Example: float power(float, int);




31. Explain user defined function with an example
Answer:-
User defined function is a subprogram that is called by a main() function or any other function.
A user defined function may appear before or after the main() function. The general syntax of function definition is as follows:
Return_type_ specifier Function_name (type arg1, type arg2….)
{
local variable declarations; argument list
statement1;
statement2;
… Body of the function
statement n;
return (expression);
}
Return data type- indicates the data type of variable sent back from called
function to calling function
Function name- indicates the name of the function .It is an identifier
Argument list- list of input variables and their data-types received from calling
function
Local variable declaration-list of data that required only for the function block in which they are declared.
Body of the function-It includes declaration part (local variables) and a set
of executable statements which will perform the required task.
Return statement- indicates termination of function and transfer of control from called
function to calling function
Example:
int sum(int a,int b)
{
int c;
c=a+b;
return(c);
}




32. Mention different types of functions.
Answer:-
The different types of functions are
1. functions with no input and no return value
2. functions with input and no return value
3. Functions with input and return value
4. Recursive functions




33. What are storage classes? Mention different types of storage classes. Explain
Answer:-
A storage class refers to the scope of data in a program. Scope of data means the portion of the program in which the variable is valid(mian() as well as sub
programs) and lifetime of the variable.i.e., the length of time to which the variable
retains its value.

A variable must belong to any one of the following storage classes.
1. Automatic storage class
2. External storage class
3. Register storage class
4. Static storage class

Automatic storage class :-
Automatic storage class is similar to local variable declaration
Key word auto precedes the declaration
Ex:
auto int x,y,z;
• Automatic variables are local variables
• The variables are stored in memory(RAM)
• The key word auto is implicit(it means even without the word auto the
variable is automatic)
• Initial value stored is junk

External storage class :-
External storage class is similar to global variables.
Keyword extern precedes the declaration
Ex:
Extern int m,n;
• Scope of the variable is global
• The variables are stored in memory
• Needs explicit(must use the keyword)declaration
• Initial value stored is junk

Register storage class :-
Register storage class is used when data is needed in cpu registers
Key word register must precede the declaration
Ex:
register int x,y;
• Scope of the variable is local
• The variables are stored in registers
• Needs explicit declaration
• Initial value is not known

Static storage class:-
Static storage class is used in function blocks. The static variable can be initialized exactly once when the function is called for the first time. For subsequent calls to the same function, the static variable stores the most recent value.
Key word static precedes the variable declaration
Ex: static int x,y,z;
• Scope of the variable is local
• The variables are stored in memory
• Needs explicit declaration
• Default Initial value is stored is 0.


Featured posts

Happy Independence Day August 15th

 Here's a message for India's Independence Day (August 15th): "शुभ स्वतंत्रता दिवस! आजादी की 79वीं वर्षगांठ पर, आइए हम अपने देश...

Popular posts