Computer org.Unit1-2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

UNIT-1

Function and structure of a computer :-


A computer is an electronic device that processes data and performs tasks based on a set of
instructions, known as programs. Its basic structure and functioning rely on several core
components, each serving a specific purpose in its operations. Here’s a breakdown of its
fundamental components and their roles:

### 1. **Basic Structure of a Computer**

- **Central Processing Unit (CPU)**:


- Often called the "brain" of the computer, the CPU performs all calculations and logical
operations. It interprets and executes instructions from the software.
- **Components of the CPU**:
- **Arithmetic Logic Unit (ALU)**: Handles mathematical calculations and logical
comparisons.
- **Control Unit (CU)**: Directs the operation of the processor and coordinates tasks
among different components.
- **Registers**: Small, high-speed storage locations that temporarily hold data and
instructions the CPU is currently using.

- **Memory (RAM and ROM)**:


- **RAM (Random Access Memory)**: This is the temporary memory where data and
instructions are stored while the computer is on. It’s volatile, meaning it loses data when
powered off.
- **ROM (Read-Only Memory)**: Stores firmware or essential instructions for booting
the computer. It’s non-volatile, so data remains even when the power is off.

- **Storage**:
- **Hard Disk Drive (HDD) or Solid State Drive (SSD)**: These are long-term storage
devices where data and programs are stored even when the computer is powered off.
- **Optical Drives and External Storage**: Used for reading and writing data to optical
discs (e.g., CDs, DVDs) and external storage devices.

- **Input and Output (I/O) Devices**:


- **Input Devices**: Tools like keyboards, mice, and scanners allow users to input data
into the computer.
- **Output Devices**: Monitors, printers, and speakers display or output data to the user.

- **Motherboard**:
- This is the main circuit board that connects all components, allowing them to
communicate. It houses the CPU, memory, and various other peripherals.

- **Power Supply Unit (PSU)**:


- Converts electrical energy from an outlet into a usable form for the computer. It powers
all internal components.

- **Graphics Processing Unit (GPU)**:


- A specialized processor designed for handling visual and graphic data, often used in
gaming, video rendering, and other graphics-intensive tasks.

### 2. **Function of a Computer**


- **Input**: Receiving data and instructions from users through input devices.
- **Processing**: The CPU interprets and processes the instructions, performing
calculations, comparisons, and data handling.
- **Storage**: Data is either temporarily held in RAM or permanently saved in storage
(HDD/SSD) based on the need.
- **Output**: The processed data is then presented to the user through output devices like a
monitor or printer.
- **Control**: The CPU’s Control Unit coordinates and manages the various components
to ensure smooth operation.

Each component plays a vital role in a computer’s operation, working together to execute
tasks, run software, and support user interaction. This structure enables computers to perform
a vast range of tasks efficiently and reliably.
Functional components of a computer

Input Unit :The input unit consists of input devices that are attached to the computer. These
devices take input and convert it into binary language that the computer understands. Some of
the common input devices are keyboard, mouse, joystick, scanner etc.
Central Processing Unit (CPU) : Once the information is entered into the computer by the
input device, the processor processes it. The CPU is called the brain of the computer because
it is the control center of the computer. It first fetches instructions from memory and then
interprets them so as to know what is to be done. If required, data is fetched from memory or
input device. Thereafter CPU executes or performs the required computation and then either
stores the output or displays on the output device. The CPU has three main components
which are responsible for different functions – Arithmetic Logic Unit (ALU), Control Unit
(CU) and Memory registers
Arithmetic and Logic Unit (ALU) : The ALU, as its name suggests performs mathematical
calculations and takes logical decisions. Arithmetic calculations include addition, subtraction,
multiplication and division. Logical decisions involve comparison of two data items to see
which one is larger or smaller or equal.
Control Unit : The Control unit coordinates and controls the data flow in and out of CPU and
also controls all the operations of ALU, memory registers and also input/output units. It is
also responsible for carrying out all the instructions stored in the program. It decodes the
fetched instruction, interprets it and sends control signals to input/output devices until the
required operation is done properly by ALU and memory.
Memory Registers : A register is a temporary unit of memory in the CPU. These are used to
store the data which is directly used by the processor. Registers can be of different sizes(16
bit, 32 bit, 64 bit and so on) and each register inside the CPU has a specific function like
storing data, storing an instruction, storing address of a location in memory etc. The user
registers can be used by an assembly language programmer for storing operands, intermediate
results etc. Accumulator (ACC) is the main register in the ALU and contains one of the
operands of an operation to be performed in the ALU.
Interconnection between Functional Components
A computer consists of input unit that takes input, a CPU that processes the input and an
output unit that produces output. All these devices communicate with each other through a
common bus. A bus is a transmission path, made of a set of conducting wires over which data
or information in the form of electric signals, is passed from one component to another in a
computer. The bus can be of three types – Address bus, Data bus and Control Bus.

Following figure shows the connection of various functional components:

The address bus carries the address location of the data or instruction. The data bus carries
data from one component to another and the control bus carries the control signals. The
system bus is the common communication path that carries signals to/from CPU, main
memory and input/output devices. The input/output devices communicate with the system
bus through the controller circuit which helps in managing various input/output devices
attached to the computer.
Performance of a computer:-
In computer organization, performance refers to the speed and efficiency at which a computer
system can execute tasks and process data. A high-performing computer system is one that
can perform tasks quickly and efficiently while minimizing the amount of time and resources
required to complete these tasks.

The performance of a computer system depends on multiple factors such as CPU, memory,
and input/output systems. Also, if you’re aiming to understand these performance metrics for
GATE, the GATE CS Self-Paced Course breaks down complex concepts in computer
organization and performance measurement with detailed tutorials and exercises.

Here are several factors that can impact the performance of a computer system, including:

Processor speed: The speed of the processor, measured in GHz (gigahertz), determines how
quickly the computer can execute instructions and process data.
Memory: The amount and speed of the memory, including RAM (random access memory)
and cache memory, can impact how quickly data can be accessed and processed by the
computer.
Storage: The speed and capacity of the storage devices, including hard drives and solid-state
drives (SSDs), can impact the speed at which data can be stored and retrieved.
I/O devices: The speed and efficiency of input/output devices, such as keyboards , mice, and
displays, can impact the overall performance of the system.
Software optimization: The efficiency of the software running on the system, including
operating systems and applications, can impact how quickly tasks can be completed.
Improving the performance of a computer system typically involves optimizing one or more
of these factors to reduce the time and resources required to complete tasks. This can involve
upgrading hardware components, optimizing software, and using specialized performance-
tuning tools to identify and address bottlenecks in the system.

Computer performance is the amount of work accomplished by a computer system. The word
performance in computer performance means “How well is the computer doing the work it is
supposed to do?”. It basically depends on the response time, throughput, and execution time
of a computer system. Response time is the time from the start to completion of a task. This
also includes:

Operating system overhead.


Waiting for I/O and other processes
Accessing disk and memory
Time spent executing on the CPU or execution time.
Introduction to Computer Organization,
Computer organization deals with the hardware components of a computer system. It
includes Input / Output devices, the Central Processing Unit, storage devices and primary
memory. It is concerned with how the various components of computer hardware operate. It
also deals with how they are interconnected to implement an architectural specification. The
term computer organization looks similar to the term computer architecture. But, computer
architecture deals with the engineering considerations involved in designing a computer. On
the other hand, Computer Organization deals with the hardware components that are
transparent to the programmer.
CPU Organization
A Central Processing Unit is the most important component of a computer system. A CPU is
hardware that performs data input/output, processing, and storage functions for a computer
system. A CPU can be installed into a CPU socket. These sockets are generally located on the
motherboard. CPU can perform various data processing operations. CPU can store data,
instructions, programs, and intermediate results.

Components of a CPU

 Arithmetic Logic Unit (ALU): Handles all arithmetic and logical operations. The
ALU performs operations like addition, subtraction, bitwise operations, and
comparisons.
 Control Unit (CU): Directs the operations of the CPU, interpreting instructions from
memory and generating control signals to coordinate data flow and execution.
 Registers: Small, fast storage locations within the CPU used to hold data and
instructions temporarily during execution.

Types of CPU Organizations

1. Single Accumulator Organization


2. General Register Organization
3. Stack organization

Definition of Single Accumulator Organization: In this architecture, a single accumulator


register is designated for arithmetic and logic operations. It optimizes cost by limiting the
number of registers, emphasizing efficiency in simple computing systems.

 Definition of General Register Organization: In computing, General Register


Organization refers to the systematic arrangement and utilization of registers within the
CPU. These registers serve as high-speed, temporary storage for data and play a vital role in
enhancing computational efficiency by minimizing the need for frequent memory access.

Stack Organization

 The memory of a CPU can be organized as a STACK, a structure where information is


stored in a Last-In-First-Out (LIFO) manner. This means that the item last stored is the first
to be removed or popped.
 To manage the items, a stack uses a stack pointer (SP) register. The stack pointer stores the
address of the last item in the stack, essentially pointing to the topmost element.

Memory Subsystem Organization and Interfacing

A memory subsystem is a critical component of any computer system, responsible for storing
and retrieving data. It's composed of various memory components, each with its unique
characteristics and purpose. Let's delve into the organization and interfacing of these
components.

Memory Subsystem Organization

A typical memory subsystem consists of the following components:

1. Main Memory (Primary Memory):


o RAM (Random Access Memory):
 Volatile memory that stores data temporarily.
 Divided into two types:
 DRAM (Dynamic RAM): Requires constant refreshing.
 SRAM (Static RAM): Faster but more expensive.
o Cache Memory:
 High-speed memory that stores frequently accessed data.
 Levels of Cache: L1, L2, and L3, with decreasing speed and increasing
size.
2. Secondary Storage:
o Non-volatile memory for long-term storage.
o Examples: Hard disk drives (HDDs), solid-state drives (SSDs), and optical
drives.

Memory Interfacing

Interfacing memory components with the CPU involves a complex process. Here's a
simplified overview:

1. Address Bus:
o Carries the memory address from the CPU to the memory component.
o The width of the address bus determines the maximum memory addressable
space.
2. Data Bus:
o Transmits data between the CPU and the memory component.
o The width of the data bus determines the amount of data transferred in a single
cycle.
3. Control Bus:
o Carries control signals like read, write, and memory enable.
o These signals coordinate the data transfer between the CPU and memory.

I/O Subsystem Organization and Interfacing


An I/O subsystem is a crucial component of a computer system, responsible for
communication with external devices. It facilitates the exchange of data between the system
and the outside world. Let's delve into the organization and interfacing of I/O subsystems.

I/O Subsystem Organization

A typical I/O subsystem comprises the following components:

1. I/O Devices:
o Input Devices: Keyboard, mouse, scanner, etc.
o Output Devices: Monitor, printer, speakers, etc.
o Storage Devices: Hard disk drives (HDDs), solid-state drives (SSDs), etc.
2. I/O Controllers:
o Specialized hardware components that interface with I/O devices.
o They control the data transfer between the device and the system.
3. I/O Buses:
o Physical connections that transfer data between the CPU, memory, and I/O
devices.
o Examples: PCI, USB, SATA, etc.

I/O Interfacing

Interfacing I/O devices with the system involves a complex process. Here's a simplified
overview:

1. Device Driver:
o Software component that interacts with the hardware.
o It provides a standard interface for the operating system to communicate with
the device.
2. I/O Controller:
o Handles the low-level details of data transfer, such as timing and control
signals.
o It communicates with the device driver through the I/O bus.
3. I/O Bus:
o Carries data and control signals between the I/O controller and the system.
o Different bus types have varying speeds and capabilities.

A relative computer is a computer

A relative computer is a computer that performs data processing and storage functions at a
high speed and with high accuracy. Some of the relative functions of a computer include:

Data processing: The computer accurately processes data

Storage: The computer has a large amount of device memory

Output data: The computer produces accurate output data


In computer science, a relative address is an address that is calculated based on the current
program counter (PC) value. This allows for efficient address calculations within a specific
range without the need for memory access.

The Simplified Instructional Computer (SIC) is a hypothetical computer system that was
introduced to help people learn systems programming. It abstracts away complex behaviors
in favor of a clear and accessible architecture.

Software

Software is a set of instructions, data, and programs that tell a computer how to operate and
perform tasks. It's the opposite of hardware, which refers to the physical components of a
computer. Here are some types of software: Application software: Performs specific tasks or
fulfills a need, such as word processors, spreadsheets, and database management programs

System software: Runs the computer's hardware and provides a platform for applications to
run on

Network software: Coordinates communication between computers on a network

Programming software: Provides tools for software developers Middleware: Sits between
system software and applications

Driver software: Operates computer devices and peripherals

Firmware: Software that's permanently stored in a computer's memory and directly controls a
piece of hardware

Hardware Interaction

Hardware Interaction in software development refers to the processes and methodologies


used to enable software systems to communicate and control physical devices or hardware
components. It is a critical aspect of creating applications that interact with the external
environment, such as embedded systems, robotics, and IoT devices.

Effective hardware interaction requires a deep understanding of both the software and the
hardware involved. Developers must consider aspects such as device drivers, hardware
abstraction layers, and direct memory access. They need to ensure that the software can
reliably send and receive data to and from the hardware, process it correctly, and perform
actions in real-time when necessary.

 Device Drivers: Specialized software components that allow higher-level computer


programs to interact with a hardware device.
 Hardware Abstraction: A layer of code that allows software applications to interact
with hardware in a generalized way, making it easier to write code for diverse
hardware platforms.
 Real-Time Processing: The capability of the software to process data quickly enough
so that the output can be used immediately or within a very short time frame.

 The four primary layers of computer architecture are the Hardware layer, the

Operating System layer, the System Software layer, and the Application Software

layer.

 1. Hardware Layer

 The hardware layer is the bedrock of computer architecture. It includes all the physical
components that make up a computer system. This layer encompasses the central

processing unit (CPU), memory modules (RAM and ROM), storage devices (like hard

drives and SSDs), input/output devices (keyboards, monitors, and printers), and other

peripheral devices.

 Hardware is responsible for executing the basic functions required to carry out

instructions from higher layers.

 Understanding the intricacies of hardware, such as how the CPU processes information

through its ALU (Arithmetic Logic Unit) and control units, can significantly enhance

one’s appreciation of computer performance and capabilities.

2. Operating System Layer

The Operating System (OS) layer sits atop the hardware and serves as an intermediary

between hardware and system software. This layer manages hardware resources and provides

a stable, consistent way for applications to interact with the hardware without needing to know

the specifics.
Popular operating systems include Windows, MacOS, and Linux. Key functions of the OS
include managing files and directories, facilitating user interfaces, overseeing memory
allocation, and handling system security and access controls.

3. System Software Layer

The system software layer involves essential programs that support the management and

effective running of hardware and the OS. This layer includes utility software, device drivers,

and compilers which are crucial for system maintenance, performance enhancement, and

bridging the gap between the OS and application software.

System software ensures that the operating system can communicate correctly with different

hardware devices and allows for smoother operational workflows.

4. Application Software Layer

At the top of the architecture, the application software layer includes all the end-user programs

designed for productivity and task management. This layer covers a broad spectrum of

software types, from word processors and web browsers to complex data analysis tools and

video games.

Application software leverages the functionalities provided by the underlying layers to deliver

a wide range of functionalities, enhancing user interaction, productivity, and overall


experience.

Developers often create applications using high-level programming languages, focusing on

user requirements and interface design rather than the technical specifics of lower layers.

Central processing and machine language


The central processing unit (CPU) is a component of a computer that interprets and
executes instructions, while machine language is a programming language that computers
use to understand instructions: Central processing unit (CPU) The CPU is responsible for
processing instructions from hardware and software programs. It performs arithmetic, logic,
and other operations to convert data input into usable information output.

Machine language Also known as machine code or native code, machine language is a low-
level programming language that computers use to understand instructions. It's made up of
binary numbers that represent specific instructions and data. The CPU can directly interpret
and execute these instructions.

UNIT-2

Data Representation:

Introduction to Digital Computer

A Digital computer can be considered as a digital system that performs various


computational tasks.

The first electronic digital computer was developed in the late 1940s and was used
primarily for numerical computations.

By convention, the digital computers use the binary number system, which has two digits:
0 and 1. A binary digit is called a bit.

A computer system is subdivided into two functional entities: Hardware and Software.

The hardware consists of all the electronic components and electromechanical devices
that comprise the physical entity of the device.

The software of the computer consists of the instructions and data that the computer
manipulates to perform various data-processing tasks.
o The Central Processing Unit (CPU) contains an arithmetic and logic unit for
manipulating data, a number of registers for storing data, and a control circuit
for fetching and executing instructions.
o The memory unit of a digital computer contains storage for instructions and
data.
o The Random Access Memory (RAM) for real-time processing of the data.
o The Input-Output devices for generating inputs from the user and displaying the
final results to the user.
o The Input-Output devices connected to the computer include the keyboard,
mouse, terminals, magnetic disk drives, and other communication devices.
Number Systems: Binary, Octal, and Hexadecimal

In the world of computing, number systems are the foundation for representing and
manipulating data. Number systems are fundamental in computing, allowing computers to
store, process, and display data. The most common number systems in computing are binary
(base-2), octal (base-8), and hexadecimal (base-16), each used for different purposes in
computer organization and programming.

Binary Number System


A number System with a base value of 2 is termed a Binary number system. It uses 2 digits
i.e. 0 and 1 for the creation of numbers. The numbers formed using these two digits are
termed Binary Numbers. The binary number system is very useful in electronic devices and
computer systems because it can be easily performed using just two states ON and OFF i.e. 0
and 1.

Decimal Numbers 0-9 are represented in binary as 0, 1, 10, 11, 100, 101, 110, 111, 1000, and
1001

For example, 14 can be written as 1110, 19 can be written as 10011, and 50 can be written as
110010.

Octal Number System

Octal Number System is one in which the base value is 8. It uses 8 digits i.e. 0-7 for the
creation of Octal Numbers. Octal Numbers can be converted to Decimal values by
multiplying each digit with the place value and then adding the result. Here the place values
are 80, 81, and 82. Octal Numbers are useful for the representation of UTF8 Numbers.
Example,

(81)10 can be written as (121)8

(125)10 can be written as (175)8

Hexadecimal Number System

A number System with a base value of 16 is known as Hexadecimal Number System. It uses
16 digits for the creation of its numbers. Digits from 0-9 are taken like the digits in the
decimal number system but the digits from 10-15 are represented as A-F i.e. 10 is represented
as A, 11 as B, 12 as C, 13 as D, 14 as E, and 15 as F. Hexadecimal Numbers are useful for
handling memory address locations. Examples,

185)10 can be written as (B9)16

(5440)10 can be written as (1540)16

Coding Schemes
Coding schemes are methods used to represent data in a digital format. They are essential for
storing and transmitting information in computers. Here are some of the most common
coding schemes:

1. ASCII (American Standard Code for Information Interchange)

 A character encoding standard for electronic communication.


 Each character is represented by a 7-bit binary code.
 Limited to representing characters of the English alphabet, numbers, and some special
symbols.

2. Unicode

 A universal character encoding standard that supports a wide range of characters from
different languages and scripts.
 Uses variable-length encoding to represent characters.
 Common encodings based on Unicode include UTF-8, UTF-16, and UTF-32.

3. BCD (Binary Coded Decimal)

 A number system in which each decimal digit is represented by a 4-bit binary code.
 Used in digital circuits and systems where decimal arithmetic is required.

4. Gray Code

 A binary numeral system where two successive values differ in only one bit.
 Used in rotary encoders and other applications where a smooth transition between states is
important.

5. Excess-3 Code

 A self-complementing code, where the excess-3 code of a number is obtained by adding 3 to


each digit of the binary number.
 Used in digital circuits to simplify arithmetic operations.

6. Error-Correcting Codes

 These codes add redundancy to data to detect and correct errors during transmission or
storage.
 Common examples include Hamming codes and Reed-Solomon codes.
Choosing the Right Coding Scheme:

The choice of coding scheme depends on various factors, including:

 Character set: The range of characters to be represented.


 Data transmission rate: The speed at which data needs to be transmitted.
 Error rate: The likelihood of errors during transmission or storage.
 Storage efficiency: The amount of storage space required to represent data.
 Computational complexity: The complexity of encoding and decoding algorithms.

By understanding these coding schemes, you can better appreciate how data is represented
and manipulated in digital systems.

Boolean Algebra:

Binary logic is the foundation of digital computing, providing a way for computers to make
decisions and perform operations using binary values. In binary logic, only two states are
possible: 0 (off/false) and 1 (on/true). These two states are used in binary logic operations to
create, evaluate, and manipulate binary expressions. Logic gates, which are electronic
components that implement binary logic, combine binary inputs to produce binary outputs
based on predefined logical rules.

Basic Binary Logic Operations

The basic binary logic operations are AND, OR, NOT, NAND, NOR, XOR, and XNOR.
Here’s an overview of each:

1. AND Gate
o Operation: Outputs 1 only if both inputs are 1; otherwise, it outputs 0.

2.OR Gate

 Operation: Outputs 1 if at least one input is 1; otherwise, it outputs 0.

3. NOT Gate

 Operation: Inverts the input; outputs 1 if the input is 0, and 0 if the input is 1.

4.NAND Gate (NOT AND)

 Operation: Outputs the opposite of the AND gate; outputs 0 if both inputs are 1,
otherwise 1.

Logic gates

are fundamental building blocks of digital circuits. They perform basic logical functions that
are essential in the design of digital systems, including computers, calculators, and various
types of digital hardware. Each gate processes one or more binary inputs to produce a binary
output based on a specific logical operation.
Basic Types of Logic Gates and Their Operations

1. AND Gate
o Operation: The AND gate outputs 1 only if all inputs are 1; otherwise, it outputs 0.

OR Gate

 Operation: The OR gate outputs 1 if at least one input is 1; otherwise, it outputs 0

NOT Gate (Inverter)

 Operation: The NOT gate, or inverter, outputs the opposite of the input; if the input
is 1, it outputs 0, and if the input is 0, it outputs 1.

NAND Gate (NOT AND)

 Operation: The NAND gate is the inverse of the AND gate; it outputs 0 only if all
inputs are 1, otherwise, it outputs 1.

The postulates of Boolean algebra are the foundational rules and


assumptions on which Boolean algebra is built. These postulates define the basic operations
and properties of Boolean algebra, making it distinct from classical algebra. They help in
creating a mathematical structure that allows for simplifying and analyzing logical
expressions in digital systems.

The Fundamental Postulates of Boolean Algebra

Boolean algebra consists of two binary operations, OR (+) and AND (·), and one unary
operation, NOT (¬ or overline). The primary postulates are defined for a Boolean algebra
with two possible values, 0 and 1.

You might also like