0% found this document useful (0 votes)
52 views111 pages

Comprog Reviewer

The document provides an overview of computer fundamentals, including the functions and components of various hardware devices such as monitors, keyboards, mice, motherboards, CPUs, RAM, SSDs, and HDDs. It also discusses early computers like the Harvard Mark I and ENIAC, as well as key online terminologies related to internet technology. Additionally, it touches on the basics of C++ programming and differentiates between coding and programming.

Uploaded by

nicoleeeee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views111 pages

Comprog Reviewer

The document provides an overview of computer fundamentals, including the functions and components of various hardware devices such as monitors, keyboards, mice, motherboards, CPUs, RAM, SSDs, and HDDs. It also discusses early computers like the Harvard Mark I and ENIAC, as well as key online terminologies related to internet technology. Additionally, it touches on the basics of C++ programming and differentiates between coding and programming.

Uploaded by

nicoleeeee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COMPUTER FUNDAMENTALS

A computer monitor is an output device that displays information in pictorial or textual form. A discrete
monitor comprises a visual display, support electronics, power supply, housing, electrical connectors, and
external user controls.
The display in modern monitors is typically an LCD with LED backlight, having by the 2010s replaced CCFL
backlit LCDs. Before the mid-2000s, most monitors used a cathode-ray tube (CRT) as the image output
technology. A monitor is typically connected to its host computer via DisplayPort, HDMI, USB-C, DVI, or
VGA. Monitors sometimes use other proprietary connectors and signals to connect to a computer, which is
less common.

A computer keyboard is a built-in or peripheral input device modeled after the typewriter keyboard which
uses an arrangement of buttons or keys to act as mechanical levers or electronic switches. Replacing early
punched cards and paper tape technology, interaction via teleprinter-style keyboards have been the main
input method for computers since the 1970s, supplemented by the computer mouse since the 1980s, and
the touchscreen since the 2000s.
Keyboard keys (buttons) typically have a set of characters engraved or printed on them, and each press of
a key typically corresponds to a single written symbol. However, producing some symbols may require
pressing and holding several keys simultaneously or in sequence. While most keys produce characters
(letters, numbers or symbols), other keys (such as the escape key) can prompt the computer to execute
system commands. In a modern computer, the interpretation of key presses is generally left to the software:
the information sent to the computer, the scan code, tells it only which physical key (or keys) was pressed
or released.

A computer mouse (plural mice; rarely also mouses) [nb 1] is a hand-held pointing device that detects two-
dimensional motion relative to a surface. This motion is typically translated into the motion of the pointer
(called a cursor) on a display, which allows a smooth control of the graphical user interface of a computer.
The first public demonstration of a mouse controlling a computer system was done by Doug Engelbart in
1968 as part of the Mother of All Demos. Mice originally used two separate wheels to directly track
movement across a surface: one in the x-dimension and one in the Y. Later, the standard design shifted to
use a ball rolling on a surface to detect motion, in turn connected to internal rollers. Most modern mice use
optical movement detection with no moving parts. Though originally all mice were connected to a computer
by a cable, many modern mice are cordless, relying on short-range radio communication with the
connected system.

A motherboard, also called a mainboard, a system board, a logic board, and informally a mobo (see
"Nomenclature" section), is the main printed circuit board (PCB) in general-purpose computers and other
expandable systems. It holds and allows communication between many of the crucial electronic
components of a system, such as the central processing unit (CPU) and memory, and provides connectors
for other peripherals.

Unlike a backplane, a motherboard usually contains significant sub-systems, such as the CPU, the chipset's
input/output and memory controllers, interface connectors, and other components integrated for general
use.

A central processing unit (CPU), also called a central processor, main processor, or just processor, is the
primary processor in a given computer. Its electronic circuitry executes instructions of a computer program,
such as arithmetic, logic, controlling, and input/output (I/O) operations. This role contrasts with that of
external components, such as main memory and I/O circuitry,[6] and specialized coprocessors such as
graphics processing units (GPUs).

Random-access memory (RAM; /ræm/) is a form of electronic computer memory that can be read and
changed in any order, typically used to store working data and machine code. A random-access memory
device allows data items to be read or written in almost the same amount of time irrespective of the physical
location of data inside the memory, in contrast with other direct-access data storage media (such as hard
disks and magnetic tape), where the time required to read and write data items varies significantly
depending on their physical locations on the recording medium, due to mechanical limitations such as
media rotation speeds and arm movement.
A solid-state drive (SSD) is a type of solid-state storage device that uses integrated circuits to store data
persistently. It is sometimes called semiconductor storage device, solid-state device, or solid-state disk.

A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device
that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters
coated with magnetic material. The platters are paired with magnetic heads, usually arranged on a moving
actuator arm, which read and write data to the platter surfaces. Data is accessed in a random-access
manner, meaning that individual blocks of data can be stored and retrieved in any order. HDDs are a type
of non-volatile storage, retaining stored data when powered off. Modern HDDs are typically in the form of a
small rectangular box.

In computing, an optical disc drive (ODD) is a disc drive that uses laser light or electromagnetic waves
within or near the visible light spectrum as part of the process of reading or writing data to or from optical
discs. Some drives can only read from certain discs, while other drives can both read and record. Those
drives are called burners or writers since they physically burn the data onto on the discs. Compact discs,
DVDs, and Blu-ray discs are common types of optical media which can be read and recorded by such
drives.

In computing, a printer is a peripheral machine which makes a durable representation of graphics or text,
usually on paper. While most output is human-readable, bar code printers are an example of an expanded
use for printers. Different types of printers include 3D printers, inkjet printers, laser printers, and thermal
printers.

The Mark I was disassembled in 1959; part of it was given to IBM, part went to the Smithsonian Institution,
and part entered the Harvard Collection of Historical Scientific Instruments. For decades, Harvard's portion
was on display in the lobby of the Aiken Computation Lab. About 1997, it was moved to the Harvard Science
Center. In 2021, it was moved again, to the lobby of Harvard's new Science and Engineering Complex in
Allston, Massachusetts.

According to Edmund Berkeley, the operators of the Mark I often called the machine "Bessy, the Bessel
engine", after Bessel functions.

The Harvard Mark I, or IBM Automatic Sequence Controlled Calculator (ASCC), was one of the earliest
general-purpose electromechanical computers used in the war effort during the last part of World War II.

The Atanasoff–Berry computer (ABC) was the first automatic electronic digital computer.[1] The device was
limited by the technology of the day. The ABC's priority is debated among historians of computer
technology, because it was neither programmable, nor Turing-complete.[2] Conventionally, the ABC would
be considered the first electronic ALU (arithmetic logic unit) – which is integrated into every modern
processor's design.

ENIAC (/ˈɛniæk/; Electronic Numerical Integrator and Computer) was the first programmable, electronic,
general-purpose digital computer, completed in 1945. Other computers had some of these features, but
ENIAC was the first to have them all. It was Turing-complete and able to solve "a large class of numerical
problems" through reprogramming.

ENIAC was designed by John Mauchly and J. Presper Eckert to calculate artillery firing tables for the United
States Army's Ballistic Research Laboratory (which later became a part of the Army Research Laboratory).
However, its first program was a study of the feasibility of the thermonuclear weapon.

EDVAC (Electronic Discrete Variable Automatic Computer) was one of the earliest electronic computers. It
was built by Moore School of Electrical Engineering at the University of Pennsylvania.[1][2]: 626–628 Along
with ORDVAC, it was a successor to the ENIAC. Unlike ENIAC, it was binary rather than decimal, and was
designed to be a stored-program computer.

ENIAC inventors, John Mauchly and J. Presper Eckert, proposed the EDVAC's construction in August 1945.
A contract to build the new computer was signed in April 1946 with an initial budget of US$100,000. EDVAC
was delivered to the Ballistic Research Laboratory in 1949. The Ballistic Research Laboratory became a
part of the US Army Research Laboratory in 1952.

The Electronic Delay Storage Automatic Calculator (EDSAC) was an early British computer. Inspired by
John von Neumann's seminal First Draft of a Report on the EDVAC, the machine was constructed by
Maurice Wilkes and his team at the University of Cambridge Mathematical Laboratory in England to provide
a service to the university. EDSAC was the second electronic digital stored-program computer, after the
Manchester Mark 1, to go into regular service.

The Manchester Mark 1 was one of the earliest stored-program computers, developed at the Victoria
University of Manchester, England from the Manchester Baby (operational in June 1948). Work began in
August 1948, and the first version was operational by April 1949; a program written to search for Mersenne
primes ran error-free for nine hours on the night of 16/17 June 1949.

The UNIVAC I (Universal Automatic Computer I) was the first general-purpose electronic digital computer
design for business application produced in the United States. It was designed principally by J. Presper
Eckert and John Mauchly, the inventors of the ENIAC. Design work was started by their company, Eckert–
Mauchly Computer Corporation (EMCC), and was completed after the company had been acquired by
Remington Rand (which later became part of Sperry, now Unisys). In the years before successor models of
the UNIVAC I appeared, the machine was simply known as "the UNIVAC".

A vacuum tube, electron tube, thermionic valve (British usage), or tube (North America) is a device that
controls electric current flow in a high vacuum between electrodes to which an electric potential difference
has been applied. It takes the form of an evacuated tubular envelope of glass or sometimes metal containing
electrodes connected to external connection pins.

A transistor is a semiconductor device used to amplify or switch electrical signals and power. It is one of
the basic building blocks of modern electronics. It is composed of semiconductor material, usually with at
least three terminals for connection to an electronic circuit. A voltage or current applied to one pair of the
transistor's terminals controls the current through another pair of terminals. Because the controlled (output)
power can be higher than the controlling (input) power, a transistor can amplify a signal. Some transistors
are packaged individually, but many more in miniature form are found embedded in integrated circuits.
Because transistors are the key active components in practically all modern electronics, many people
consider them one of the 20th century's greatest inventions.

An integrated circuit (IC), also known as a microchip or simply chip, is a set of electronic circuits, consisting
of various electronic components (such as transistors, resistors, and capacitors) and their interconnections.
These components are etched onto a small, flat piece ("chip") of semiconductor material, usually silicon.
Integrated circuits are used in a wide range of electronic devices, including computers, smartphones, and
televisions, to perform various functions such as processing and storing information. They have greatly
impacted the field of electronics by enabling device miniaturization and enhanced functionality.
ONLINE TERMINOLOGIES

1. IP Address (Internet Protocol Address)


Definition: A unique numerical label assigned to each device connected to the internet.
Example: The IP address “[Link]” is often used as the default for home routers.

2. URL (Uniform Resource Locator)


Definition: The address of a specific web page or resource online.
Example: The URL for Google is [Link]

3. HTTP (HyperText Transfer Protocol)


Definition: A protocol used to transfer data over the web.
Example: Websites like [Link] use HTTP to send web pages to your browser.

4. DNS (Domain Name System)


Definition: A system that translates domain names into IP addresses.
Example: When you type [Link], DNS converts it to the IP address of Facebook’s server.

5. Bandwidth
Definition: The amount of data transmitted over an internet connection in a given time.
Example: A 100 Mbps connection can download files faster than a 10 Mbps connection.

6. Firewall
Definition: A security system that monitors and controls incoming and outgoing network traffic.
Example: Companies use firewalls to block unauthorized access to their networks.

7. VPN (Virtual Private Network)


Definition: A service that encrypts your internet connection to protect privacy.
Example: People use VPNs to access content restricted in their country.

8. Cookies
Definition: Small files stored on your computer by websites to remember your preferences.
Example: An online store saves items in your cart using cookies.

9. Search Engine
Definition: A tool used to find information on the internet.
Example: Google and Bing are popular search engines.

10. ISP (Internet Service Provider)


Definition: A company that provides internet access to users.
Example: Comcast and AT&T are examples of ISPs in the U.S.

11. Wi-Fi (Wireless Fidelity)


Definition: A technology that allows devices to connect to the internet wirelessly.
Example: Your smartphone connects to the internet via your home Wi-Fi network.

12. Browser
Definition: A software application used to access and view websites.
Example: Google Chrome, Mozilla Firefox, and Safari are popular browsers.

13. Cache
Definition: A storage area where frequently accessed data is saved for quicker access.
Example: Websites load faster because their images are saved in your browser’s cache.

14. Spam
Definition: Unwanted or irrelevant messages, often sent in bulk.
Example: Receiving promotional emails that you didn’t sign up for.

15. Cloud Computing


Definition: Using remote servers hosted on the internet to store, manage, and process data.
Example: Google Drive allows you to save files in the cloud.

16. Streaming
Definition: Watching or listening to content online without downloading it.
Example: Watching a movie on Netflix or listening to music on Spotify.

17. Malware (Malicious Software)


Definition: Software designed to harm or exploit devices.
Example: Viruses, spyware, and ransomware are types of malware.

18. Encryption
Definition: The process of converting data into a secure format to prevent unauthorized access.
Example: Online banking uses encryption to protect your sensitive information.

19. HTTPS (HyperText Transfer Protocol Secure)


Definition: A secure version of HTTP that encrypts data for safe communication.
Example: Websites like [Link] use HTTPS for secure transactions.

20. Bandwidth Throttling


Definition: Deliberate slowing down of internet speed by an ISP.
Example: Streaming speed decreases when an ISP throttles bandwidth during high traffic.

21. Ping
Definition: A test to measure the time it takes for a data packet to travel to a server and back.
Example: Gamers check their ping to ensure smooth gameplay.

22. Data Packet


Definition: Small units of data transmitted over a network.
Example: Videos you stream are sent to your device in data packets.

23. Router
Definition: A device that connects multiple devices to a network.
Example: Your home router connects your phone, laptop, and smart TV to the internet.

24. FTP (File Transfer Protocol)


Definition: A standard protocol for transferring files between computers.
Example: Websites use FTP to upload files to their servers.

25. Web Server


Definition: A computer that hosts websites and delivers web pages to users.
Example: Amazon’s website is hosted on powerful web servers.

26. Domain Name


Definition: The human-readable address of a website.
Example: [Link] is the domain name of Wikipedia.

27. IoT (Internet of Things)


Definition: A network of interconnected devices that communicate via the internet.
Example: Smart home devices like Alexa and smart thermostats are part of IoT.

28. Phishing
Definition: A cyberattack that tricks people into sharing sensitive information.
Example: Fake emails pretending to be from your bank asking for account details.

29. Web Hosting


Definition: A service that stores website files and makes them accessible online.
Example: Bluehost and HostGator are companies that provide web hosting services.
30. Cookie Policy
Definition: A statement explaining how websites use cookies.
Example: Before using a website, you might see a pop-up about their cookie policy.
ALL ABOUT C++ PROGRAMMING

Difference between Coding and Programming


“Coding is basically the process of creating codes from one language to another one. It can also be called
as a subset of Programming since it actually implements the initial steps of Programming. It involves
writing codes in different languages as instructed. Programming is the process of developing an executable
machine level program that can be implemented without any error. It is the process of formally writing
codes so that the human inputs and corresponding machine outputs remain in sync.” (Bailey, 2019)

C++ Programming
• The ++ in C++ means an increment operator. Therefore, C++ means C language is incremented to
its next level
• It was developed by Bjarne Stroustrup at Bell Labs in the early 1980s.
• It contains all elements of the basic C language.
• It was expanded to include numerous object-oriented programming features.
• It provides a collection of predefined classes, along with the capability of user-defined classes.
• The language was updated 3 major times in 2011, 2014, and 2017 to C++11, C++14, and C++17.

Writing, debugging, and compiling C++ code effectively requires an Integrated Development
Environment (IDE). With features like syntax highlighting, auto-completion, and integrated debugging tools,
it offers an intuitive interface that makes coding tasks easier. In addition, the IDE comes with a debugger to
help find and correct errors before the program runs, as well as a compiler to convert written code into
executable programs. Features, compatibility with various operating systems, and ease of use are all
important considerations when selecting an IDE. Popular options include CLion, which incorporates
intelligent coding assistance, Code::Blocks, which is renowned for its lightweight and configurable interface,
and Visual Studio, which provides a comprehensive feature set. Whether for complex development projects
or programming for beginners, each IDE meets a different set of needs.
Installing the program and configuring it with an appropriate C++ compiler, such as MinGW or GCC, is the
first step in using a C++ IDE. Examine important features like build automation, which accelerates the
compilation process, and project management, which aids in organizing numerous files, after installation.
Writing a simple program, like a "Hello, World!" script, can help you get acquainted with the features and
layout of the IDE. Programmers can examine variables, set breakpoints, and step through code execution
for troubleshooting with the help of debugging tools, which are also essential for development. Coding
efficiency can be increased by experimenting with more complex features like code refactoring, version
control integration, and performance profiling as you become familiar to the IDE.

Procedure for Understanding C++ Programming


Step 1: Introduction to C++ Bjarne Stroustrup created C++, a high-level, general-purpose programming
language, in 1985. By adding object-oriented programming features, it expands the C programming
language and makes it appropriate for system programming, game development, and applications requiring
high performance. Before exploring into more complex subjects, it is crucial to understand its fundamental
ideas, including data types, control structures, and functions.

Step 2: Setting Up a C++ Development Environment


Installing an appropriate Integrated Development Environment (IDE), such as Visual Studio, Code::Blocks,
or CLion, is necessary before beginning to program in C++. Make sure the IDE has a C++ compiler

set up correctly, such as GCC or MinGW. Writing a straightforward "Hello, World!" program aids in
confirming that the configuration is operating as had in mind.

Step 3: Learning Basic Syntax and Concepts


Start with basic ideas like operators, data types, variables, and control structures (loops and conditionals).
It is essential to comprehend functions and their function in modular programming. Write short programs to
help you remember these ideas.

Step 4: Exploring Object-Oriented Programming (OOP)


Object-oriented programming, which encompasses ideas like classes, objects, inheritance, polymorphism,
and sealing, is supported by C++. Code organization and reusability are improved by learning how to create
and implement classes.
Step 5: Understanding Memory Management
C++ offers dynamic allocation, disposal, and pointers for manual memory management. Gaining an
understanding of these ideas is crucial for effective programming and preventing memory leaks.

Step 6: Working with Standard Libraries


Vectors, maps, algorithms, and other pre-built functions and data structures are available through the
Standard Template Library (STL). Using STL increases productivity and minimizes challenging
programming tasks.

Step 7: Debugging and Optimization


Errors can be found and fixed with the aid of debugging tools in an IDE. Program performance is
enhanced by mastering optimization strategies like memory management and effective algorithm design.

Step 8: Advanced Topics and Practical Applications


Examine more complex subjects like file management, network programming, and multitasking. Use your
understanding of C++ for practical projects like systems programming, software engineering, and game
development.

#include <iostream> is a preprocessor directive in C++ that instructs the compiler to include the contents
of the iostream header file. This header file provides the necessary tools for input and output operations,
such as reading from the keyboard and writing to the console.

The iostream header file declares objects like cin (standard input stream), cout (standard output stream),
cerr (standard error stream), and clog (buffered standard error stream). These objects allow programs to
interact with the user and the system. For example, cout is used to print text to the console, and cin is used
to read input from the user.

Without including iostream, it is not possible to use these input/output functionalities, making it a crucial part
of many C++ programs, especially those that require user interaction or display information.

In C++, using namespace std; is a directive that makes all names from the std namespace available without
having to explicitly qualify them. The std namespace contains standard library components like cin, cout,
vector, and others. By using this directive, one can write cout instead of std::cout, simplifying the code.

However, using using namespace std; is often considered bad practice, especially in header files or large
projects, due to the risk of name collisions. If the project uses another library that defines the same name
as one in std, it can lead to ambiguity and compilation errors. It is generally preferred to either qualify names
with std:: or use specific using declarations for individual names, like using std::cout;. This approach
provides better control and avoids potential naming conflicts.

In C and C++, int main defines the entry point of a program. The int keyword indicates that the function
returns an integer value to the operating system upon completion. This return value signals the program's
execution status, where 0 typically signifies successful execution, and non-zero values indicate errors.

The main function can be defined with or without parameters. Common forms include:
int main(): Accepts no command-line arguments.
int main(int argc, char *argv[]): Accepts command-line arguments, where argc is the argument count and
argv is an array of argument strings.
The main function is essential in C/C++ programs, as it dictates where the program begins execution and
how it interacts with the operating system.

C++ data types can be categorized into three main types: built-in, user-defined, and derived.

Built-in (Primitive) Data Types:


These are predefined data types provided by the C++ language.
• int: Used for storing integers (whole numbers), e.g., 10, -5, 0.
• float: Used for storing single-precision floating-point numbers (numbers with decimal points), e.g.,
3.14, -2.5.
• double: Used for storing double-precision floating-point numbers, offering higher precision than
float, e.g., 3.14159265359.
• char: Used for storing single characters, e.g., 'a', 'B', ' '.
• bool: Used for storing boolean values, either true or false.

Pseudocode:
It is one of the methods which can be used to represent an algorithm for a program. It does not have a
specific syntax like any of the programming languages and thus cannot be executed on a computer. There
are several formats which are used to write pseudo-codes and most of them take down the structures from
languages such as C, Lisp, FORTRAN, etc.
Many time algorithms are presented using pseudocode since they can be read and understood by
programmers who are familiar with different programming languages. Pseudocode allows you to include
several control structures such as While, If-then-else, Repeat-until, for and case, which is present in many
high-level languages.
Note: Pseudocode is not an actual programming language.

Algorithm:

An algorithm is used to provide a solution to a particular problem in form of well-defined steps. Whenever
you use a computer to solve a particular problem, the steps which lead to the solution should be properly
communicated to the computer. While executing an algorithm on a computer, several operations such as
additions and subtractions are combined to perform more complex mathematical operations. Algorithms
can be expressed using natural language, flowcharts, etc.

Algorithm : Systematic logical approach which is a well-defined, step-by-step procedure that allows a
computer to solve a problem.

Pseudocode : It is a simpler version of a programming code in plain English which uses short phrases to
write code for a program before it is implemented in a specific programming language.

Program : It is exact code written for problem following all the rules of the programming language.
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Ref Page Chapter 1: Introduction to Computers Slide 1/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Learning Objectives

In this chapter you will learn about:

§ Computer
§ Data processing
§ Characteristic features of computers
§ Computers’ evolution to their present form
§ Computer generations
§ Characteristic features of each computer generation

Ref Page 01 Chapter 1: Introduction to Computers Slide 2/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Computer

§ The word computer comes from the word “compute”,


which means, “to calculate”

§ Thereby, a computer is an electronic device that can


perform arithmetic operations at high speed

§ A computer is also called a data processor because it can


store, process, and retrieve data whenever desired

Ref Page 01 Chapter 1: Introduction to Computers Slide 3/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Data Processing

The activity of processing data using a computer is called


data processing
Data

Capture Data

Manipulate Data

Output Results

Information
Data is raw material used as input and information is
processed data obtained as output of data processing

Ref Page 01 Chapter 1: Introduction to Computers Slide 4/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Characteristics of Computers

1) Automatic: Given a job, computer can work on it


automatically without human interventions

2) Speed: Computer can perform data processing jobs


very fast, usually measured in microseconds (10-6),
nanoseconds (10-9), and picoseconds (10-12)

3) Accuracy: Accuracy of a computer is consistently high


and the degree of its accuracy depends upon its design.
Computer errors caused due to incorrect input data or
unreliable programs are often referred to as Garbage-
In-Garbage-Out (GIGO)

(Continued on next slide)

Ref Page 02 Chapter 1: Introduction to Computers Slide 5/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Characteristics of Computers
(Continued from previous slide..)

4) Diligence: Computer is free from monotony, tiredness,


and lack of concentration. It can continuously work for
hours without creating any error and without grumbling

5) Versatility: Computer is capable of performing almost


any task, if the task can be reduced to a finite series of
logical steps

6) Power of Remembering: Computer can store and


recall any amount of information because of its
secondary storage capability. It forgets or looses certain
information only when it is asked to do so

(Continued on next slide)

Ref Page 02 Chapter 1: Introduction to Computers Slide 6/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Characteristics of Computers
(Continued from previous slide..)

7) No I.Q.: A computer does only what it is programmed


to do. It cannot take its own decision in this regard

8) No Feelings: Computers are devoid of emotions. Their


judgement is based on the instructions given to them in
the form of programs that are written by us (human
beings)

(Continued on next slide)

Ref Page 03 Chapter 1: Introduction to Computers Slide 7/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Evolution of Computers

§ Blaise Pascal invented the first mechanical adding


machine in 1642
§ Baron Gottfried Wilhelm von Leibniz invented the first
calculator for multiplication in 1671
§ Keyboard machines originated in the United States
around 1880
§ Around 1880, Herman Hollerith came up with the concept
of punched cards that were extensively used as input
media until late 1970s

Ref Page 03 Chapter 1: Introduction to Computers Slide 8/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Evolution of Computers
(Continued from previous slide..)

§ Charles Babbage is considered to be the father of


modern digital computers

§ He designed “Difference Engine” in 1822

§ He designed a fully automatic analytical engine in


1842 for performing basic arithmetic functions

§ His efforts established a number of principles that


are fundamental to the design of any digital
computer

(Continued on next slide)

Ref Page 03 Chapter 1: Introduction to Computers Slide 9/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Some Well Known Early Computers

§ The Mark I Computer (1937-44)


§ The Atanasoff-Berry Computer (1939-42)
§ The ENIAC (1943-46)
§ The EDVAC (1946-52)
§ The EDSAC (1947-49)
§ Manchester Mark I (1948)
§ The UNIVAC I (1951)

Ref Page 03 Chapter 1: Introduction to Computers Slide 10/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Computer Generations

§ “Generation” in computer talk is a step in technology. It


provides a framework for the growth of computer industry

§ Originally it was used to distinguish between various


hardware technologies, but now it has been extended to
include both hardware and software

§ Till today, there are five computer generations

(Continued on next slide)

Ref Page 05 Chapter 1: Introduction to Computers Slide 11/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Computer Generations
(Continued from previous slide..)

Key hardware Key software Key Some


Generation
representative
(Period) technologies technologies characteristics systems

First § Vacuum tubes § Machine and § Bulky in size § ENIAC


(1942-1955) § Electromagnetic assembly § Highly unreliable § EDVAC
relay memory languages § Limited commercial § EDSAC
§ Punched cards § Stored program use and costly § UNIVAC I
secondary storage concept § Difficult commercial § IBM 701
§ Mostly scientific production
applications § Difficult to use
Second § Transistors § Batch operating § Faster, smaller, more § Honeywell 400
(1955-1964) § Magnetic cores system reliable and easier to § IBM 7030
memory § High-level program than previous § CDC 1604
§ Magnetic tapes programming generation systems
§ UNIVAC LARC
§ Disks for secondary languages § Commercial production
storage § Scientific and was still difficult and
commercial costly
applications

(Continued on next slide)

Ref Page 13 Chapter 1: Introduction to Computers Slide 12/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Computer Generations
(Continued from previous slide..)

Generation Key hardware Key software Key Some rep.


(Period) technologies technologies characteristics systems

Third § ICs with SSI and § Timesharing § Faster, smaller, more § IBM 360/370
(1964-1975) MSI technologies operating reliable, easier and § PDP-8
§ Larger magnetic system cheaper to produce § PDP-11
cores memory § Standardization § Commercially, easier § CDC 6600
§ Larger capacity of high-level to use, and easier to
disks and programming upgrade than
magnetic tapes languages previous generation
secondary § Unbundling of systems
storage software from § Scientific, commercial
§ Minicomputers; hardware and interactive on-
upward line applications
compatible family
of computers

(Continued on next slide)

Ref Page 13 Chapter 1: Introduction to Computers Slide 13/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Computer Generations
(Continued from previous slide..)

Generation Key hardware Key software Key Some rep.


(Period) Technologies technologies characteristics systems

Fourth § ICs with VLSI § Operating systems for § Small, affordable, § IBM PC and
(1975-1989) technology PCs with GUI and reliable, and easy its clones
§ Microprocessors; multiple windows on a to use PCs § Apple II
semiconductor memory single terminal screen § More powerful § TRS-80
§ Larger capacity hard § Multiprocessing OS and reliable § VAX 9000
disks as in-built with concurrent mainframe
programming systems and § CRAY-1
secondary storage
languages supercomputers § CRAY-2
§ Magnetic tapes and
floppy disks as portable § UNIX operating system § Totally general § CRAY-X/MP
storage media with C programming purpose machines
§ Personal computers language § Easier to produce
§ Supercomputers based § Object-oriented design commercially
on parallel vector and programming § Easier to upgrade
processing and § PC, Network-based, § Rapid software
symmetric and supercomputing development
multiprocessing applications possible
technologies
§ Spread of high-speed
computer networks

(Continued on next slide)

Ref Page 13 Chapter 1: Introduction to Computers Slide 14/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Computer Generations
(Continued from previous slide..)

Generation Key hardware Key software Key Some rep.


(Period) technologies technologies characteristics systems

Fifth § ICs with ULSI § Micro-kernel based, § Portable computers § IBM notebooks
(1989- technology multithreading, § Powerful, cheaper, § Pentium PCs
Present) § Larger capacity distributed OS reliable, and easier § SUN
main memory, § Parallel to use desktop Workstations
hard disks with programming machines § IBM SP/2
RAID support libraries like MPI & § Powerful
PVM § SGI Origin 2000
§ Optical disks as supercomputers
portable read-only § JAVA § PARAM 10000
§ High uptime due to
storage media § World Wide Web hot-pluggable
§ Notebooks, § Multimedia, components
powerful desktop Internet § Totally general
PCs and applications purpose machines
workstations § More complex § Easier to produce
§ Powerful servers, supercomputing commercially,
supercomputers applications easier to upgrade
§ Internet § Rapid software
§ Cluster computing development
possible

Ref Page 13 Chapter 1: Introduction to Computers Slide 15/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Electronic
Electronic Devices
Devices Used
Used in
in Computers
Computers of
of Different
Different Generations
Generations

(a) A Vacuum Tube (b) A Transistor (c) An IC Chip

Ref Page 07 Chapter 1: Introduction to Computers Slide 16/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Key Words/Phrases

§ Computer § Integrated Circuit (IC)


§ Computer generations § Large Scale Integration (VLSI)
§ Computer Supported Cooperative § Medium Scale Integration (MSI)
Working (CSCW) § Microprocessor
§ Data § Personal Computer (PC)
§ Data processing § Second-generation computers
§ Data processor § Small Scale Integration (SSI)
§ First-generation computers § Stored program concept
§ Fourth-generation computers § Third-generation computers
§ Garbage-in-garbage-out (GIGO) § Transistor
§ Graphical User Interface (GUI) § Ultra Large Scale Integration
§ Groupware (ULSI)
§ Information § Vacuum tubes

Ref Page 12 Chapter 1: Introduction to Computers Slide 17/17


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Ref. Page Chapter 2: Basic Computer Organization Slide 1/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Learning Objectives

In this chapter you will learn about:


§ Basic operations performed by all types of computer
systems
§ Basic organization of a computer system
§ Input unit and its functions
§ Output unit and its functions
§ Storage unit and its functions
§ Types of storage used in a computer system

(Continued on next slide)

Ref. Page 15 Chapter 2: Basic Computer Organization Slide 2/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Learning Objectives
(Continued from previous slide..)

§ Arithmetic Logic Unit (ALU)

§ Control Unit (CU)

§ Central Processing Unit (CPU)

§ Computer as a system

Ref. Page 15 Chapter 2: Basic Computer Organization Slide 3/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

The Five Basic Operations of a Computer System

§ Inputting. The process of entering data and instructions


into the computer system

§ Storing. Saving data and instructions to make them


readily available for initial or additional processing
whenever required

§ Processing. Performing arithmetic operations (add,


subtract, multiply, divide, etc.) or logical operations
(comparisons like equal to, less than, greater than, etc.)
on data to convert them into useful information

(Continued on next slide)

Ref. Page 15 Chapter 2: Basic Computer Organization Slide 4/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

The Five Basic Operations of a Computer System

§ Outputting. The process of producing useful information


or results for the user such as a printed report or visual
display

§ Controlling. Directing the manner and sequence in which


all of the above operations are performed

Ref. Page 15 Chapter 2: Basic Computer Organization Slide 5/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Basic Organization of a Computer System

Storage Unit

Secondary
Storage

Program Input Output Information


and Unit Unit (Results)
Data Primary
Storage

Control
Unit
Indicates flow of
instructions and data
Arithmetic Indicates the control
Logic Unit exercised by the
control unit
Central Processing Unit (CPU)

Ref. Page 16 Chapter 2: Basic Computer Organization Slide 6/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Input Unit

An input unit of a computer system performs the


following functions:

1. It accepts (or reads) instructions and data from outside


world
2. It converts these instructions and data in computer
acceptable form
3. It supplies the converted instructions and data to the
computer system for further processing

Ref. Page 16 Chapter 2: Basic Computer Organization Slide 7/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Output Unit

An output unit of a computer system performs the


following functions:

1. It accepts the results produced by the computer, which


are in coded form and hence, cannot be easily
understood by us
2. It converts these coded results to human acceptable
(readable) form
3. It supplies the converted results to outside world

Ref. Page 16 Chapter 2: Basic Computer Organization Slide 8/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Storage Unit

The storage unit of a computer system holds (or stores)


the following :

1. Data and instructions required for processing (received


from input devices)
2. Intermediate results of processing
3. Final results of processing, before they are released to
an output device

Ref. Page 17 Chapter 2: Basic Computer Organization Slide 9/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Two Types of Storage

§ Primary storage

§ Used to hold running program instructions


§ Used to hold data, intermediate results, and
results of ongoing processing of job(s)
§ Fast in operation
§ Small Capacity
§ Expensive
§ Volatile (looses data on power dissipation)

(Continued on next slide)

Ref. Page 17 Chapter 2: Basic Computer Organization Slide 10/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Two Types of Storage


(Continued from previous slide..)

§ Secondary storage

§ Used to hold stored program instructions


§ Used to hold data and information of stored jobs
§ Slower than primary storage
§ Large Capacity
§ Lot cheaper that primary storage
§ Retains data even without power

Ref. Page 17 Chapter 2: Basic Computer Organization Slide 11/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Arithmetic Logic Unit (ALU)

Arithmetic Logic Unit of a computer system is the place


where the actual executions of instructions takes place during
processing operation

Ref. Page 18 Chapter 2: Basic Computer Organization Slide 12/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Control Unit (CU)

Control Unit of a computer system manages and coordinates


the operations of all other components of the computer
system

Ref. Page 18 Chapter 2: Basic Computer Organization Slide 13/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Central Processing Unit (CPU)

Arithmetic Central
Logic Unit Control Unit = Processing
+ (CU)
(ALU) Unit (CPU)

§ It is the brain of a computer system

§ It is responsible for controlling the operations of


all other units of a computer system

Ref. Page 18 Chapter 2: Basic Computer Organization Slide 14/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

The System Concept

A system has following three characteristics:

1. A system has more than one element


2. All elements of a system are logically related
3. All elements of a system are controlled in a manner to
achieve the system goal

A computer is a system as it comprises of integrated


components (input unit, output unit, storage unit, and CPU)
that work together to perform the steps called for in the
executing program

Ref. Page 18 Chapter 2: Basic Computer Organization Slide 15/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Key Words/Phrases

§ Arithmetic Logic Unit (ALU) § Output interface


§ Auxiliary storage § Output unit
§ Central Processing Unit (CPU) § Outputting
§ Computer system § Primate storage
§ Control Unit (CU) § Processing
§ Controlling § Secondary storage
§ Input interface § Storage unit
§ Input unit § Storing
§ Inputting § System
§ Main memory

Ref. Page 19 Chapter 2: Basic Computer Organization Slide 16/16


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Ref Page Chapter 3: Number Systems Slide 1/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Learning Objectives

In this chapter you will learn about:

§ Non-positional number system


§ Positional number system
§ Decimal number system
§ Binary number system
§ Octal number system
§ Hexadecimal number system

(Continued on next slide)

Ref Page 20 Chapter 3: Number Systems Slide 2/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Learning Objectives
(Continued from previous slide..)

§ Convert a number’s base


§ Another base to decimal base
§ Decimal base to another base
§ Some base to another base
§ Shortcut methods for converting
§ Binary to octal number
§ Octal to binary number
§ Binary to hexadecimal number
§ Hexadecimal to binary number
§ Fractional numbers in binary number system

Ref Page 20 Chapter 3: Number Systems Slide 3/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Number Systems

Two types of number systems are:

§ Non-positional number systems

§ Positional number systems

Ref Page 20 Chapter 3: Number Systems Slide 4/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Non-positional Number Systems

§ Characteristics
§ Use symbols such as I for 1, II for 2, III for 3, IIII
for 4, IIIII for 5, etc
§ Each symbol represents the same value regardless
of its position in the number
§ The symbols are simply added to find out the value
of a particular number

§ Difficulty
§ It is difficult to perform arithmetic with such a
number system

Ref Page 20 Chapter 3: Number Systems Slide 5/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Positional Number Systems

§ Characteristics

§ Use only a few symbols called digits

§ These symbols represent different values depending


on the position they occupy in the number

(Continued on next slide)

Ref Page 20 Chapter 3: Number Systems Slide 6/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Positional Number Systems


(Continued from previous slide..)

§ The value of each digit is determined by:


1. The digit itself
2. The position of the digit in the number
3. The base of the number system

(base = total number of digits in the number


system)

§ The maximum value of a single digit is


always equal to one less than the value of
the base

Ref Page 21 Chapter 3: Number Systems Slide 7/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Decimal Number System

Characteristics
§ A positional number system
§ Has 10 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7,
8, 9). Hence, its base = 10
§ The maximum value of a single digit is 9 (one
less than the value of the base)
§ Each position of a digit represents a specific
power of the base (10)
§ We use this number system in our day-to-day
life

(Continued on next slide)

Ref Page 21 Chapter 3: Number Systems Slide 8/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Decimal Number System


(Continued from previous slide..)

Example

258610 = (2 x 103) + (5 x 102) + (8 x 101) + (6 x 100)

= 2000 + 500 + 80 + 6

Ref Page 21 Chapter 3: Number Systems Slide 9/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Number System

Characteristics
§ A positional number system
§ Has only 2 symbols or digits (0 and 1). Hence its
base = 2
§ The maximum value of a single digit is 1 (one less
than the value of the base)
§ Each position of a digit represents a specific power
of the base (2)
§ This number system is used in computers

(Continued on next slide)

Ref Page 21 Chapter 3: Number Systems Slide 10/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Number System


(Continued from previous slide..)

Example

101012 = (1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) x (1 x 20)

= 16 + 0 + 4 + 0 + 1

= 2110

Ref Page 21 Chapter 3: Number Systems Slide 11/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Representing Numbers in Different Number
Systems

In order to be specific about which number system we


are referring to, it is a common practice to indicate the
base as a subscript. Thus, we write:

101012 = 2110

Ref Page 21 Chapter 3: Number Systems Slide 12/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Bit

§ Bit stands for binary digit

§ A bit in computer terminology means either a 0 or a 1

§ A binary number consisting of n bits is called an n-bit


number

Ref Page 22 Chapter 3: Number Systems Slide 13/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Octal Number System

Characteristics
§ A positional number system
§ Has total 8 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7).
Hence, its base = 8
§ The maximum value of a single digit is 7 (one less
than the value of the base
§ Each position of a digit represents a specific power of
the base (8)

(Continued on next slide)

Ref Page 22 Chapter 3: Number Systems Slide 14/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Octal Number System


(Continued from previous slide..)

§ Since there are only 8 digits, 3 bits (23 = 8) are


sufficient to represent any octal number in binary

Example

20578 = (2 x 83) + (0 x 82) + (5 x 81) + (7 x 80)

= 1024 + 0 + 40 + 7

= 107110

Ref Page 22 Chapter 3: Number Systems Slide 15/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Hexadecimal Number System

Characteristics
§ A positional number system
§ Has total 16 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7,
8, 9, A, B, C, D, E, F). Hence its base = 16
§ The symbols A, B, C, D, E and F represent the
decimal values 10, 11, 12, 13, 14 and 15
respectively
§ The maximum value of a single digit is 15 (one less
than the value of the base)

(Continued on next slide)

Ref Page 22 Chapter 3: Number Systems Slide 16/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Hexadecimal Number System


(Continued from previous slide..)

§ Each position of a digit represents a specific power


of the base (16)
§ Since there are only 16 digits, 4 bits (24 = 16) are
sufficient to represent any hexadecimal number in
binary

Example
1AF16 = (1 x 162) + (A x 161) + (F x 160)
= 1 x 256 + 10 x 16 + 15 x 1
= 256 + 160 + 15
= 43110

Ref Page 22 Chapter 3: Number Systems Slide 17/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Converting a Number of Another Base to a


Decimal Number

Method

Step 1: Determine the column (positional) value of


each digit

Step 2: Multiply the obtained column values by the


digits in the corresponding columns

Step 3: Calculate the sum of these products

(Continued on next slide)

Ref Page 23 Chapter 3: Number Systems Slide 18/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Converting a Number of Another Base to a


Decimal Number
(Continued from previous slide..)

Example
47068 = ?10
Common
values
multiplied
47068 = 4 x 83 + 7 x 82 + 0 x 81 + 6 x 80 by the
corresponding
= 4 x 512 + 7 x 64 + 0 + 6 x 1 digits
= 2048 + 448 + 0 + 6 Sum of these
products
= 250210

Ref Page 23 Chapter 3: Number Systems Slide 19/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Converting a Decimal Number to a Number of


Another Base

Division-Remainder Method
Step 1: Divide the decimal number to be converted by
the value of the new base

Step 2: Record the remainder from Step 1 as the


rightmost digit (least significant digit) of the
new base number

Step 3: Divide the quotient of the previous divide by the


new base

(Continued on next slide)

Ref Page 25 Chapter 3: Number Systems Slide 20/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Converting a Decimal Number to a Number of


Another Base
(Continued from previous slide..)

Step 4: Record the remainder from Step 3 as the next


digit (to the left) of the new base number

Repeat Steps 3 and 4, recording remainders from right to


left, until the quotient becomes zero in Step 3

Note that the last remainder thus obtained will be the most
significant digit (MSD) of the new base number

(Continued on next slide)

Ref Page 25 Chapter 3: Number Systems Slide 21/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Converting a Decimal Number to a Number of


Another Base
(Continued from previous slide..)

Example
95210 = ?8

Solution:
8 952 Remainder
119 s 0
14 7
1 6
0 1

Hence, 95210 = 16708

Ref Page 26 Chapter 3: Number Systems Slide 22/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Converting a Number of Some Base to a Number


of Another Base

Method

Step 1: Convert the original number to a decimal


number (base 10)

Step 2: Convert the decimal number so obtained to


the new base number

(Continued on next slide)

Ref Page 27 Chapter 3: Number Systems Slide 23/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Converting a Number of Some Base to a Number


of Another Base
(Continued from previous slide..)

Example
5456 = ?4

Solution:
Step 1: Convert from base 6 to base 10

5456 = 5 x 62 + 4 x 61 + 5 x 60
= 5 x 36 + 4 x 6 + 5 x 1
= 180 + 24 + 5
= 20910

(Continued on next slide)

Ref Page 27 Chapter 3: Number Systems Slide 24/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Converting a Number of Some Base to a Number


of Another Base
(Continued from previous slide..)

Step 2: Convert 20910 to base 4

4 209 Remainders
52 1
13 0
3 1
0 3

Hence, 20910 = 31014

So, 5456 = 20910 = 31014

Thus, 5456 = 31014

Ref Page 28 Chapter 3: Number Systems Slide 25/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting a Binary Number


to its Equivalent Octal Number

Method
Step 1: Divide the digits into groups of three starting
from the right

Step 2: Convert each group of three binary digits to


one octal digit using the method of binary to
decimal conversion

(Continued on next slide)

Ref Page 29 Chapter 3: Number Systems Slide 26/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting a Binary Number


to its Equivalent Octal Number
(Continued from previous slide..)

Example
11010102 = ?8

Step 1: Divide the binary digits into groups of 3 starting


from right

001 101 010

Step 2: Convert each group into one octal digit

0012 = 0 x 22 + 0 x 21 + 1 x 20 = 1
1012 = 1 x 22 + 0 x 21 + 1 x 20 = 5
0102 = 0 x 22 + 1 x 21 + 0 x 20 = 2

Hence, 11010102 = 1528

Ref Page 29 Chapter 3: Number Systems Slide 27/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting an Octal


Number to Its Equivalent Binary Number

Method
Step 1: Convert each octal digit to a 3 digit binary
number (the octal digits may be treated as
decimal for this conversion)

Step 2: Combine all the resulting binary groups


(of 3 digits each) into a single binary
number

(Continued on next slide)

Ref Page 30 Chapter 3: Number Systems Slide 28/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting an Octal


Number to Its Equivalent Binary Number
(Continued from previous slide..)

Example
5628 = ?2

Step 1: Convert each octal digit to 3 binary digits


58 = 1012, 68 = 1102, 28 = 0102

Step 2: Combine the binary groups


5628 = 101 110 010
5 6 2

Hence, 5628 = 1011100102

Ref Page 30 Chapter 3: Number Systems Slide 29/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting a Binary


Number to its Equivalent Hexadecimal Number

Method

Step 1: Divide the binary digits into groups of four


starting from the right

Step 2: Combine each group of four binary digits to


one hexadecimal digit

(Continued on next slide)

Ref Page 30 Chapter 3: Number Systems Slide 30/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting a Binary


Number to its Equivalent Hexadecimal Number
(Continued from previous slide..)

Example

1111012 = ?16

Step 1: Divide the binary digits into groups of four


starting from the right

0011 1101

Step 2: Convert each group into a hexadecimal digit


00112 = 0 x 23 + 0 x 22 + 1 x 21 + 1 x 20 = 310 = 316
11012 = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 310 = D16

Hence, 1111012 = 3D16

Ref Page 31 Chapter 3: Number Systems Slide 31/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting a Hexadecimal


Number to its Equivalent Binary Number

Method

Step 1: Convert the decimal equivalent of each


hexadecimal digit to a 4 digit binary
number

Step 2: Combine all the resulting binary groups


(of 4 digits each) in a single binary number

(Continued on next slide)

Ref Page 31 Chapter 3: Number Systems Slide 32/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting a Hexadecimal


Number to its Equivalent Binary Number
(Continued from previous slide..)

Example

2AB16 = ?2

Step 1: Convert each hexadecimal digit to a 4 digit


binary number

216 = 210 = 00102


A16 = 1010 = 10102
B16 = 1110 = 10112

Ref Page 32 Chapter 3: Number Systems Slide 33/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Shortcut Method for Converting a Hexadecimal


Number to its Equivalent Binary Number
(Continued from previous slide..)

Step 2: Combine the binary groups


2AB16 = 0010 1010 1011
2 A B

Hence, 2AB16 = 0010101010112

Ref Page 32 Chapter 3: Number Systems Slide 34/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Fractional Numbers

Fractional numbers are formed same way as decimal


number system
In general, a number in a number system with base b
would be written as:
an an-1… a0 . a-1 a-2 … a-m

And would be interpreted to mean:


an x bn + an-1 x bn-1 + … + a0 x b0 + a-1 x b-1 + a-2 x b-2 +
… + a-m x b-m

The symbols an, an-1, …, a-m in above representation


should be one of the b symbols allowed in the number
system

Ref Page 33 Chapter 3: Number Systems Slide 35/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Formation of Fractional Numbers in


Binary Number System (Example)

Binary Point

Position 4 3 2 1 0 . -1 -2 -3 -4

Position Value 24 23 22 21 20 2-1 2-2 2-3 2-4

Quantity 16 8 4 2 1 1/
2
1/
4
1/
8
1/
16
Represented

(Continued on next slide)

Ref Page 33 Chapter 3: Number Systems Slide 36/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Formation of Fractional Numbers in


Binary Number System (Example)
(Continued from previous slide..)

Example

110.1012 = 1 x 22 + 1 x 21 + 0 x 20 + 1 x 2-1 + 0 x 2-2 + 1 x 2-3


= 4 + 2 + 0 + 0.5 + 0 + 0.125
= 6.62510

Ref Page 33 Chapter 3: Number Systems Slide 37/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Formation of Fractional Numbers in


Octal Number System (Example)

Octal Point

Position 3 2 1 0 . -1 -2 -3

Position Value 83 82 81 80 8-1 8-2 8-3

Quantity 512 64 8 1 1/
8
1/
64
1/
512
Represented

(Continued on next slide)

Ref Page 33 Chapter 3: Number Systems Slide 38/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Formation of Fractional Numbers in


Octal Number System (Example)
(Continued from previous slide..)

Example

127.548 = 1 x 82 + 2 x 81 + 7 x 80 + 5 x 8-1 + 4 x 8-2


= 64 + 16 + 7 + 5/8 + 4/64
= 87 + 0.625 + 0.0625
= 87.687510

Ref Page 33 Chapter 3: Number Systems Slide 39/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Key Words/Phrases

§ Base § Least Significant Digit (LSD)


§ Binary number system § Memory dump
§ Binary point § Most Significant Digit (MSD)
§ Bit § Non-positional number
§ Decimal number system system
§ Division-Remainder technique § Number system
§ Fractional numbers § Octal number system
§ Hexadecimal number system § Positional number system

Ref Page 34 Chapter 3: Number Systems Slide 40/40


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Ref Page Chapter 5: Computer Arithmetic Slide 1/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Learning Objectives

In this chapter you will learn about:

§ Reasons for using binary instead of decimal


numbers
§ Basic arithmetic operations using binary numbers
§ Addition (+)
§ Subtraction (-)
§ Multiplication (*)
§ Division (/)

Ref Page 49 Chapter 5: Computer Arithmetic Slide 2/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary over Decimal

§ Information is handled in a computer by electronic/


electrical components
§ Electronic components operate in binary mode (can
only indicate two states – on (1) or off (0)
§ Binary number system has only two digits (0 and 1),
and is suitable for expressing two possible states
§ In binary system, computer circuits only have to handle
two binary digits rather than ten decimal digits causing:
§ Simpler internal circuit design
§ Less expensive
§ More reliable circuits
§ Arithmetic rules/processes possible with binary
numbers

Ref Page 49 Chapter 5: Computer Arithmetic Slide 3/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Examples of a Few Devices that work in


Binary Mode

Binary On (1) Off (0)


State

Bulb

Switch

Circuit
Pulse

Ref Page 50 Chapter 5: Computer Arithmetic Slide 4/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Arithmetic

§ Binary arithmetic is simple to learn as binary number


system has only two digits – 0 and 1

§ Following slides show rules and example for the four


basic arithmetic operations using binary numbers

Ref Page 50 Chapter 5: Computer Arithmetic Slide 5/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Addition

Rule for binary addition is as follows:

0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 plus a carry of 1 to next higher column

Ref Page 50 Chapter 5: Computer Arithmetic Slide 6/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Addition (Example 1)


Example
Add binary numbers 10011 and 1001 in both decimal and
binary form

Solution

Binary Decimal

carry 11 carry 1
10011 19
+1001 +9

11100 28

In this example, carry are generated for first and second columns

Ref Page 51 Chapter 5: Computer Arithmetic Slide 7/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Addition (Example 2)

Example

Add binary numbers 100111 and 11011 in both decimal


and binary form

Solution
The addition of three 1s
Binary Decimal can be broken up into two
steps. First, we add only
carry 11111 carry 1 two 1s giving 10 (1 + 1 =
10). The third 1 is now
100111 39
added to this result to
+11011 +27 obtain 11 (a 1 sum with a 1
carry). Hence, 1 + 1 + 1 =
1000010 66 1, plus a carry of 1 to next
higher column.

Ref Page 51 Chapter 5: Computer Arithmetic Slide 8/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Subtraction

Rule for binary subtraction is as follows:

0 - 0 = 0
0 - 1 = 1 with a borrow from the next column
1 - 0 = 1
1 - 1 = 0

Ref Page 51 Chapter 5: Computer Arithmetic Slide 9/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Subtraction (Example)

Example

Subtract 011102 from 101012

Solution

12
0202
10101
-01110

00111

Note: Go through explanation given in the book

Ref Page 52 Chapter 5: Computer Arithmetic Slide 10/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Complement of a Number

Number of digits
in the number

C = Bn - 1 - N

Complement Base of the The number


of the number number

Ref Page 52 Chapter 5: Computer Arithmetic Slide 11/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Complement of a Number (Example 1)

Example

Find the complement of 3710

Solution

Since the number has 2 digits and the value of


base is 10,
(Base)n - 1 = 102 - 1 = 99
Now 99 - 37 = 62

Hence, complement of 3710 = 6210

Ref Page 53 Chapter 5: Computer Arithmetic Slide 12/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Complement of a Number (Example 2)

Example
Find the complement of 68

Solution
Since the number has 1 digit and the value of
base is 8,
(Base)n - 1 = 81 - 1 = 710 = 78
Now 78 - 68 = 18

Hence, complement of 68 = 18

Ref Page 53 Chapter 5: Computer Arithmetic Slide 13/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Complement of a Binary Number

Complement of a binary number can be obtained by


transforming all its 0’s to 1’s and all its 1’s to 0’s

Example
Complement of 1 0 1 1 0 1 0 is

0 1 0 0 1 0 1

Note: Verify by conventional complement

Ref Page 53 Chapter 5: Computer Arithmetic Slide 14/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Complementary Method of Subtraction

Involves following 3 steps:

Step 1: Find the complement of the number you


are subtracting (subtrahend)

Step 2: Add this to the number from which you


are taking away (minuend)

Step 3: If there is a carry of 1, add it to obtain


the result; if there is no carry, recomplement the
sum and attach a negative sign

Complementary subtraction is an additive approach of subtraction

Ref Page 53 Chapter 5: Computer Arithmetic Slide 15/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Complementary Subtraction (Example 1)

Example:
Subtract 5610 from 9210 using complementary method.

Solution
Step 1: Complement of 5610
= 102 - 1 - 56 = 99 – 56 = 4310 The result may be
verified using the
Step 2: 92 + 43 (complement of 56) method of normal
= 135 (note 1 as carry) subtraction:

Step 3: 35 + 1 (add 1 carry to sum) 92 - 56 = 36

Result = 36

Ref Page 53 Chapter 5: Computer Arithmetic Slide 16/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Complementary Subtraction (Example 2)

Example
Subtract 3510 from 1810 using complementary method.
Solution

Step 1: Complement of 3510 Step 3: Since there is no carry,


= 102 - 1 - 35 re-complement the sum and
= 99 - 35 attach a negative sign to
= 6410 obtain the result.

Result = -(99 - 82)


Step 2: 18 = -17
+ 64 (complement
of 35) The result may be verified using normal
82 subtraction:

18 - 35 = -17

Ref Page 53 Chapter 5: Computer Arithmetic Slide 17/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Binary Subtraction Using Complementary Method
(Example 1)

Example
Subtract 01110002 (5610) from 10111002 (9210) using
complementary method.

Solution
1011100
+1000111 (complement of 0111000)

10100011

1 (add the carry of 1)

0100100

Result = 01001002 = 3610

Ref Page 53 Chapter 5: Computer Arithmetic Slide 18/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Binary Subtraction Using Complementary Method
(Example 2)

Example
Subtract 1000112 (3510) from 0100102 (1810) using
complementary method.

Solution
010010
+011100 (complement of 100011)

101110

Since there is no carry, we have to complement the sum and


attach a negative sign to it. Hence,

Result = -0100012 (complement of 1011102)


= -1710

Ref Page 54 Chapter 5: Computer Arithmetic Slide 19/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Multiplication

Table for binary multiplication is as follows:

0x0=0
0x1=0
1x0=0
1x1=1

Ref Page 55 Chapter 5: Computer Arithmetic Slide 20/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Multiplication (Example 1)


Example

Multiply the binary numbers 1010 and 1001

Solution
1010 Multiplicand
x1001 Multiplier

1010 Partial Product


0000 Partial Product
0000 Partial Product
1010 Partial Product

1011010 Final Product


(Continued on next slide)

Ref Page 55 Chapter 5: Computer Arithmetic Slide 21/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Multiplication (Example 2)


(Continued from previous slide..)

Whenever a 0 appears in the multiplier, a separate partial


product consisting of a string of zeros need not be generated
(only a shift will do). Hence,

1010
x1001

1010
1010SS (S = left shift)

1011010

Ref Page 55 Chapter 5: Computer Arithmetic Slide 22/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Division

Table for binary division is as follows:

0 ÷ 0 = Divide by zero error


0 ÷ 1 = 0
1 ÷ 0 = Divide by zero error
1 ÷ 1 = 1

As in the decimal number system (or in any other number


system), division by zero is meaningless

The computer deals with this problem by raising an error


condition called ‘Divide by zero’ error

Ref Page 57 Chapter 5: Computer Arithmetic Slide 23/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Rules for Binary Division

1. Start from the left of the dividend


2. Perform a series of subtractions in which the divisor is
subtracted from the dividend
3. If subtraction is possible, put a 1 in the quotient and
subtract the divisor from the corresponding digits of
dividend
4. If subtraction is not possible (divisor greater than
remainder), record a 0 in the quotient
5. Bring down the next digit to add to the remainder
digits. Proceed as before in a manner similar to long
division

Ref Page 57 Chapter 5: Computer Arithmetic Slide 24/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Binary Division (Example 1)

Example

Divide 1000012 by 1102

Solution 0101 (Quotient)

110 100001 (Dividend)


110 1 Divisor greater than 100, so put 0 in quotient
1000 2 Add digit from dividend to group used above
110 3 Subtraction possible, so put 1 in quotient
100 4 Remainder from subtraction plus digit from dividend
110 5 Divisor greater, so put 0 in quotient
1001 6 Add digit from dividend to group
110 7 Subtraction possible, so put 1 in quotient
11 Remainder

Ref Page 57 Chapter 5: Computer Arithmetic Slide 25/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Additive Method of Multiplication and Division

Most computers use the additive method for performing


multiplication and division operations because it simplifies
the internal circuit design of computer systems

Example
4 x 8 = 8 + 8 + 8 + 8 = 32

Ref Page 56 Chapter 5: Computer Arithmetic Slide 26/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Rules for Additive Method of Division

§ Subtract the divisor repeatedly from the dividend until


the result of subtraction becomes less than or equal to
zero
§ If result of subtraction is zero, then:
§ quotient = total number of times subtraction was
performed
§ remainder = 0
§ If result of subtraction is less than zero, then:
§ quotient = total number of times subtraction was
performed minus 1
§ remainder = result of the subtraction previous to
the last subtraction

Ref Page 58 Chapter 5: Computer Arithmetic Slide 27/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Additive Method of Division (Example)

Example
Divide 3310 by 610 using the method of addition

Solution:
33 - 6 = 27
27 - 6 = 21 Since the result of the last
21 - 6 = 15 subtraction is less than zero,
15 - 6 = 9
9-6= 3 Quotient = 6 - 1 (ignore last
3 - 6 = -3 subtraction) = 5

Total subtractions = 6 Remainder = 3 (result of previous


subtraction)

Ref Page 58 Chapter 5: Computer Arithmetic Slide 28/29


Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha

Key Words/Phrases

§ Additive method of division


§ Additive method of multiplication
§ Additive method of subtraction
§ Binary addition
§ Binary arithmetic
§ Binary division
§ Binary multiplication
§ Binary subtraction
§ Complement
§ Complementary subtraction
§ Computer arithmetic

Ref Page 58 Chapter 5: Computer Arithmetic Slide 29/29

You might also like