Introduction to Programming - (C Language) - Unit : 1 - Introduction to Programming and Problem Solving - Basics
WHAT IS COMPUTER?
“A computer
is an electronic programmable machine
designed to sequentially and automatically carry out a sequence
of arithmetic or logical operations.”
COMPUTER HISTORY
‘John Napier’ invented
a device. “Napier
Bones” .
Blasé
Pascal, the French
mathematician invented the “Adding machine”
simply for additions and subtractions.
Gottfried Leibniz, the German Scientist implemented the Adding machine and made
a new
machine ‘ Leibniz Machine’.
He was a Professor of Mathematics.
He invented a machine called ‘Differential
Engine’ in 1822. After he
implemented it and found a new machine called
‘Analytical Engine’ in 1832. He is called the
“Father of Computers”
The First Computer is ENIAC ( Electronic and Numerical Integrator and Calculator). It
was developed by John Prosper
Eckert and John W. Mauchl in 1945.
The later developed Computers are MARK–I
EDVAC, UNIVAC, LEO , IBM – 650, UNIVAC
– I,
IBM – 360 Series, CDC – 1604 etc.
Computer Generations
Generation |
Period |
Technology Used |
First |
1946- 55 |
Vacuum Tubes |
Second |
1956-65 |
Transistors |
Third |
1966-75 |
I.C ( Integrated Circuits) |
Fourth |
1976-85 |
V.L.S.I.C (Very Large
Scale Integrated Circuits ) |
Fifth |
1985 onwards |
A.I ( Artificial Intelligence) |
Basic
Organization Of A Computer
Computer takes data (Input) from the Input devices and processing the data under the instruction given by the user
and finally gives
the result (Output) through
the Output devices.
Computer Basic Structure
The basic organization of a
computer involves several key components and their interactions, which
collectively enable a computer to process and store data. Here are the
fundamental components and their roles in a computer's organization:
Central Processing Unit
(CPU):
The CPU is the brain of the
computer, responsible for executing instructions and performing calculations.
It consists of two main units: the
Control Unit
(CU), which
manages the execution of instructions, and the Arithmetic Logic Unit (ALU), which performs mathematical and
logical operations.
The CPU fetches instructions from
memory, decodes them, and executes them sequentially.
Memory:
Computers have various types of
memory, including:
RAM (Random Access
Memory): This is
volatile memory used for temporarily storing data and program instructions that
the CPU is actively using. It allows for fast read and write operations but
loses its data when the computer is powered off.
ROM (Read-Only Memory): This is non-volatile memory that
stores essential instructions and data that don't change, such as the
computer's firmware or BIOS.
Secondary Storage: This includes
devices like hard drives (HDDs) and solid-state drives (SSDs), used for
long-term storage of data and programs. Unlike RAM, secondary storage retains
data even when the computer is turned off.
Input Devices:
Input devices allow users to
interact with the computer by providing data and instructions. Common examples
include keyboards, mice, touchscreens, and microphones.
Output Devices:
Output devices present information
or results to the user. Common examples include monitors, speakers, printers,
and headphones.
Motherboard:
The motherboard is the main
circuit board that houses and interconnects the CPU, memory, storage devices,
input/output ports, and other essential components. It provides the electrical
pathways for data transfer between these components.
Bus System:
Buses are pathways that transfer
data and control signals between various computer components. Common buses
include the data bus (for transferring data), the address bus (for specifying
memory locations), and the control bus (for managing data flow and
coordination).
Power Supply Unit (PSU):
The PSU supplies electrical power
to the computer's components. It converts AC (alternating current) from a wall
outlet into DC (direct current) usable by the computer's internal components.
Expansion Slots and Ports:
Expansion slots allow for the
installation of additional hardware components like graphics cards, sound
cards, and network cards.
Ports provide external
connectivity and include USB ports, audio jacks, Ethernet ports, and video
connectors (e.g., HDMI, DisplayPort).
Operating System (OS):
The operating system is system
software that manages computer hardware and software resources. It provides a
user-friendly interface, manages processes, handles file storage, and
facilitates communication between hardware and software.
Software:
Software includes applications,
programs, and the operating system itself. It consists of instructions and data
that the CPU processes to perform specific tasks.
ALU (ARTITHMETIC AND
LOGICAL UNIT)
The Arithmetic Logic Unit (ALU) is a critical
component of the Central Processing Unit (CPU) in a computer. It is responsible
for performing arithmetic and logical operations on data. Let's dive into a
detailed explanation of the ALU:
1. Purpose and Function:
The ALU's primary function is to perform
mathematical calculations and logical operations on binary data. These
operations are the fundamental building blocks of computation in a computer.
2. Arithmetic Operations:
The ALU can execute various arithmetic
operations, including:
Addition: Adding two binary numbers
together.
Subtraction: Subtracting one binary number
from another.
Multiplication: Performing binary multiplication.
Division: Performing binary division.
Increment and Decrement: Adding or subtracting one from a
binary number.
3. Logical Operations:
The ALU also handles logical operations,
which manipulate bits or binary data in various ways. Common logical operations
include:
AND: Performs a bitwise AND operation,
resulting in 1 only if both input bits are 1.
OR: Performs a bitwise OR operation,
resulting in 1 if at least one input bit is 1.
NOT: Inverts each bit, turning 0s into
1s and vice versa.
XOR (Exclusive OR): Performs a bitwise XOR operation,
resulting in 1 if the input bits are different.
4. Data Size:
ALUs are designed to handle a specific word
size or data size, which determines the maximum size of the data they can
process in a single operation. For example, a 32-bit ALU can perform operations
on 32-bit binary numbers.
5. Registers:
The ALU works closely with CPU registers,
which are small, high-speed storage locations within the CPU. Registers store the
operands (input values) for ALU operations and hold the results temporarily.
Common registers include the Accumulator (for
storing intermediate results), the Operand Register (for holding data to be
processed), and the Result Register (for storing the output of ALU operations).
6. Flags and Status Bits:
The ALU often sets various flags or status
bits in the CPU's status register to indicate the outcome of operations. Common
flags include:
Zero Flag: Set if the result of an operation
is zero.
Carry Flag: Set if an operation produces a
carry out of the most significant bit.
Overflow Flag: Set if an operation generates an
overflow or underflow condition.
Sign Flag: Indicates the sign of the result
(positive or negative).
7. Control Unit
Interaction:
The ALU operates under the control of the
CPU's Control Unit. The Control Unit sends control signals to the ALU,
specifying the operation to be performed (e.g., addition, subtraction, logical
AND) and which registers to use as operands.
8. Pipelining and Parallelism:
In modern CPUs, ALUs often employ techniques
like pipelining and parallelism to improve performance. Pipelining allows
multiple instructions to be processed concurrently in different stages of the
ALU, while parallelism enables simultaneous execution of multiple operations.
9. Speed and Performance:
ALUs are designed to perform operations
quickly, as their speed impacts the overall performance of the CPU. Improving
ALU performance is a key aspect of CPU design.
Comments
Post a Comment