Friday, August 1, 2008

C(lecture notes)

UNIT-1
LECTURE#1

AN OVERVIEW OF COMPUTER SYSTEM

A digital computer is basically an electronic device that can transmit, store & manipulate information i.e. data. Several different types of data can be processed by a computer. These include numeric data, character data etc. Thus computer can be defined as a multipurpose, programmable machine built by logic circuits which accepts binary data as input, processes the data according to the binary instructions, read from its memory & provides result in the form of binary or analog as its output.

ANATOMY OF DIGITAL COMPUTER: We should keep in mind that a computer is a programmable machine. The two
main characteristics of a computer are: (i) it responds to a specific set of
instructions in a well-defined manner. (ii) It can execute a pre-recorded list of
instructions (a program). Modern computers are electronic and digital. The
actual machinery - wires, transistors and circuits is called hardware; the
instructions and data are called software. All general purpose computers require
the following hardware components:

(i)Central Processing Unit (CPU): The ‘brain’ of the computer, the
component that actually executes instructions.

(ii)Memory : It enables a computer to store, at least temporarily, data and
programs.

(iii) Input device : Usually a keyboard or mouse is used to read data and
programs into the computer.

(iv)Output device: A display screen, printer, etc. that lets you see what the
computer has accomplished.

(v)Mass storage device: It allows a computer to permanently store large
amounts of data. Common mass storage devices include disk drive and
tape drive.

Functions and Components of a Computer:

To function properly, the computer needs both hardware and software. Hardware
consists of the mechanical and electronic devices, which we can see and touch.
The software consists of programs, the operating system and the data that reside
in the memory and storage devices.

A computer does mainly the following four functions:

1.Receive input —Accept data/information from outside through various
input devices like the keyboard, mouse, scanner, etc.

2.Process information—Perform arithmetic or logical operations on data/
information.

3.Produce output—Communicate information to the outside world through
output devices like monitor, printer, etc.

4.Store information—Store the information in storage devices like hard
disk, floppy disks, CD, etc.

These four basic functions are responsible for everything that computers do.
The hardware components of the computer specialize in any one of these
functions.

Computer hardware falls into two categories: processing hardware and the
peripheral devices.

(a) The Processing hardware consists of the Central Processing
Unit (CPU), and as its name implies, is where the data processing is done.

(b)Peripheral devices allow people to interact with the CPU. Together, they make
it possible to use the computer for a variety of tasks.

LECTURE#2
VARIOUS PARTS OF COMPUTER:

BLOCK DIAGRAM OF COMPUTER



Central Processing Unit (CPU)
This part of the computer that executes program instructions is known as the
processor or Central Processing Unit (CPU). In a microcomputer, the CPU is
based on a single electronic component, the microprocessor chip, within the
system unit or system cabinet. The system unit also includes circuit boards,
memory chips, ports and other components. A microcomputer’s system cabinet
will also house disk drives, hard disks, etc., but these are considered separate
from the CPU.
The CPU has two parts —The Control Unit (CU) and the Arithmetic Logic Unit
(ALU). In a microcomputer, both are on a single microprocessor chip.

Control Unit (CU)
The control unit tells the rest of the computer system how to carry out a program’s
instructions. It directs the movement of electronic signals between memory -
which temporarily holds data, instructions and processes information - and the
ALU. It also directs these control signals between the CPU and input/output
devices.

Arithmetic - Logic Unit (ALU)
Arithmetic Logic Unit, usually called the ALU, performs two types of operations
- arithmetical and logical. Arithmetical operations are the fundamental


mathematical operations consisting of addition, subtraction, multiplication and
division. Logical operations consist of comparisons. That is two pieces of data
are compared to see whether one is equal to, less than, or greater than the other.

Memory
Memory - also known as the primary storage or main memory - is a part of the
microcomputer that holds data and instructions.
Part of the contents of the memory is held only temporarily, that is, it is stored
only as long as the microcomputer is turned on. When you turn the machine off,
the contents are lost. The capacity of the memory to hold data and program
instructions varies in different computers. The original IBM PC could hold
approximately several thousand characters of data or instructions only. But
modern microcomputers can hold millions or even billions of characters in their
memory.

Registers
Computers also have several additional storage locations called registers. These
appear in the Control Unit and ALU and make processing more efficient.
Registers are a sort of special hi-speed storage areas that hold data and
instructions temporarily during processing. They are parts of the Control Unit
and ALU rather than the memory. Their contents can, therefore be handled much
faster than the contents of the memory.

Addresses
To locate the characters of data or instructions in the main memory, the computer
stores them in locations known as addresses. A unique number designates each
address. Addresses can be compared to post office mailboxes. Their numbers
remain the same, but contents continuously change.

LECTURE#3

Input devices
An input device presents data to the processing unit in a machine-readable form.
Although the keyboard is a common input device for a small computer, a system
may also support various other input devices such as Optical Character
Recognition (OCR), Magnetic Ink Character Recognition (MICR), mark sense
reader, etc.

1. Key board
The keyboard is very much like a standard typewriter keyboard with a few
additional keys. The basic QWERTY layout of characters is maintained to make
it easy for the trained typist to use the system. The additional keys are included
to perform certain special functions such as loading a program, edition a text,
etc. These are known as function keys that vary in number from system to system.

2. Optical Character Recognition

Often abbreviated as OCR, optical character recognition involves reading text
from paper and translating the images into a form that the computer can
manipulate. An OCR system enables you to take a book or a magazine article
and feed it directly into an electronic computer file.

3 Magnetic Ink Character Recognition (MICR)

An MICR can identify characters printed with a special ink that contain particles
of magnetic material. This device particularly finds applications in banking
industry. Since the MICR system can recognise only certain character styles,
the characters have to be accurately formed.

4 Optical Mark Recognition (OMR)

Optical mark recognition, also called mark sense reader, is a technology where
an OMR device senses the presence or absence of a mark, such as pencil mark.
OMR is widely used in tests such as aptitude tests.

5 Bar Code Reader

These devices are generally available in super markets, bookshops, etc. Bar-code
readers are photoelectric scanners that read the bar codes or vertical zebra striped
marks, printed on product containers. Supermarkets use a bar code system called
the Universal Product Code (UPC). The bar code identifies the product to the
supermarket's computer which has a description and the latest price of the
product. The computer automatically tells the Point of Sales (POS) terminal what
the price is.

6 Digitiging Tablet

This is an input device that enables you to enter drawings and sketches into a
computer. A digitiging tablet consists of an electronic tablet and a cursor or
pen. A cursor (also called a puck) is similar to a mouse, except that it has a
window with cross hairs for pinpoint placement, and it can have as many as 16
buttons. A pen (also called a stylus) looks like a simple ballpoint pen but uses
an electronic head instead of ink. The tablet contains electronic field that enables
it to detect movement of the cursor or pen and translate the movements into
digital signals that it sends to the computer. Digitiging tables are also called
digitizers, graphics tables, touch tables or simply tables.

7 Scanner
Scanner is an input device that can read text or illustrations printed on paper and
translate the information into a form that the computer can use. Ascanner works
by digitizing an image - dividing it into a grid of boxes and representing each
box with either a zero or a one, depending on whether the box is filled in. The
resulting matrix of bits, called a bit map, can then be stored in a file, displayed
on a screen and manipulated by programs. Optical scanners do not distinguish
text from illustrations, they represent all images as bit maps. Therefore, you
cannot directly edit text that has been scanned. To edit text read by an optical
scanner, you need an optical character recognition (OCR) system to translate
the image into ASCII characters. Most optical scanners sold today come with
OCR packages.

8 Mouse
Mouse is a device that controls the movement of the cursor or pointer on a display
screen. It is a small object you can roll along a hard and flat surface. As you
move the mouse, the pointer on the display screen moves in the same direction.
Mouse contains at least one button and sometimes as many as three, which have
different functions depending on what program is running.

9 Light Pen
Light pen is an input device that utilizes a light-sensitive detector to select
objects on a display screen.

10 Speech input devices
Speech or voice input devices convert a person's speech into digital form. These
input devices, when combined with appropriate software, form voice recognition
systems. These systems enable users to operate microcomputers using voice
commands.

Memory Unit
There are two kinds of computer memory: primary and secondary. Primary
memory is accessible directly by the processing unit. RAM is an example of
primary memory. As soon as the computer is switched off, the contents of the
primary memory is lost. You can store and retrieve data much faster with primary
memory compared to secondary memory. Secondary memory such as floppy
disk, magnetic disk, etc., is located outside the computer. Primary memory is
more expensive than secondary memory.
Computer memory is used to store two things: i) instructions to execute a
program and ii) data. When the computer is doing any job, the data that have to
be processed are stored in the primary memory. This data may come from an
input device like keyboard or from a secondary storage device like a floppy disk.
As program or the set of instructions is kept in primary memory, the computer
is able to follow instantly the set of instructions. For example, when you book
ticket from railway reservation counter, the computer has to follow the same
steps : take the request, check the availability of seats, calculate fare, wait for
money to be paid, store the reservation and get the ticket printed out. The program
containing these steps is kept in memory of the computer and is followed for
each request.
But inside the computer, the steps followed are quite different from what we
see on the monitor or screen. In computer's memory both programs and data
are stored in the binary form. You have already been introduced with decimal
number system, that is the numbers 1 to 9 and 0. The binary system has only two
values 0 and 1. These are called bits. As human beings we all understand decimal
system but the computer can only understand binary system. It is because a large
number of integrated circuits inside the computer can be considered as switches,
which can be made ON, or OFF. If a switch is ON it is considered 1 and if it is
OFF it is 0. A number of switches in different states will give you a message
like this: 110101......10. So the computer takes input in the form of 0 and 1 and
gives output in the same form, i.e., 0 and 1 only. Is it not absurd if the computer
gives outputs as 0's & 1's only? But you do not have to worry about. Every number
in binary system can be converted to decimal system and vice versa; for example,
1010 meaning decimal 10. Therefore, it is the computer that takes information
or data in decimal form from you, converts it into binary form, processes it
producing output in binary form and finally again converts the output to decimal
form.
The primary memory as you know in the computer is in the form of IC's
(Integrated Circuits). These circuits are called Random Access Memory (RAM).
Each of RAM's location stores one byte of information. (One byte is equal to 8
bits). A bit is an acronym for binary digit, which stands for one binary piece of
information. This can be either 0 or 1. You will know more about RAM later.
The Primary or internal storage unit is made up of several small storage locations
called cells. Each of these cells can store a fixed number of bits called word
length.
Each cell has a unique number assigned to it called the address of the cell and it
is used to identify the cells. The address starts at 0 and goes up to (N-1). You
should know that the memory is like a large cabinet containing as many drawers
as there are addresses son memory. Each drawer contains a word and the address
is written on outside of the drawer.

Capacity of Primary Memory

You know that each cell of memory contains one character or 1 byte of data. So
the capacity is defined in terms of byte or words. Thus 64 kilobyte (KB) memory
is capable of storing 64 x 1024 = 32,768 bytes. (1 kilobyte is equal to 1024
bytes). A memory size ranges from few kilobytes in small systems to several
thousands kilobytes in large mainframe and super computer. In your personal
computer you will find memory capacity in the range of 8 MB, 16 MB and even
128 MB (MB = Million bytes). The following terms related to memory of
computer are discussed below:

(a)Random Access Memory (RAM) : The primary storage is referred to
as Random Access Memory (RAM) because it is possible to randomly
select and use any location of the memory directly to store and retrieve
data. It takes same time to any address of the memory as the first address.
It is also called read/write memory. The storage of data and instructions
inside the primary storage is temporary. It disappears from RAM as soon
as the power to the computer is switched off. The memories, which loose
their content on failure of power supply, are known as volatile memories.
So now we can say that RAM is volatile memory.

(b)Read Only Memory (ROM) : There is another memory in computer,
which is called Read Only Memory (ROM). Again it is the ICs inside
the PC that form the ROM. The storage of program and data in the ROM
is permanent. The ROM stores some standard processing programs
supplied by the manufacturers to operate the personal computer. The
ROM can only be read by the CPU but it cannot be changed. The basic
input/output program is stored in the ROM that examines and initializes
various equipment attached to the PC when the switch is turned ON. The
memories, which do not loose their content on failure of power supply,
are known as non-volatile memories. ROM is non-volatile memory.

(c)PROM : There is another type of primary memory in computer, which
is called Programmable Read Only Memory (PROM). You know that it
is not possible to modify or erase programs stored in ROM, but it is
possible for you to store your program in PROM chip. Once the programs
are written it cannot be changed and remain intact even if power is
switched off. Therefore, programs or instructions written in PROM or
ROM cannot be erased or changed.

(d)EPROM : This stands for Erasable Programmable Read Only Memory,
which overcome the problem of PROM and ROM. EPROM chip can be
programmed time and again by erasing the information stored earlier in
it. Information stored in EPROM can be erased by exposing it to
ultraviolet light. This memory can be reprogrammed using a special
programming facility. When the EPROM is in use, information can only
be read.

(e)EAPROM : This stands for Electrically Alterable Programmable Read
Only Memory. This concept is same as that of EPROM. The only
difference is that the memory can be altered using electrical signals. The
whole of the memory need not be erased.

(f)Cache Memory : The speed of CPU is extremely high compared to the
access time of main memory. Therefore, the performance of CPU
decreases due to the slow speed of main memory. The decreases the
mismatch in operating speed, a small memory chip is attached between
CPU and Main memory whose access time is very close to the processing
speed of CPU. It is called CACHE memory. CACHE memories are
accessed much faster than conventional RAM. It is used to store programs
or data currently being executed or temporary data frequently used by
the CPU. It is also very expensive to have bigger size of cache memory.
Its size is therefore, normally kept small.

(g)Registers : The CPU processes data and instruction with high speed.
There is also movement of data between various units of the computer. It
is necessary to transfer the processed data with high speed. So the
computer uses a number of special memory units called registers. They
are not par of the main memory but they store data or information
temporarily and pass it on as directed by the control unit.


Secondary Storage Devices
We are now clear that the operating speed of primary memory or main memory
should be as fast as possible to cope up with the CPU speed. These high-speed
storage devices are very expensive and hence the cost per bit of storage is also
very high. Again, the storage capacity of the main memory is also very limited.
Often it is necessary to store hundreds of millions of bytes of data for the CPU
to process. Therefore, additional memory is required in all the computer
systems. This memory is called auxiliary memory or secondary storage.

In this type of memory the cost per bit of storage is low. However, the operating
speed is slower than that of the primary memory. Huge volume of data are stored
here on permanent basis and transferred to the primary storage as and when
required. Most widely used secondary storage devices are magnetic tapes,
magnetic disks and floppy disks.

1. Magnetic Tape
Magnetic tapes are used for large computers like mainframe computers where
large volume of data is stored for a longer time. In PCs also you can use tapes
in the form of cassettes. The cost of storing data in tapes is inexpensive. Tapes
consist of magnetic materials that store data permanently. It can be 12.5 mm to
25 mm wide plastic film-type and 500 meter to 1200 meter long which is coated
with magnetic material. The deck is connected to the central processor and
information is fed into or read from the tape through the processor. It is similar
to cassette tape recorder.

Advantages of Magnetic Tape
1.Compact : A 10-inch diameter reel of tape is 2400 feet long and is able
to hold 800, 1600 or 6250 characters in each inch of its length. The
maximum capacity of such type is 180 million characters. Thus data are
stored much more compact on tape

2.Economical : The cost of storing characters on tape is very less as
compared to other storage devices.

3.Fast : Copying of data is easier and fast.

4.Long term Storage and Re-usability : Magnetic tapes can be used for
long term storage and a tape can be used repeatedly with out loss of data

2 Magnetic Disk
You might have seen the gramophone record, which is circular like a disk and
coated with magnetic material. Magnetic disks used in computer are made on
the same principle. It rotates with very high speed inside the disk drive. Data
are stored on both the surface of the disk. Magnetic disks are most popular for
direct access storage. Each disk consists of a number of invisible concentric
circles called tracks. Information is recorded on tracks of a disk surface in the
form of tiny magnetic sports. The presence of a magnetic sport represents one
bit (1) and its absence represents zero bit (0). The information stored in a disk
can be read many times without affecting the stored data. So the reading operation
is non-destructive. But if you want to write a new data, then the existing data is
erased from the disk and new data is recorded.

3 Floppy Disk
It is similar to magnetic disk discussed above. It is 3.5 inch in diameter. The
capacity of a 3.5 inch floppy is 1.44 mega bytes. It is cheaper than any other
storage devices and is portable. The floppy is a low cost device particularly
suitable for personal computer system.

4 Optical Disk
With every application and software there is greater demand for memory
capacity. It is the necessity to store large volume of data that has led to the
development of optical disk storage medium. Optical disks can be divided into
the following categories.
(i)
Compact Disk/Read Only Memory (CD-ROM): CD-ROM disks are
made of reflective metals. CD-ROM is written during the process of
manufacturing by high power laser beam. Here the storage density is very
high, storage cost is very low and access time is relatively fast. Each
disk is approximately 4 1/2 inches in diameter and can hold over 600 MB
of data. As the CD-ROM can be read only we cannot write or make
changes into the data contained in it.
(ii)
Write Once Read Many (WORM): The inconvenience that we can not
write any thing in to a CD-ROM is avoided in WORM. AWORM allows
the user to write data permanently on the disk. Once the data is written it
can never be erased without physically damaging the disk. Here data can
be recorded from keyboard, video scanner, OCR equipment and other
devices. The advantage of WORM is that it can store vast amount of data
amounting to gigabytes. Any document in a WORM can be accessed very
fast.
(iii) Erasable Optical Disk : These are optical disks where data can be
written, erased and re-written. This also applies a laser beam to write
and re-write the data. These disks may be used as alternatives to traditional
disks. Erasable optical disks are based on a technology known as magnetic
optical (MO). To write a data bit on the erasable optical disk the MO
drive's laser beam heats a tiny, precisely defined point on the disk's surface
and magnetises it.


Output Devices

Output devices receive information from the CPU and present it to the user in
the desired form. Output devices include display screen, loudspeakers, printers,
plotters, etc.

1 Display Screen
When a program is keyed in, the screen (which is similar to a television screen)
displays the characters. The user can read the program line by line and make
corrections before it is stored or printed on a printer. It is also possible to bring
to the screen a portion of the program stored in the external storage for editing.
Screen sizes differ from system to system. The standard size is 24 lines by 80
characters. Most systems have provision for scrolling. This facilitates the user
to move the text vertically or horizontally on the screens thus bringing to the
screen the hidden text. Thus the user can scan through the entire file either to
review or to select a particular portion. The cursor on the screen is controlled
by the cursor keys on the keyboard

2 Printer
Printer is a device that prints text or illustrations on paper and in may cases on
transparencies and other media. There are many different types of printers. In
terms of the technology utilised, printer fall into the following categories.

(i)Ink-jet Printer
Ink-jet printers work by spraying ionized ink on a sheet of paper. Magnetized
plates in the ink's path direct the ink onto the paper in the desired shapes. Ink-
jet printers are capable of producing high quality print approaching to that
produced by laser printers. A typical ink-jet printer provides a resolution of 300
dots per inch, although some newer models offer higher resolutions.
In general, the price of ink-jet printers is lower than that of laser printers.
However, they are also considerably slower. Another drawback of ink-jet printers
is that they require a special type of ink that is apt to smudge on inexpensive
copier paper.
Because ink-jet printers require smaller mechanical parts than laser printers,
they are specially popular as portable printers. In addition, colour ink-jet printers
provide an inexpensive way to print full-colour documents.

(ii)Laser Printer
Laser Printer utilizes a laser beam to produce an image on a drum. The light of
the laser alters the electrical charge on the drum wherever it hits. The drum is
then rolled through a reservoir of toner, which is picked up by the charged
portions of the drum. Finally, the toner is transferred to the paper through a
combination of heat and pressure. This is also the way copy machines work.
Because an entire page is transmitted to a drum before the toner is applied, laser
printers are sometimes called page printers. There are two other types of page
printers that fall under the category of laser printers even though they do not
use lasers at all. One uses an array of LEDs to expose the drum, and the other
uses LCDs. Once the drum is charged, however, they both operate like a real
laser printer.
One of the chief characteristics of laser printers is their resolution - how many
dots per inch (dpi) they lay down. The available resolutions range from 300 dpi
at the low end to 1,200 dpi at the high end. By comparison, offset printing usually
prints at 1,200 or 2,400 dpi. Some laser printers achieve higher resolutions with
special techniques known generally as resolution enhancement.
In addition to text, laser printers are very adept at printing graphics. However,
you need significant amounts of memory in the printer to print high-resolution
graphics. To print a full-page graphic at 300 dpi, for example, you need at least
1 MB (megabyte) of printer RAM. For a 600-dpi graphic, you need at least 4
MB RAM.
The speed of laser printers ranges from about 4 to 20 pages of text per minute
(ppm). A typical rate of 6 ppm is equivalent to about 40 characters per second
(cps).

(iii) Line Printer
Line printers are high-speed printers capable of printing an entire line at one
time. A fast line printer can print as many as 3,000 lines per minute. The
disadvantages of line printers are that they can print only one font, they cannot
print graphics, the print quality is low, and they are very noisy.

(iv) Thermal printer
Thermal printers are printers that produce images by pushing electrically heated
pins against special heat-sensitive paper. Thermal printers are inexpensive and
are used in most calculators and many fax machines. They produce low-quality
print, and the paper tends to curl and fade after a few weeks or months.

3 Plotter
Plotter is a device that draws pictures on paper based on commands from a
computer. Plotters differ from printers in that they draw lines using a pen. As a
result, they can produce continuous lines, whereas printers can only simulate
lines by printing a closely spaced series of dots. Multicolour plotters use
different-coloured pens to draw different colours.
.
4 Sound Cards & Speakers
An expansion board that enables a computer to manipulate and output sounds.
Sound cards are necessary for nearly all CD-ROMs and have become
commonplace on modern personal computers. Sound cards enable the computer
to output sound through speakers connected to the board, to record sound input
from a microphone connected to the computer, and manipulate sound stored on
a disk.
Nearly all sound cards support MIDI, a standard for representing music
electronically. In addition, most sound cards are Sound Blaster-compatible, which
means that they can process commands written for a Sound Blaster card, the de
facto standard for PC sound.

5 3D-Audio
3D audio is a technique for giving more depth to traditional stereo sound.
Typically, 3D sound, or 3D audio, is produced by placing a device in a room with
stereo speakers. The device dynamically analyses the sound coming from the
speakers and sends feedback to the sound system so that it can readjust the sound
to give the impression that the speakers are further apart.
3D audio devices are particularly popular for improving computer audio where
the speakers tend to be small and close together. There are a number of 3D audio
devices that can be attached to a computer’s sound card.

LECTURE#4

CLASSIFICATION OF COMPUTERS:
Computers are available in different shapes, sizes and weights, due to these different shapes and sizes they perform different sorts of jobs from one another.They can also be classified in different ways. All the computers are designed by the qualified computer architectures that design these machines as their requirements.
A computer that is used in a home differs in size and shape from the computer being used in a hospital. Computers act as a server in large buildings, while the computer also differs in size and shape performing its job as a weather forecaster.A student carrying a laptop with him to his college is different in shape and size from all the computers mentioned above.
Here we are going to introduce different classifications of computers one by one. We will discuss what are in classifications and what job they perform.
1.Super computer:The biggest in size, the most expensive in price than any other is classified and known as super computer. It can process trillions of instructions in seconds. This computer is not used as a PC in a home neither by a student in a college.
Governments specially use this type of computer for their different calculations and heavy jobs. Different industries also use this huge computer for designing their products.
In most of the Hollywood’s movies it is used for animation purposes. This kind of computer is also helpful for forecasting weather reports worldwide.
2.Mainframes:Another giant in computers after the super computer is Mainframe, which can also process millions of instruction per second and capable of accessing billions of data.
This computer is commonly used in big hospitals, air line reservations companies, and many other huge companies prefer mainframe because of its capability of retrieving data on a huge basis.
This is normally to expensive and out of reach from a salary-based person who wants a computer for his home.
This kind of computer can cost up to thousands of dollars.
3.Minicomputer:This computer is next in he line but less offers less than mainframe in work and performance. These are the computers, which are mostly preferred by the small type of business personals, colleges, etc.
4.Personal computers:Almost all the computer users are familiar with the personal computers. They normally know what the personal computer is and what are its functions.
This is the computer mostly preferred by the home users. These computers are lesser in cost than the computers given above and also, small in size; they are also called PCs in short for Personal computers.
This computer is small in size and you can easily arrange it to fit in your single bedroom with its all accommodation. Today this is thought to be the most popular computer in all.5.Notebook computers:Having a small size and low weight the notebook is easy to carry to anywhere. A student can take it with him/her to his/her school in his/her bag with his/her book.
This is easy to carry around and preferred by students and business people to meet their assignments and other necessary tasks.
The approach of this computer is also the same as the Personal computer. It can store the same amount of data and having a memory of the same size as that of a personal computer. One can say that it is the replacement of personal desktop computer.

LECTURE#5

RADIX NUMBER SYSTEM
1.DECIMAL NUMBER: Here's the decimal number system as an example: digits (or symbols) allowed: 0-9 base (or radix): 10 the order of the digits is significant 345 is really 3 x 100 + 4 x 10 + 5 x 1 3 x 10**2 + 4 x 10**1 + 5 x 10**0 3 is the most significant symbol (it carries the most weight) 5 is the least significant symbol (it carries the least weight) 2. BINARY NUMBER: Here's a binary number system: digits (symbols) allowed: 0, 1 base (radix): 2 each binary digit is called a BIT the order of the digits is significant numbering of the digits msb lsb n-1 0 where n is the number of digits in the number 1001 (base 2) is really 1 x 2**3 + 0 x 2**2 + 0 x 2**1 + 1 x 2**0 9 (base 10) 11000 (base 2) is really 1 x 2**4 + 1 x 2**3 + 0 x 2**2 + 0 x 2**1 + 0 x 2**0 24 (base 10) 3. OCTAL NUMBER:Here's an octal number system: digits (symbols) allowed: 0-7 base (radix): 8 the order of the digits is significant 345 (base 8) is really 3 x 8**2 + 4 x 8**1 + 5 x 8**0 192 + 32 + 5 229 (base 10) 1001 (base 8) is really 1 x 8**3 + 0 x 8**2 + 0 x 8**1 + 1 x 8**0 512 + 0 + 0 + 1 513 (base 10) 4. HEXADECIMAL NUMBER:Here's a hexadecimal number system: digits (symbols) allowed: 0-9, a-f base (radix): 16 the order of the digits is significant hex decimal 0 0 1 1 . . . 9 9 a 10 b 11 c 12 d 13 e 14 f 15 a3 (base 16) is really a x 16**1 + 3 x 16**0 160 + 3 163 (base 10)
CONVERSIONS:1.decimal --> binary : divide decimal value by 2 (the base) until the value is 0 example: 36/2 = 18 r=0 <-- lsb 18/2 = 9 r=0 9/2 = 4 r=1 4/2 = 2 r=0 2/2 = 1 r=0 1/2 = 0 r=1 <-- msb 36 (base 10) == 100100 (base 2) 14/2 = 7 r=0 <-- lsb 7/2 = 3 r=1 3/2 = 1 r=1 1/2 = 0 r=1 <-- msb 14 (base 10) == 1110 (base 2) 2.binary --> octal: 1. group into 3's starting at least significant symbol (if the number of bits is not evenly divisible by 3, then add 0's at the most significant end) 2. write 1 octal digit for each group example: 100 010 111 (binary) 4 2 7 (octal) 10 101 110 (binary) 2 5 6 (octal) 3.binary --> hex: (just like binary to octal!) 1. group into 4's starting at least significant symbol (if the number of bits is not evenly divisible by 4, then add 0's at the most significant end) 2. write 1 hex digit for each group example: 1001 1110 0111 0000 9 e 7 0 1 1111 1010 0011 1 f a 3 4.hex --> binary: (trivial!) just write down the 4 bit binary code for each hexadecimal digit example: 3 9 c 8 0011 1001 1100 1000 5.octal --> binary (just like hex to binary!) (trivial!) just write down the 8 bit binary code for each octal digit 6.hex --> octal do it in 2 steps, hex --> binary --> octal 7.decimal --> hex do it in 2 steps, decimal --> binary --> hex