JANARDHAN'S BLOG
Wednesday, August 19, 2015
What are the best interview questions on OOPS you've been asked?
Sunday, July 7, 2013
FUNDAMENTALS OF 'C' LANGUAGE AND COMPUTERS
FUNDAMENTALS
COMPUTER :- IT IS AN ELECTRONIC DEVICE, WHICH IS USED TO PERFORM CALCULATIONS. IT TAKES INPUT FROM THE USER, PROCESS IT AND FINALLY PRODUCES OUTPUT TO THE USER.
INPUT :- IT IS A REQUEST / INSTRUCTION / COMMAND TO THE COMPUTER WHICH IS GIVEN BY THE USER.
INPUT DEVICES :- KEYBOARD, MOUSE, SCANNER
OUTPUT :- IT IS RESPONSE FROM THE COMPUTER TO THE USER.
OUTPUT DEVICES :- MONITOR / SCREEN / CONSOLE / VDU (VISUAL DISPLAY UNIT), PRINTER, PLOTTER
CPU :- IT STANDS FOR CENTRAL PROCESSING UNIT, WHICH IS THE HEART OF THE SYSTEM. ALL OPERATIONS ARE DONE IN CPU. IT CONTAINS 3 SUB UNITS AND THOUSANDS OF SUB SUB UNITS.
1) MU 2) CU 3) ALU
MU :- IT STANDS FOR MEMORY UNIT, WHICH STORES INFORMATION.
ALU :- IT STANDS FOR ARITHMETIC LOGICAL UNIT, WHICH PERFORMS ALL CALCULATIONS.
CU :- IT STANDS FOR CONTROL UNIT, WHICH CONTROL ALL OTHER UNITS.
COMPUTER / SYSTEM :- IT IS A COMBINATION OF HARDWARE AND SOFTWARE. BOTH HARDWARE AND SOFTWARE ARE INTERDEPENDENT.
HARDWARE :- WHICH ARE PHYSICALLY VISIBLE PARTS OF THE COMPUTER.
EX :- KEYBOARD, MOUSE, MONITOR
SOFTWARE :- WHICH ARE PHYSICALLY NOT VISIBLE TO THE USER. SET OF PROGRAMS, WHICH ARE USED TO RUN COMPUTER PROPERLY.
DATA :- IT IS NOTHING A KNOWN VALUE, WHICH IS FORMED WITH ALPHABETS / DIGITS / SPECIAL CHARACTERS.
INSTRUCTION :- IT IS A ORDER TO THE COMPUTER GIVEN BY THE USER.
PROGRAM :- SET OF INSTRUCTIONS.
WHY WRITE PROGRAM ? :- TO SOLVE PROBLEMS.
LANGUAGE :- IT IS USED TO WRITE PROGRAMS.
SOFTWARE :- SET OF PROGRAMS.
SYSTEM LANGUAGE :- COMPUTER HAVE A SPECIAL LANGUAGE CALLED MACHINE LANGUAGE / BINARY LANGUAGE. IT CAN'T UNDERSTAND OTHER LANGUAGES. MACHINE LANGUAGE CONTAINS ONLY ZEROS AND ONES. EVERY INSTRUCTION GIVEN BY THE COMPUTER IS TRANSLATED INTO ZEROS AND ONES. FOR EXAMPLE 25 IS CONVERTED INTO 11001.
TYPES OF LANGUAGES
1) LOW LEVEL LANGUAGES
(MACHINE DEPENDENT LANGUAGES)
2) HIGH LEVEL LANGUAGES
(MACHINE INDEPENDENT LANGUAGES)
TYPES OF LOW LEVEL LANGUAGES
1) MACHINE LANGUAGE
2) ASSEMBLY LANGUAGE
MACHINE LANGUAGE :- IT IS NOTHING BUT SYSTEM LANGUAGE, WHICH CONTAINS ALL ZEROS AND ONES. IT IS SYSTEM FRIENDLY LANGUAGE. THERE IS NO READING AND DEBUGGING (CORRECTING MISTAKES) FACILITIES IN THIS LANGUAGE. THE ONLY ADVANTAGE OF THIS LANGUAGE IS SYSTEM CAN UNDERSTAND DIRECTLY THIS LANGUAGE INSTRUCTIONS AND EXECUTES QUICKLY.
ASSEMBLY LANGUAGE :- IT CONTAINS MNEMONICS (SMALL ENGLISH WORDS) WHICH ARE USED TO PERFORM ARITHMETICAL, RELATIONAL AND LOGICAL OPERATIONS.
TYPES OF HIGH LEVEL LANGUAGES
1) STRUCTURE ORIENTED LANGUAGE
2) OBJECT ORIENTED LANGUAGE
HIGH LEVEL LANGUAGE :- ENGLISH IS THE MAIN FEATURE OF THIS LANGUAGE. IT IS USER FRIENDLY LANGUAGE. THERE IS EXCELLENT READING AND DEBUGGING (CORRECTING MISTAKES) FACILITIES IN THIS LANGUAGE. THE ONLY DISADVANTAGE OF THIS LANGUAGE IS SYSTEM CAN'T UNDERSTAND DIRECTLY THIS LANGUAGE INSTRUCTIONS AND EXECUTES SLOWLY.
TYPES OF LANGUAGE TRANSLATORS
1) ASSEMBLER
2) INTERPRETER
3) COMPILER
ASSEMBLER :- IT IS USED TO TRANSLATE ASSEMBLY LANGUAGE INSTRUCTIONS INTO MACHINE LANGUAGE.
INTERPRETER :- IT IS USED TO TRANSLATE HIGH LEVEL LANGUAGE INSTRUCTIONS INTO MACHINE LANGUAGE (LINE BY LINE) (TIME WASTE).
COMPILER :- IT IS USED TO TRANSLATE HIGH LEVEL LANGUAGE INSTRUCTIONS INTO MACHINE LANGUAGE (TOTAL PROGRAM AT A TIME) (TIME SAVE).
NOTE :- NOW A DAYS, ALL HIGH LEVEL LANGUAGES HAVE COMPILER.
STAGES OF PROBLEM SOLVING
1) ANALYZE THE PROBLEM
2) WRITE ALGORITHM
3) DRAW FLOW CHART
4) WRITE PROGRAM
ALGORITHM :- IT CONTAINS STEP BY STEP PROBLEM SOLVING STATEMENTS IN ENGLISH LANGUAGE.
TOKENS / BUZZ WORDS OF 'C' LANGUAGE
1) COMMENTS
2) WHITE SPACES
3) CHARACTER SET
4) KEY WORDS / RESERVED WORDS
5) CONSTANTS
6) VARIABLES
7) IDENTIFIERS
8) DATA TYPES
DIFFERENCE BETWEEN SWITCH,HUB AND ROUTER
->A “hub” is nothing more than a repeater with multiple ports. Any voltage change it detects on one port gets sent to all the others. This piece of hardware has no intelligence, no CPU, no memory, or anything of the sort. It is a very simple, physical device.
->A “switch” can be thought of as a smart hub. It is able to send information directly to the computer that needs it, rather than broadcasting everything out every port. It does this by reading the destination and source “MAC” or “Media Access Control” addresses on messages that it receives, and building a database linking its physical ports to the MAC addresses that are sending information on those ports.
->A “router” doesn't just read destination and source MAC addresses, but in an IP network it can also read IP addresses, and forward traffic based on that information. While switches can connect computers within a network, routers can connect multiple networks together. They can also run “routing protocols”, or mechanisms for routers to learn about each other, and decide as a group how to best send traffic from source to destination.
So, these three pieces of hardware work on different “layers”. Hubs are purely physical devices with no intelligence, and thus can be referred to as “physical layer” or “layer 1” devices. Switches can forward information based on the first header, or the “frame encapsulation” of a network message, and so they are “layer 2” devices. Routers can route traffic based on the next (typically IP) header, so they can be considered “network layer” or “layer 3” devices. Just think of networking like an onion.
This answer is long, but still a little simplified. There are multi-layer switches, and modular devices with routing and switching modules, but the above gives you a pretty good idea. I guess the definitive difference between a router and a switch would be that switches use application-specific integrated circuits to "switch" traffic rather than using a typical CPU to "route" traffic.
->A hub is a multiport repeater of broadcast information (it receives on any port) to all ports hence is called non-intelligent or dumb. A hub repeats a message to all the nodes connected to its ports.
Hubs translate any signal from one PC to all others in the same network. Switches translate from one PC only to a certain PC, not to all of them as is the case with hubs.
HUB works on Physical layer whereas SWITCH works on data link layer, HUB based networks are on one collision domain, whereas in Switch-based networks, a switch divides networks into multiple collision domains. Switch also maintains MAC address tables.
A Simple Simile
Hub - Think of a postman with a letter to deliver in a row of houses, none of the houses have numbers so he has to visit each house and ask the owner if the letter is for them.
Switch - All the houses are numbered, so the postman knows where to go, and doesn't have to bother any other homeowners.
That is the reason a HUB is called a Dumb Device (or Dumb Postman).
->A “switch” can be thought of as a smart hub. It is able to send information directly to the computer that needs it, rather than broadcasting everything out every port. It does this by reading the destination and source “MAC” or “Media Access Control” addresses on messages that it receives, and building a database linking its physical ports to the MAC addresses that are sending information on those ports.
->A “router” doesn't just read destination and source MAC addresses, but in an IP network it can also read IP addresses, and forward traffic based on that information. While switches can connect computers within a network, routers can connect multiple networks together. They can also run “routing protocols”, or mechanisms for routers to learn about each other, and decide as a group how to best send traffic from source to destination.
So, these three pieces of hardware work on different “layers”. Hubs are purely physical devices with no intelligence, and thus can be referred to as “physical layer” or “layer 1” devices. Switches can forward information based on the first header, or the “frame encapsulation” of a network message, and so they are “layer 2” devices. Routers can route traffic based on the next (typically IP) header, so they can be considered “network layer” or “layer 3” devices. Just think of networking like an onion.
This answer is long, but still a little simplified. There are multi-layer switches, and modular devices with routing and switching modules, but the above gives you a pretty good idea. I guess the definitive difference between a router and a switch would be that switches use application-specific integrated circuits to "switch" traffic rather than using a typical CPU to "route" traffic.
->A hub is a multiport repeater of broadcast information (it receives on any port) to all ports hence is called non-intelligent or dumb. A hub repeats a message to all the nodes connected to its ports.
Hubs translate any signal from one PC to all others in the same network. Switches translate from one PC only to a certain PC, not to all of them as is the case with hubs.
HUB works on Physical layer whereas SWITCH works on data link layer, HUB based networks are on one collision domain, whereas in Switch-based networks, a switch divides networks into multiple collision domains. Switch also maintains MAC address tables.
A Simple Simile
Hub - Think of a postman with a letter to deliver in a row of houses, none of the houses have numbers so he has to visit each house and ask the owner if the letter is for them.
Switch - All the houses are numbered, so the postman knows where to go, and doesn't have to bother any other homeowners.
That is the reason a HUB is called a Dumb Device (or Dumb Postman).
Subscribe to:
Posts (Atom)