You are on page 1of 19

Q) What is a Computer? List the Characteristics of Computers ?

A computer, in simple terms, can be defined as an electronic device which accepts data, performs the required
mathematical and logical operations at high speed, and outputs the result.
Data and Information

Computer accepts data, processes it, and produces information.

Data refers to some raw facts or figures, and information implies the processed data.

Characteristics of Computers
Speed: Computers can perform millions of operations per second. The speed of computers is usually given in
nanoseconds (ns) and picoseconds (ps), where 1 ns = 110-9 sec and 1 ps = 110-12 sec.
Versatile: Computers can perform multiple tasks of different nature at the same time.
Memory: Computers have internal or primary memory (storage space) as well as external or secondary memory to store
data and programs.
Accuracy: A computer always gives accurate results, provided the correct data and instructions are input to it. If the
input data is wrong, then the output will also be erroneous. This is called garbage-in, garbage-out (GIGO).
Automation: Computers perform a task without any user intervention.
Diligence: Unlike humans, computers never get tired of a repetitive task.
No IQ: Computers do not have any decision-making abilities of their own. They need guidance to perform various tasks.
Economical: Computers are considered as short-term investments for achieving long-term gains. They save time,
money, and energy.
==================================================================================================
Q) List and explain the Generations of Computers
The word Generation refers to the different advancements in computer technology.
The focus of every new generation has been on size, speed, power, and efficient computer memory.
First Generation (1940-1956): Vacuum Tubes
Advantage : Fastest calculating devices of their time
Disadvantages : Generated a lot of heat , Consumed a lot of electricity , Bulky in size, Prone to frequent hardware
Required constant maintenance because of the low mean time between failures, Limited commercial use Very
expensive.
Second Generation (1956-1963): Transistors
Advantages : Consumed less electricity , Generated less heat, Faster, cheaper, smaller, and more reliable, Could be
programmed using assembly and high-level languages, Had faster primary memory and a larger secondary memory
Disadvantage : Transistors had to be assembled manually, which made commercial production of computers difficult
and expensive.

Page 1 of 19

Third Generation (1964-1971): Integrated Circuits


Advantages Faster and could perform one million transactions per second , Smaller, cheaper, and more reliable Faster
and larger primary memory and secondary storage ,Widely used for scientific as well as business applications ,
Supported time sharing operating systems
Disadvantages :Difficult to maintain , Got heated very quickly
Fourth Generation (1971-1989): Microprocessors
Advantages Smaller, cheaper, faster, and more reliable, Consumed less electricity and generated less heat, Faster and
larger primary memory and secondary storage Could be used as general-purpose computers, GUIs enabled people to
learn to work with computers very easily Lead to widespread use of computers in offices and at homes, Networks
allowed sharing of resources
Disadvantage : Not intelligent systems
Fifth Generation (Present and Beyond): Artificial Intelligence

Gaming: Computers are programmed to play games such as chess and checkers. More recent examples of such
gaming systems include PlayStation by Sony.

Expert systems: Computers are programmed to take decisions in real-world situations.

Natural languages: Computers are programmed to understand and respond to natural human languages.

Neural networks: Systems are programmed to simulate intelligence by reproducing the physical connections
that take place in animal brains.

Robotics: Computers are programmed to look, listen, and react to other sensory stimuli.

=================================================================================================
Q ) Classification of Computers

Supercomputers

Fastest, most powerful, and most expensive computer

Used to process large amounts of data and to solve complex scientific problems

Can support thousands of users at the same time

Mainly used for weather forecasting, nuclear energy research, aircraft design, automotive design, online
banking, etc.

Some examples of supercomputers are CRAY-1, CRAY-2, Control Data CYBER 205, and ETA A-10
Page 2 of 19

Mainframe Computers

Minicomputers

Large-scale computers, but smaller than

Smaller, cheaper, and slower than Mainframes

Supercomputers

Can be used as servers in a networked

Very expensive

Need a very large clean room with air

environment

conditioning

Widely used in business, education, hospitals,


government

Used as servers on the World Wide Web

Some examples are IBM S/390, Control Data

Corporation), Data General Corporation, and

CYBER 176, and Amdahl 580

Prime Computer

Some examples are AS/400 computers (IBM

Microcomputers
Desktop PCs

Laptops

Most popular model

Very handy and easily portable

Widely used in homes and offices

Storage capacity is almost equivalent to that of a

Workstations

desktop computer

Single-user computers

Same features as PCs but with higher

touchpad

processing speed

Have advanced processors, more RAM and

Can be used as servers in a networked

Handheld Computers

Have less processing power, memory, and


storage

Single-user computers, Can fit in one hand,


Have small-sized screens and keyboards, Some
examples of handheld computers are

Designed to be used as terminals in a networked


environment

environment

More expensive than desktop computers

Network Computers

storage capacity

For input, laptops have a built-in keyboard and a

Those used to access Internet or Intranet are


often known as Internet PCs or Internet boxes

Some used in homes do not even have a

Personal Digital Assistants (PDA)

monitor. They may be connected to a TV. They

Cellular Phones

are called WebTV

H/PC Pro Devices

Q) Basic Organization of Computers

Input: The process of entering data and instructions (also known as programs) into the computer system

Storage: The process of saving data and instructions permanently in the computer so that they can be used for
processing. A computer has two types of storage areas:
Primary storage (main memory) is the storage area that is directly accessible by the CPU at very high
speeds
Page 3 of 19

Secondary storage (secondary or auxiliary memory) supplements the limited storage capacity of the
primary memory

Processing: The process of performing operations on the data as per the instructions specified by the user
(program)

Output: The process of giving the result of data processing to the outside world (external to the computer
system)

Control Unit: It is the central nervous system of the computer system that manages and controls all the other
components

=================================================================================================
Applications of Computers

Word Processing, Internet, Digital Video or Audio Composition, Desktop Publishing, Government/Administration
Traffic Control,L egal System, Retail Business, Sports, Music, Movies, Travel and Tourism, Business and Industry,
Hospitals, Simulation , Geology ,Astronomy ,Weather Forecasting, Education, Online Banking , Industry and
Engineering,Robotics ,Decision Support Systems,Expert Systems

==============================================================================================
Input and Output Devices
An input device is used to feed data and instructions to the computer.

Keyboard Main input device for computers

Most keyboards have between 80 and 110 keys, which include the following:
Page 4 of 19

Typing keys

Numeric keys

Function keys

Control keys

Advantage Easy to use and low-priced


Disadvantages Cannot be used to draw figures, Moving the cursor to another position is very slow
Mouse A pointing device that helps users to select items on screen by controlling the movement of pointer

Can be used to perform the following operations:

Point Click

Drag

Scroll

Advantages Low-priced , Easy to use and can be used to quickly place the cursor
Disadvantages

Needs extra desk space to be placed and moved easily

The ball must be cleaned to remove dust from it

Trackball

A pointing device to control the position of the cursor on the screen

Usually used in notebook computers, where it is placed on the keyboard

Advantages

Provides better resolution , Occupies less space

Easier to use as compared to a mouse as its use involves less hand-and-arm movements

Disadvantage The trackball chamber is often covered with dust, so it must be cleaned regularly
Touchpad

A small, flat, rectangular stationary pointing device with a sensitive surface of 1.52

Users have to slide their fingertips across the surface of the pad to point to a specific object on the screen

The surface translates the motion and position of the users fingers to a relative position on the screen

Advantages

Occupies less space , Easy to use , Built in the keyboard so no need to carry an extra device

Handheld Devices

Joystick

A cursor control device widely used in computer games and CAD/CAM applications

Stylus

A pen-shaped device to enter information or write on the touch screen of a handheld device

Touch screen

A display screen that can identify the occurrence and position of a touch inside the display region. The user can
touch the screen by using either a finger or a stylus

Optical Input Devices

Use light as a source of input for detecting or recognizing different objects such as characters, marks, codes, and
images

Some optical devices are: Barcode reader,Image scanner,Optical character recognition (OCR) devices

Optical mark readers (OMR),Magnetic ink character recognition (MICR) devices


Page 5 of 19

Barcode Reader

Works by directing a beam of light across the barcode and measuring the amount of light reflected back

Advantages Low-priced, portable, and easy to use


Disadvantages

Must be handled with care

Can interpret information using a limited series of thin and wide bars. To interpret other unique identifiers, the
bar display area must be widened

Image Scanner

Captures images, printed text, photographs, etc., and converts them into digital images for editing and display
on computers

Advantages

Any document can be scanned and stored in a computer for further processing

Scanned and stored document will never deteriorate in quality with time

Disadvantages

Scanned documents are bigger in size as compared to other equivalent text files

Scanned documents are uneditable

Optical Character Recognition (OCR)

The process of converting printed materials into text or word processing files that can be easily edited and
stored

Advantages

Printed documents can be converted into text files

These files occupy less space and are editable

Disadvantages

Cannot recognize all types of fonts

Documents that are poorly typed or have strikeover cannot be recognized

Optical Mark Recognition (OMR) The process of electronically extracting data from marked fields, such as checkboxes
and fill-in fields, on printed forms
Advantage

Works at very high speeds. Can read up to 9,000 forms per hour

Disadvantages

Difficult to gather large amount of information

Some data may be missing in the scanned document

A sensitive device, it rejects an OMR sheet if it is folded, torn, or crushed

Magnetic Ink Character Reader (MICR)

Used to verify the legitimacy of paper documents, especially bank checks

Consists of magnetic ink printed characters that can be recognized by high-speed magnetic recognition devices
Page 6 of 19

Advantage

Ease of readability and high security

Disadvantage

Expensive equipment

Audio/Video Input Devices

Audio Input Devices

Used to either capture or create sound

Enable computers to accept music, speech, or sound effects for recording and/or editing

Some examples are microphones and CD players

Video Input Devices

Used to capture video from the outside world into the computer

Some examples are digital cameras and web cameras

=================================================================================================
Output Devices

Electromechanical devices that accept digital data from the computer and convert them into humanunderstandable form

Softcopy Output Devices

Produce an electronic version of an output. For example, a file that is stored on a hard disk, CD, or pen drive and
is displayed on the computer screen

Features :

Output can be viewed only when the computer is on

A user can easily edit soft copy output

It cannot be used by people without a computer

Searching for data in a soft copy is easy and fast

Electronic distribution of material is cheaper, easy, and fast

Monitors

Used to display video and graphics information generated by the computer through the video card

Similar to television screens but they display information at a much higher quality

Come in three variants:

Cathode ray tube (CRT) monitor , Liquid crystal display (LCD) monitor , Plasma monitor
Page 7 of 19

CRT Monitor

Specialized vacuum tubes in which images


are produced when an electron beam
strikes a phosphorescent surface
Advantages ,Provide good quality images,Lowpriced
Disadvantages
Occupy a large space on the desk
Bigger in size and weight and therefore not
easily portable
Power consumption is higher than in other
monitors
LCD Monitor

Thin, flat, electronic visual displays that use the light modulating properties of liquid crystals

Replacing CRT displays at a fast pace

Advantages Very compact and lightweight, Consume less power, Little or no flicker of images, Cause less eye fatigue
Disadvantages More expensive than CRTs, Images are not very clear when tried to view from an angle
Plasma Monitor : Thin and flat monitors widely used in televisions
Advantages

The technology used in plasma monitors allows producing a very wide screen

Very bright images can be formed

Not heavy and are thus easily portable

Disadvantages Very expensive , High power consumption ,Since the images are phosphor-based, at times, they may
suffer from flicker visions
Projectors

A device that takes an image from a digital source and projects it onto a screen or another surface

Can be broadly classified into two categories:

LCD projectors use their own light to display the image on the screen/wall. The room must be first darkened,
else the image formed will be blurred.
Digital light processing (DLP) projectors use a number of mirrors to reflect light. When using a DLP projector,
the room may or may not be darkened because it displays a clear image in both situations.
Hard Copy Output Devices

Produce a physical form of output. For example, the content of a file printed on paper

Features :

A computer is not needed to see the output

Editing and incorporating the edits in the hard copy is difficult

Output can be easily distributed to people who do not have a computer

Searching for data in a hard copy is a tiring and difficult job

Distribution of a hard copy is not only costly but slower as well

Printers
Page 8 of 19

A device that takes text and graphics information obtained from a computer and prints it on a paper

Impact Printers

Print characters by striking an inked ribbon against the paper

Advantages Enable users to produce carbon copies, Low-priced


Disadvantages Slow, Poor print quality, especially in the case of graphics, Can be extremely noisy

Can print only using the standard font, Dot Matrix Printers , Print characters as a pattern of dots

Have a print head (or hammer) that consists of pins representing the character or image

The print head prints by striking an ink-soaked cloth ribbon against the paper, Daisy Wheel Printers

The print head is a circular wheel, To print a character, the wheel is rotated in such a way that the character to
be printed is positioned just in front of the printer ribbon,

Band Printers

Printing mechanism uses a metal loop or band to produce typed characters

The set of characters is permanently embossed on the band, and this set cannot be changed unless the band is
replaced

Line Printers

High-speed printers in which one typed line is printed at a time

Used in data centers and industrial environments

Non-Impact Printers

Much quieter as their printing heads do not strike the paper

Offer better print quality, faster printing, and the ability to create prints that contain sophisticated graphics

Use either solid or liquid cartridge-based ink, which is either sprayed, dripped, or electrostatically drawn onto
the page

Advantages Produce prints of good quality , Noiseless, fast , Can print text in different fonts
Disadvantage

Expensive as ink cartridges used by them are costly

Inkjet Printers

The print head has several tiny nozzles, also called jets. As the paper moves past the print head, the nozzles
spray ink onto it, forming characters and images, Cartridges have to be changed frequently

Laser Printers

Work at very high speeds and produce high-quality text and graphics

A laser beam draws the document on a drum which is coated with a photo-conductive material
Page 9 of 19

After the drum is charged , it is rolled in a toner (a dry powder type of ink)

The toner sticks to the charged image on the drum and transferred onto a piece of paper

Plotters

Used to print vector graphics with high-print quality

Widely used to draw maps, in scientific applications, and in CAD, CAM, and CAE

Drum plotters

Used to draw graphics on paper that is wrapped around a drum

Usually used with mainframe and minicomputer systems

Flatbed plotters

The paper is spread on the flat rectangular surface of the plotter, and the pen is moved over it

Less expensive, and are used in many small computing systems

===============================================================================================
Computer Memory and Processors
Introduction : Memory is an internal storage area in the computer, which is used to store data and programs either
temporarily or permanently.
Memory Hierarchy
Processor Registers
1. Fastest memory among all types of
computer data storage
2. Located inside the processor, thus directly
accessible by the CPU
Stores a word of data (either 32 or 64 bits)
3. CPU instructions instruct the ALU to
perform operations on this data
Cache Memory
1 An intermediate form of storage between
the ultra-fast processor registers and RAM
2 Stores instructions and data that are repeatedly
required to execute programs
3 Improves the overall system speed,
thereby increasing the performance of the
computer

Primary Memory

Directly accessed by the CPU

Any data that has to be operated by the CPU is stored in this memory

There are two types:


Random Access Memory (RAM)
Read Only Memory (ROM)
Page 10 of 19

Random Access Memory (RAM)

A volatile storage area that is used to store data temporarily, so that it can be promptly accessed by the
processor

Called random access because any memory cell can be directly accessed if its address is known

There are two types:


Static RAM ,

Dynamic RAM

Static RAM (SRAM)

Holds data without an external refresh as long as it is powered

Made of D flip-flops

No need for an external refresh process to be carried out

SRAM is faster and more reliable than DRAM

Occupies more space and is more expensive than DRAM

Dynamic RAM (DRAM)

A DRAM chip contains millions of tiny memory cells

To store a bit of information in a DRAM chip, a tiny amount of power is put into the cell to charge the capacitor

A refresh process is required to maintain the charge in the capacitor so that it can retain the information

One disadvantage of DRAM is that the capacitor leaks energy very quickly and can hold the charge for only a
fraction of a second

Read Only Memory (ROM)

A non-volatile memory that retains the data even after the power is switched off

Refers to computer memory chips containing permanent or semi-permanent data

A small amount of ROM stores critical programs such as BIOS

Types of ROM

Programmable ROM (PROM) can be written to or programmed using a special device called a PROM
programmer which uses high voltages to permanently write data in it

Erasable Programmable ROM (EPROM) can be erased and re-programmed by exposing the chip to strong UV
light and then rewriting at a higher voltage

Electrically Erasable Programmable PROM (EEPROM) allows contents to be electrically erased and then
rewritten

Secondary Storage Devices

Also known as external memory or auxiliary storage

Not directly accessible by the CPU

Holds data even after the power is switched off

Cheaper than primary memory and can be used to store large amounts of data

Magnetic Tapes

Mass storage devices capable of backing up and retaining large volumes of data

Used as sequential access secondary storage devices


Page 11 of 19

Data is stored in form of records

Cheap, compact in size, light in weight, can store large amounts of data and use less power

Slow, can be used sequentially, easily susceptible to degradation due to heat, humidity, etc.

Floppy Disks

Consist of thin magnetic storage medium encased in a square plastic shell lined with fabric that removes dust
particles

Widely used from mid-1970s to 2000

Inexpensive but slow and with limited storage capacity

Data can be lost if the disk is bended, removed, while in use, or exposed to excessive temperature, dust, or
smoke

Hard Disks

A set of disks, stacked together

Each platter requires two R/W heads, one for each side

Data is stored on the surface of a platter in sectors and tracks

The performance of a hard disk depends on its access time, which is the time required to read or write on the
disk

Enable random access of data

Can be used as a shared device in time-sharing environment

Larger in size and heavier in weight as compared to flash drives and optical disks

Optical Drives

Optical storage refers to storing data on an optically readable medium by making marks in a pattern that can be
read using a beam of laser light precisely focused on a spinning disk

Most widely used and reliable storage devices

Popular optical storage devices are:

CD-ROM , DVD-ROM , CD-Recordable, CD-Rewritable

CD-ROM

Uses laser technology to read and write data onto the disk

A single CD-ROM can store a large amount of data, but once the information is stored on it, it becomes
permanent

Storage capacity varies from 650 MB to 1 GB

CD-ROM drive is used to read the information stored in a CD-ROM

DVD-ROM

Extremely high-capacity optical disk with storage capacity from 4.7 GB to 17 GB

Widely used to store large databases, movies, music, complex software, etc.

Double-sided disks, as they can store data on both the sides of the disk

CD-R (Recordable)

The process of writing data on the optical disk is called burning


Page 12 of 19

Can be used in any CD-ROM drive and is functionally equivalent to a pre-recorded CD-ROM

Once data is written on the CD-R, it cannot be changed

Users can continue to store data on other parts of the disk until it is full

CD-RW (Rewritable)

Users can write and over-write data on the CD-RW disk multiple times

The reliability of the disk tends to decrease, each time data is rewritten

USB Flash Drives

Removable, rewritable, and are physically much smaller drives, weighing less than 30 g

Data is impervious to damages due to scratches and dust

Very robust, portable with high data capacity

Use very little power

No need to install device drivers

Can sustain only a limited number of write and erase cycles

Cost per unit of storage of a flash drive is higher

Memory Cards

A small device that can store digital files

Easily portable, smaller, require less power

Have higher storage capacity, are completely silent, are less prone to mechanical failures, allow immediate
access to data

Mass Storage Devices

Mass storage refers to storing enormous amounts of data in a persistent manner

Mass storage devices can store up to several trillion bytes of data

Have high data storage capacity, are easily portable, and have low power consumption

Commonly used devices are:

Disk Array , Automated Tape Library, CD-ROM Jukebox

Disk Array

Commonly known as a redundant array of independent disks (RAID)

Group of one or more physically independent and high-capacity hard disk drives

Used in place of larger, single disk drive systems

Improve speed and increase protection against loss of data

Automated Tape Library

One or more tape drives to store large amounts of data ranging from 20 terabytes to more than 411 petabytes

A cost-effective solution to the problem of storing large volumes of data

==================================================================================================

Page 13 of 19

Basic Processor Architecture

Registers

A computer memory that provides quick access to the data currently being used for processing

ALU stores all temporary and final results in registers

No. of general purpose registers varies from processor to processor

When program execution is complete, the result of processing is transferred from accumulator to the memory
through MBR

MAR stores the address of the data or instruction to be fetched from the main memory

MBR stores the data or instruction fetched from the memory

IR stores the instructions currently being executed

I/O register is used to transfer data or instructions to or from an I/O device

PC stores the address of the next instruction to be executed

Instruction Cycle

To execute an instruction, a processor follows a set of basic operations that are together called Instruction Cycle

Fetch: Retrieving an instruction or a data from memory

Decode: Interpreting the instruction

Execute: Running the corresponding commands to process data

Store: Writing the results of processing into memory

Bus Interface

Page 14 of 19

Provides functions for transferring data between the execution unit of the CPU and other components of the
computer system that lie outside the CPU
Puts the contents of the program counter on address bus

Once the memory receives an address from the BIU, it places the contents at that address on the data bus,
which is then transferred to the IR of the processor through the MBR

Instruction Set Set of commands that instructs the processor to perform specific tasks

For example, tells the processor what it needs to do, from where to find the data, from where to find
instruction, etc.

Can be built into the hardware, or can be emulated in the software using an interpreter

System Clock
Controls the timing of all operations within the computer
Synchronize various operations that take place within computer

Measured by the number of ticks per second

A processor can perform some operations in a single clock tick

Faster the clock ticks, more is the number of operations that can be performed

Pipelining

Pipelining is a technique with which the processor can fetch the second instruction before completing the
execution of the first instruction

Such processors that can execute more than one instruction per clock cycle are called superscalar processors

With superscalar architecture, processors can execute programs faster by replicating components such as ALUs

Parallel Processing In parallel processing, multiple processors can be used simultaneously to execute a single program
or task
A complex and large task is divided into smaller tasks in such a way that each task can be allocated to a
processor
==================================================================================================
CISC Computers

In CISC, hardware bear more responsibility than the software so that the software can be simple and easy

Programs can be very simple and short requiring less space

Less effort is required by the translator to convert the program into machine language, thus faster execution

However, machines require additional hardware circuitry

RISC Computers

RISC utilizes a small but highly optimized set of instructions

Although RISC machines are less complex and less expensive, they place extra demand on programmers to
implement complex computations by combining simple instructions

Page 15 of 19

Binary Number System : Computers are electronic machines that use binary logic. This logic uses two different values to
represent the two voltage levels (value 0 for 0 V and value 1 for +5 V).
The binary number system uses only two digits, 0 and 1.

Converting Binary Number into Decimal Form

Converting Decimal Number into Binary Form

Convert (1101)2 into a decimal number


Decimal number = 1 23 + 1 22 + 0 21 + 1 20
=18+14+02+11
=8+4+0+1
= 13
Rules of Binary Addition , Subtraction and Multiplication.
Binary Addition

Binary Subtraction

Binary Multiplication

0+0=0

00=0

00=0

0+1=1

10=1

01=0

1+0=1

11=0

10=0

1 + 1 = 0,

0 1 = 1,

11=1

and carry 1 to the next more

and borrow 1 from the next more

significant bit

significant bit

Examples for Binary Addition , Subtraction and Multiplication.

Page 16 of 19

Subtraction Using Twos Complement


Calculate 1011 1001 using twos complement
Subtrahend = 1001
Ones complement of subtrahend = 0110
Twos complement of subtrahend = 0110 + 1 = 0111
Add the minuend and the twos complement of the subtrahend
Examples of Binary Multiplication

Octal Number System

Base 8 number system which uses digits 07.

Extensively used in early mainframe computer systems.

Less popular in comparison to binary and hexadecimal systems.

Converting Octal Number into Decimal Form

Converting Decimal Number into Octal Form

Convert (123)8 into its decimal equivalent


Decimal number = 1 82 + 2 81 + 3 80
= 1 64 + 2 8 + 3 1
= 64 + 16 + 3
= 83
Hexadecimal Number System

Base 16 number system

Symbols 09 represent values zero to nine, and A, B, C, D, E, F (or af ) represent values 1015

Prefix 0x is used for numbers represented in hexadecimal system

Convert 0x312B into its equivalent decimal value

Convert 1239 into Hexadecimal Form

Decimal
number = 3 163 + 1 162 + 2 161 + B 160
= 3 4096 + 1 256 + 2 16 + B 1
= 12288 + 256 + 32 + 11
= 12587
Page 17 of 19

Converting Hexadecimal Number into Binary Form

Write the 4-bit binary representation of each hexadecimal digit

Convert 0xABCD into its binary equivalent


(ABCD)16 = (1010 1011 1100 1101)2

Converting Binary Number into Hexadecimal Form

Pad the binary number with leading zeroes (if necessary), so that it contains multiples of 4 bits
Ex. Convert the binary number 01101110010110 into its hexadecimal equivalent

After padding the binary number is 0001 1011 1001 0110

Substitute the appropriate hexadecimal digits for a group of four binary digits

The equivalent hex number = 1B96

Converting Hexadecimal Number into Octal Form

Convert the hexadecimal number into its binary equivalent

Convert the binary number into its equivalent octal number


Ex. Convert (A1E)16 into its octal equivalent
Convert (A1E)16 into its binary equivalent (10100001 1110)2
Now divide the binary number into groups of 3 binary bits and convert each group into its equivalent octal
number. Thus, we have (5036)8

Converting Octal Number into Hexadecimal Form

Convert the octal number into its binary equivalent

Convert the binary number into hexadecimal form


Ex. Convert (567)8 into its hexadecimal equivalent

(567)8 = (101 110 111)2

Form groups of 4 binary bits

(Left pad if required) and convert each group into hexadecimal number. Thus, we have (177)16

Working with Fractions


Convert (10110.1110)2 into decimal
(10110.1110)2 = 1 24 + 0 23 + 1 22 + 1 21 + 0 20 . 1 21 + 1 22 + 1 23 + 0 24
= 1 16 + 0 8 + 1 4 + 1 2 + 0 1 . 1 1/2 + 1 1/4 + 1 1/8 + 0 1/16
= 16 + 0 + 4 + 2 + 0 . 0.5 + 0.25 + 0.125 + 0
= 22.875
Convert (127.35)8 into decimal
(127.35)8

= 1 82 + 2 81 + 7 80 . 3 81 + 5 82
= 1 64 + 2 8 + 7 1 . 3 1/8 + 5 1/64
= 64 + 16 + 7 . 0.375 + 0.078125
= 87.453125

Page 18 of 19

Signed Number Representation

Required to encode negative numbers in the binary


Three widely used techniques are:
In Sign-and-magnitude, MSB is set to 0 for a positive number or zero, and set to 1 for a negative number. The
other bits denote the value or the magnitude of the number.
In Ones Complement, first write the binary representation of the numbers positive counterpart and then
negate each bit.
In Twos Complement, negate all the bits in the binary representation and then add 1 to the result.
BCD Code : Used for encoding decimal numbers , Digits 0-9 are used
Each digit is represented by its own binary sequence of 4 bits
For example, decimal 7 is 0111 in BCD
Allows easy conversion to decimal digits for printing or display
Allows faster decimal calculations
Two types of BCD numbers areunpacked and packed BCD
In unpacked BCD representation, only one decimal digit is represented per byte. The digit is stored in the
lower nibble, and the higher nibble is not relevant to the value of the represented number. For example,
Decimal 17 = 0000 0001 0000 0111.
In packed BCD representation, two decimal digits are stored in a single byte. For example, Decimal 17 =
0001 0111 (in BCD).
ASCII : Stands for American Standard Code for Information Interchange
Seven-bit character code
ASCII characters are examples of unpacked BCD numbers
Values in ASCII codes are represented as their 4-bit binary equivalents stored in the lower nibble, while the
upper nibble contains 011
Most common format for text files in computers and on the Internet
EBCDIC : Stands for Extended Binary Coded Decimal Interchange Code
Eight-bit character-encoding technique used on mainframe
Supports a wider range of control characters than ASCII
EBCDIC characters are similar to ASCII characters. While the lower nibble contains the 4-bit binary equivalent
the upper nibble is padded with 1111, instead of 011
Excess-3 Code : Each decimal digit is the 4-bit binary equivalent with 3 (0011) added
Gray Code : A minimum change code, in which only 1 bit in the code changes from one code to the next
Non-weighted code
Steps to obtain Gray code:
Copy the MSB of the binary code as the MSB of the Gray code
Repetitively add MSB and the bit next to the MSB to get the corresponding bit for the Gray code
Unicode

Can represent characters (including punctuation marks, mathematical symbols, technical symbols, and arrows)
as integers
Has several character encoding forms:
UTF-8: Uses only 8 bits to encode English characters. This format is widely used in email and on the Internet.
UTF-16: Uses 16 bits to encode the most commonly used characters. It can represent more than 65,000
characters.
UTF-32: Uses 32 bits to encode the characters. It can represent more than 100,000 characters.

Page 19 of 19

You might also like