Lecture Notes: Introduction to Computer and Programming
Instructor Information
Name: Ritesh Sohan
Position: Assistant Professor
Department: Computer Engineering, Mahatma Gandhi Institute of Technical Education and Research Center, Nausari
Subject Code: 3110003
Course Overview
Total Units: 10 in the subject Programming for Problem Solving.
Recommended Textbook:Programming in ANSYS C by Bala Gurusamy.
Unit 1: Introduction to Computer and Programming
Topics Covered:
Introduction to Computers and Programming Languages
Basic Block Diagram of a Computer
Functions of Various Components of Computer
Concept of Hardware and Software
Differences Between Hardware and Software
Types of Software
Compilers and Interpreters
What is a Computer?
A machine that accepts data as input, processes it using programs, and outputs the processed data as information.
Capable of storing and retrieving information.
Can be connected to form networks for communication.
Modern computers serve various purposes: browsing the web, writing documents, editing videos, etc.
What is a Programming Language?
A formal language consisting of a set of instructions producing various outputs.
Used to implement algorithms in computer programming.
Allows translation of binary (1s and 0s) into understandable instructions for computers.
Basic Block Diagram of Computer
Key Components:
CPU (Central Processing Unit):
Contains: ALU (Arithmetic Logic Unit), Control Unit (CU), Primary Memory
Main part of the computer that processes data and controls data flow.
Input Section:
Devices such as keyboard, mouse, touchscreen, etc.
Output Section:
Devices like monitors, printers, speakers, etc.
Secondary Memory:
Storage devices (hard disks, pen drives) that retain data permanently.
Components of CPU
ALU (Arithmetic Logic Unit):
Performs mathematical calculations and logical operations.
Control Unit (CU):
Manages all operations and reads instructions from memory.
Primary Memory:
Also known as main memory; volatile storage for currently executing programs.
Types: RAM (volatile), ROM (non-volatile), PROM, EPROM.
Input and Output Devices
Input Devices:
Convert human-readable input into computer-controllable data (e.g., mouse, keyboard).
Output Devices:
Convert data stored in binary form to human-understandable format (e.g., monitors, printers).
Secondary Memory
Non-volatile memory for permanent data storage (e.g., hard disk, CDs, DVDs).
Advantages and Limitations of Computers
Advantages:
Speed:
Executes millions of calculations in microseconds/nanoseconds.
Storage:
Can store vast amounts of data efficiently.
Accuracy:
Performs calculations with 100% accuracy when given correct input.
Reliability:
Data remains intact after years, can operate continuously.
Automation:
Tasks can be repeated with a single command.
Limitations:
Lack of Intelligence:
Cannot think or make decisions; relies entirely on provided instructions.
Unable to Correct Mistakes:
Cannot rectify errors in input; outputs are solely based on the input given.
Concept of Hardware and Software
Software:
A set of instructions (programs) designed to perform tasks.
Types of Software:
System Software:
Operates hardware and provides a platform for application software (e.g., operating systems like Windows, Linux).
Application Software:
Helps users perform specific tasks (e.g., word processors, web browsers).
Differences Between Hardware and Software:
Software is intangible and consists of instructions; hardware is tangible and includes physical components.
Hardware cannot function without software and vice versa.
Software can be debugged; hardware can only be repaired or replaced.
Compilers and Interpreters
Compiler:
Translates entire high-level language programs to machine language at once.
Detects errors after the entire program has been compiled.
Interpreter:
Translates high-level language programs line by line.
Stops execution on encountering errors, displaying them in real-time.
Key Differences:
Compiler:
Compiles the whole program, requires more memory.
Interpreter:
Compiles line by line, requires less memory.
Conclusion
The session covered the introduction to computers, programming languages, components of computers, advantages and limitations, hardware vs software, and compilers vs interpreters.