C PPS
UNIT 1INTRODUCTION TO COMPUTER HARDWARE AND SOFTWARE Q1) Explain the generations of computers?A1)1940 – 1956: First Generation – Vacuum TubesThese early computers used vacuum tubes as circuitry and magnetic drums for memory. As a result they were enormous, literally taking up entire rooms and costing a fortune to run. These were inefficient materials which generated a lot of heat, sucked huge electricity and subsequently generated a lot of heat which caused ongoing breakdowns. These first generation computers relied on ‘machine language. These computers were limited to solving one problem at a time. Input was based on punched cards and paper tape. Output came out on print-outs. The two notable machines of this era were the UNIVAC and ENIAC machines – the UNIVAC is the first every commercial computer which was purchased in 1951 by a business – the US Census Bureau. 1956 – 1963: Second Generation – TransistorsThe replacement of vacuum tubes by transistors saw the advent of the second generation of computing. Although first invented in 1947, transistors weren’t used significantly in computers until the end of the 1950s. They were a big improvement over the vacuum tube, despite still subjecting computers to damaging levels of heat. However, they were hugely superior to the vacuum tubes, making computers smaller, faster, cheaper and less heavy on electricity use. They still relied on punched card for input/printouts. The language evolved from cryptic binary language to symbolic (‘assembly’) languages. This meant programmers could create instructions in words. About the same time high level programming languages were being developed (early versions of COBOL and FORTRAN). Transistor-driven machines were the first computers to store instructions into their memories – moving from magnetic drum to magnetic core ‘technology’. The early versions of these machines were developed for the atomic energy industry. 1964 – 1971: Third Generation – Integrated CircuitsBy this phase, transistors were now being miniaturised and put on silicon chips (called semiconductors). This led to a massive increase in speed and efficiency of these machines. These were the first computers where users interacted using keyboards and monitors which interfaced with an operating system, a significant leap up from the punch cards and printouts. This enabled these machines to run several applications at once using a central program which functioned to monitor memory. As a result of these advances which again made machines cheaper and smaller, a new mass market of users emerged during the ‘60s. 1972 – 2010: Fourth Generation – MicroprocessorsThis revolution can be summed in one word: Intel. The chip-maker developed the Intel 4004 chip in 1971, which positioned all computer components (CPU, memory, input/output controls) onto a single chip. The Intel chip housed thousands of integrated circuits. The year 1981 saw the first ever computer (IBM) specifically designed for home use and 1984 saw the MacIntosh introduced by Apple. Microprocessors even moved beyond the realm of computers and into an increasing number of everyday products. The increased power of these small computers meant they could be linked, creating networks. Which ultimately led to the development, birth and rapid evolution of the Internet. Other major advances during this period have been the Graphical user interface (GUI), the mouse and more recently the astounding advances in lap-top capability and hand-held devices. 2010- : Fifth Generation – Artificial IntelligenceComputer devices with artificial intelligence are still in development, but some of these technologies are beginning to emerge and be used such as voice recognition. AI is a reality made possible by using parallel processing and superconductors. Leaning to the future, computers will be radically transformed again by quantum computation, molecular and nano technology. The essence of fifth generation will be using these technologies to ultimately create machines which can process and respond to natural language, and have capability to learn and organise themselves. Q2) Explain CPU primary memory and secondary memory?A2)Processor (CPU / Central Processing Unit)
Primary Memory (Main Memory)Primary memory holds only those data and instructions on which the computer is currently working. It has a limited capacity and data is lost when power is switched off. It is generally made up of semiconductor device. These memories are not as fast as registers. The data and instruction required to be processed resides in the main memory. It is divided into two subcategories RAM and ROM.Characteristics of Main MemoryThese are semiconductor memories. It is known as the main memory. Usually volatile memory. Data is lost in case power is switched off. It is the working memory of the computer. Faster than secondary memories. A computer cannot run without the primary memory. Secondary MemoryThis type of memory is also known as external memory or non-volatile. It is slower than the main memory. These are used for storing data/information permanently. CPU directly does not access these memories, instead they are accessed via input-output routines. The contents of secondary memories are first transferred to the main memory, and then the CPU can access it. For example, disk, CD-ROM, DVD, etc.Characteristics of Secondary MemoryThese are magnetic and optical memories. It is known as the backup memory. It is a non-volatile memory. Data is permanently stored even if power is switched off. It is used for storage of data in a computer. Computer may run without the secondary memory. Slower than primary memories. Q3)Explain port and connections?A3) A port is a physical docking point using which an external device can be connected to the computer. It can also be programmatic docking point through which information flows from a program to the computer or over the Internet.Characteristics of PortsA port has the following characteristics − External devices are connected to a computer using cables and ports. Ports are slots on the motherboard into which a cable of external device is plugged in. Examples of external devices attached via ports are the mouse, keyboard, monitor, microphone, speakers, etc. Q4) Explain input and output devices?A4)Input and output devices allow the computer system to interact with the outside world by moving data into and out of the system. An input device is used to bring data into the system. Some input devices are: Keyboard Mouse Microphone Bar code reader Graphics tablet An output device is used to send data out of the system. Some output devices are: Monitor Printer Speaker Input/output devices are usually called I/O devices. They are directly connected to an electronic module inside the systems unit called a device controller. For example, the speakers of a multimedia computer system are directly connected to a device controller called an audio card (such as a Soundblaster), which in turn is connected to the rest of the system.Q5) Explain computers in a network?A5) Computers connected to a network are broadly categorized as servers or workstations. Servers are generally not used by humans directly, but rather run continuously to provide "services" to the other computers (and their human users) on the network. Services provided can include printing and faxing, software hosting, file storage and sharing, messaging, data storage and retrieval, complete access control (security) for the network's resources, and many others.Workstations are called such because they typically do have a human user which interacts with the network through them. Workstations were traditionally considered a desktop, consisting of a computer, keyboard, display, and mouse, or a laptop, with with integrated keyboard, display, and touchpad. With the advent of the tablet computer, and the touch screen devices such as iPad and iPhone, our definition of workstation is quickly evolving to include those devices, because of their ability to interact with the network and utilize network services.Servers tend to be more powerful than workstations, although configurations are guided by needs. For example, a group of servers might be located in a secure area, away from humans, and only accessed through the network. In such cases, it would be common for the servers to operate without a dedicated display or keyboard. However, the size and speed of the server's processor(s), hard drive, and main memory might add dramatically to the cost of the system. On the other hand, a workstation might not need as much storage or working memory, but might require an expensive display to accommodate the needs of its user. Every computer on a network should be appropriately configured for its use.Q6) Explain network hardware?A6) Computers need networking hardware in order to connect to each other. Routers, hubs, switches and bridges are all pieces of networking equipment that can perform slightly different tasks. A router can often incorporate hubs, switches and wireless access within the same hardware. Q7) Explain the types of software?A7)The types of software −System Software Application Software Utility Software
System SoftwareSoftware required to run the hardware parts of the computer and other application software are called system software. System software acts as interface between hardware and user applications. An interface is needed because hardware devices or machines and humans speak in different languages.Application SoftwareA software that performs a single task and nothing else is called application software. Application software are very specialized in their function and approach to solving a problem. So a spreadsheet software can only do operations with numbers and nothing else. A hospital management software will manage hospital activities and nothing else. Here are some commonly used application software −Word processing Spreadsheet Presentation Database management Multimedia tools Utility SoftwareApplication software that assist system software in doing their work is called utility software. Thus, utility software is actually a cross between system software and application software. Examples of utility software include −Antivirus software Disk management tools File management tools Compression tools Backup tools Q8) Explain the basic structure of C program?A8)C program basically consists of the following parts −Preprocessor Commands Functions Variables Statements & Expressions Comments Let us look at a simple code that would print the words "Hello World" – #include <stdio.h>
The first line of the program #include <stdio.h> is a preprocessor command, which tells a C compiler to include stdio.h file before going to actual compilation. The next line int main() is the main function where the program execution begins. The next line /*...*/ will be ignored by the compiler and it has been put to add additional comments in the program. Such lines are called comments in the program. The next line printf(...) is another function available in C which causes the message "Hello, World!" to be displayed on the screen. The next line return 0; terminates the main() function and returns the value 0. Q9) Explain the execution of C program?A9)A C program source code can be written in any text editor; however, the file should be saved with .c extension. First C Program
Q10) Explain the data types in C?A10)Programming languages define data types differently. For example, almost all languages differentiate between ‘integers’ (or whole numbers, eg 12), ‘non-integers’ (numbers with decimals, eg 0.24), and ‘characters’ (letters of the alphabet or words).char – a single 16-bit Unicode character, such as a letter, decimal or punctuation symbol. boolean – can have only two possible values: true (1) or false (0). This data type is useful in conditional statements. byte - has a minimum value of -128 and a maximum value of 127 (inclusive). short– has a minimum value of -32,768 and a maximum value of 32,767 int: – has a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647 (inclusive). long – has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive). float – a floating point number with 32-bits of precision double – this is a double precision floating point number.
|
|
|
|
|
int main() { /* my first program in C */ printf("Hello, World! \n");
return 0; } The various parts of the above program − |
#include<stdio.h> | ||
int main() { int num; printf("Enter your age: "); scanf("%d", &num); if (num <18) { printf("you are not eligible for voting"); } else { printf("You can vote!!"); } return 0; } Output:
| ||
Enter your age:25 | ||
0 matching results found