Comprog Reviewer
Comprog Reviewer
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
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.
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.
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.
16. Streaming
Definition: Watching or listening to content online without downloading it.
Example: Watching a movie on Netflix or listening to music on Spotify.
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.
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.
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.
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.
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.
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.
#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.
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
Learning Objectives
§ Computer
§ Data processing
§ Characteristic features of computers
§ Computers’ evolution to their present form
§ Computer generations
§ Characteristic features of each computer generation
Computer
Data Processing
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
Characteristics of Computers
Characteristics of Computers
(Continued from previous slide..)
Characteristics of Computers
(Continued from previous slide..)
Evolution of Computers
Evolution of Computers
(Continued from previous slide..)
Computer Generations
Computer Generations
(Continued from previous slide..)
Computer Generations
(Continued from previous slide..)
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
Computer Generations
(Continued from previous slide..)
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
Computer Generations
(Continued from previous slide..)
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
Electronic
Electronic Devices
Devices Used
Used in
in Computers
Computers of
of Different
Different Generations
Generations
Key Words/Phrases
Learning Objectives
Learning Objectives
(Continued from previous slide..)
§ Computer as a system
Storage Unit
Secondary
Storage
Control
Unit
Indicates flow of
instructions and data
Arithmetic Indicates the control
Logic Unit exercised by the
control unit
Central Processing Unit (CPU)
Input Unit
Output Unit
Storage Unit
§ Primary storage
§ Secondary storage
Arithmetic Central
Logic Unit Control Unit = Processing
+ (CU)
(ALU) Unit (CPU)
Key Words/Phrases
Learning Objectives
Learning Objectives
(Continued from previous slide..)
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
§ Characteristics
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
Example
= 2000 + 500 + 80 + 6
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
Example
= 16 + 0 + 4 + 0 + 1
= 2110
101012 = 2110
Bit
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)
Example
= 1024 + 0 + 40 + 7
= 107110
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)
Example
1AF16 = (1 x 162) + (A x 161) + (F x 160)
= 1 x 256 + 10 x 16 + 15 x 1
= 256 + 160 + 15
= 43110
Method
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
Division-Remainder Method
Step 1: Divide the decimal number to be converted by
the value of the new base
Note that the last remainder thus obtained will be the most
significant digit (MSD) of the new base number
Example
95210 = ?8
Solution:
8 952 Remainder
119 s 0
14 7
1 6
0 1
Method
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
4 209 Remainders
52 1
13 0
3 1
0 3
Method
Step 1: Divide the digits into groups of three starting
from the right
Example
11010102 = ?8
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
Method
Step 1: Convert each octal digit to a 3 digit binary
number (the octal digits may be treated as
decimal for this conversion)
Example
5628 = ?2
Method
Example
1111012 = ?16
0011 1101
Method
Example
2AB16 = ?2
Fractional Numbers
Binary Point
Position 4 3 2 1 0 . -1 -2 -3 -4
Quantity 16 8 4 2 1 1/
2
1/
4
1/
8
1/
16
Represented
Example
Octal Point
Position 3 2 1 0 . -1 -2 -3
Quantity 512 64 8 1 1/
8
1/
64
1/
512
Represented
Example
Key Words/Phrases
Learning Objectives
Bulb
Switch
Circuit
Pulse
Binary Arithmetic
Binary Addition
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 plus a carry of 1 to next higher column
Solution
Binary Decimal
carry 11 carry 1
10011 19
+1001 +9
11100 28
In this example, carry are generated for first and second columns
Example
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.
Binary Subtraction
0 - 0 = 0
0 - 1 = 1 with a borrow from the next column
1 - 0 = 1
1 - 1 = 0
Example
Solution
12
0202
10101
-01110
00111
Complement of a Number
Number of digits
in the number
C = Bn - 1 - N
Example
Solution
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
Example
Complement of 1 0 1 1 0 1 0 is
0 1 0 0 1 0 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:
Result = 36
Example
Subtract 3510 from 1810 using complementary method.
Solution
18 - 35 = -17
Example
Subtract 01110002 (5610) from 10111002 (9210) using
complementary method.
Solution
1011100
+1000111 (complement of 0111000)
10100011
0100100
Example
Subtract 1000112 (3510) from 0100102 (1810) using
complementary method.
Solution
010010
+011100 (complement of 100011)
101110
Binary Multiplication
0x0=0
0x1=0
1x0=0
1x1=1
Solution
1010 Multiplicand
x1001 Multiplier
1010
x1001
1010
1010SS (S = left shift)
1011010
Binary Division
Example
Example
4 x 8 = 8 + 8 + 8 + 8 = 32
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
Key Words/Phrases