EIT Module1
EIT Module1
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
MODULE 1
Data Storage: Bits And Their Storage, Main Memory, Mass Storage, Representing Information
As Bit Patterns, The Binary System, Storing Integers, Storing Fractions.
Data Manipulation: Computer Architecture, Machine Language, Program Execution,
Arithmetic/Logic Instructions, Communicating With Other Devices.
DATA STORAGE
Bits and their Storage: Inside today’s computers information is encoded as patterns of 0s and 1s.
These digits are called bits (short for binary digits).
Boolean Operations: In computer operations, the bit 0 represents the value false and the bit 1
represents the value true. Operations that manipulate true/false values are called Boolean
operations. Three of the basic Boolean operations are AND, OR, and XOR (exclusive or) as
summarized in Fig. 1.1.
The Boolean operation AND is designed to reflect the truth or falseness of a statement formed
by combining two smaller, statements with the conjunction and. Such statements have the generic
form P AND Q. The AND operation is based on compound statements of the form P AND Q
where, P represents one statement and Q represents another. Such statements are true only when
both of their components are true. The OR operation is based on compound statements of the
form P OR Q. Such statements are true when at least one of their components is true. XOR
produces an output of 1 (true) when one of its inputs is 1 (true) and the other is 0 (false). P XOR
Q means “either P or Q but not both.” The operation NOT is another Boolean operation. It has
only one input. Its output is the opposite of that input. If the input of the operation NOT is true,
then the output is false, & vice versa.
MOHAMMED SALEEM 1
2
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Gates and Flip-flops: A device that produces the output of a Boolean operation when given the
operation’s input values is called a gate. Inside today’s computers, gates are usually implemented
as small electronic circuits in which the digits 0 and 1 are represented as voltage levels. Figure 1.2
represent gates in their symbolic form.
Gates provide the building blocks from which computers are constructed. A flip-flop is a
fundamental unit of computer memory and it is a collection of circuits. It produces an output
value of 0 or 1, which remains constant until a pulse (a temporary change to a 1 that returns to 0)
from another circuit causes it to shift to the other value. In other words, the output can be set to
“remember” a zero or a one under control of external stimuli.
As long as both inputs in the circuit in Figure 1.3 remain 0, the output (whether 0 or 1)
will not change. However, temporarily placing a 1 on the upper input will force the output to be
1, whereas temporarily placing a 1 on the lower input will force the output to be 0.
MOHAMMED SALEEM 2
3
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Suppose that the upper input is changed to 1 while the lower input remains 0 (Figure 1.4a).
This will cause the output of the OR gate to be 1, regardless of the other input to this gate. In turn,
both inputs to the AND gate will now be 1, since the other input to this gate is already 1. The
output of the AND gate will then become 1, which means that the second input to the OR gate
will now be 1 (Figure 1.4b). This guarantees that the output of the OR gate will remain 1, even
when the upper input to the flip-flop is changed back to 0 (Figure 1.4c). In summary, the flip-
flop’s output has become 1, and this output value will remain after the upper input returns to 0.
In a similar manner, temporarily placing the value 1 on the lower input will force the flip-
flop’s output to be 0, and this output will persist after the input value returns to 0.
Hexadecimal Notation: A long string of bits is often called a stream. Streams are difficult for the
human mind to comprehend. To simplify the representation of bit patterns, a shorthand notation
called hexadecimal notation, is used. The bit patterns within a machine is represented in
multiples of four i.e., hexadecimal notation uses a single symbol to represent a pattern of four
bits. For e.g., a string of 12 bits can be represented by three hexadecimal symbols.
Figure 1.6 presents the hexadecimal encoding system. Using this system, the bit pattern
10110101 is represented as B5. In this manner, the 16-bit pattern 1010010011001000 can be
reduced to the more palatable form A4C8.
MOHAMMED SALEEM 3
4
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Main Memory: For the purpose of storing data, a computer contains a large collection of circuits
(such as flip-flops), each capable of storing a single bit. This bit reservoir is known as the machine’s
main memory.
Memory Organization: A computer’s main memory is organized in manageable units called
cells, with a typical cell size being eight bits. A string of eight bits is called a byte. Thus, a typical
memory cell has a capacity of one byte.
The contents of a byte-size memory cell is represented as shown in Figure 1.7. The left end of
this row is called the high-order end, and the right end is called the low-order end. The left most
bit is called either the high-order bit or the most significant bit and the rightmost bit is referred
to as the low-order bit or the least significant bit.
To identify individual cells in a computer’s main memory, each cell is assigned a unique
“name,” called its address. Addressing not only gives a way of uniquely identifying each cell but
also associates an order to the cells (Fig 1.8) giving phrases like “previous cell” or “next cell”.
To complete the main memory of a computer, the circuitry that holds the bits is combined
with the circuitry required to allow other circuits to store and retrieve data from the memory cells.
MOHAMMED SALEEM 4
5
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
In this way, other circuits can get data from the memory by electronically asking for the
contents of a certain address (read operation), or they can record information in the memory by
requesting that a certain bit pattern be placed in the cell at a particular address (write operation).
Because a computer’s main memory is organized as individual, addressable cells, the cells can
be accessed independently as required. To reflect the ability to access cells in any order, a
computer’s main memory is often called random access memory (RAM). Many of modern
technologies store bits as tiny electric charges that dissipate quickly. Thus these devices require
additional circuitry, known as a refresh circuit that repeatedly replenishes the charges many times
a second. In recognition of this volatility, computer memory constructed from such technology is
often called dynamic memory, leading to the term DRAM meaning Dynamic RAM. The term
SDRAM meaning Synchronous DRAM, is used in reference to DRAM that applies additional
techniques to decrease the time needed to retrieve the contents from its memory cells.
Measuring Memory Capacity: It is convenient to design main memory systems in which the
total number of cells is a power of two. In turn, the size of the memories in early computers were
often measured in 1024 (which is 2^10) cell units. Since 1024 is close to the value 1000, the prefix
kilo in reference to this unit was adopted. That is, the term kilobyte (KB) was used to refer to
1024 bytes. A machine with 4096 memory cells is said to have a 4KB memory (4096 = 4 * 1024).
As memories became larger, this terminology grew to include MB (megabyte), GB (gigabyte),
and TB (terabyte).
Mass Storage: Due to the volatility and limited size of main memory, most computers have
additional memory devices called mass storage (or secondary storage) systems, including
magnetic disks, CDs, DVDs, magnetic tapes, flash drives, and solid-state disks.
The advantages of mass storage systems over main memory include less volatility, large
storage capacities, low cost, and ability to remove the storage medium from machine for archival
purposes. A major disadvantage is that they typically require mechanical motion and require
MOHAMMED SALEEM 5
6
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
more time to store and retrieve data. Storage systems with moving parts are more prone to
mechanical failures.
Magnetic Systems: For years, magnetic technology has dominated the mass storage arena. The
most common example in use today is the magnetic disk or hard disk drive (HDD), in which a
thin spinning disk with magnetic coating is used to hold data (Figure 1.9).
Read/write heads are placed above and/or below the disk so that as the disk spins, each
head traverses a circle, called a track. By repositioning the read/write heads, different concentric
tracks can be accessed. A disk storage system consists of several disks mounted on a common
spindle, one on top of the other, with enough space for the read/write heads to slip between the
platters. In such cases, the read/write heads move in unison. Each time the read/write heads are
repositioned, a new set of tracks, which is called a cylinder, becomes accessible.
Each track is divided into small arcs called sectors. All sectors on a disk contain the same
number of bits (512 bytes to a few KB). Each track contains the same number of sectors. Thus,
the bits within a sector on a track near the outer edge of the disk are less compactly stored than
those on the tracks near the center. In contrast, in high-capacity disk storage systems, the tracks
near the outer edge are capable of containing more sectors than those near the center, and this
capability is often used by applying a technique called zoned-bit recording.
Using zoned-bit recording, several adjacent tracks are collectively known as zones. All
tracks within a zone have the same number of sectors, but each zone has more sectors per track
than the zone inside of it. In this manner, efficient use of the entire disk surface is achieved.
The capacity of a disk storage system depends on the number of platters used and the
density in which the tracks and sectors are placed. Lower-capacity systems may consist of a single
MOHAMMED SALEEM 6
7
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
platter. High-capacity disk systems, capable of holding many gigabytes, or even terabytes, consist
of perhaps three to six platters mounted on a common spindle. Furthermore, data may be stored
on both the upper and lower surfaces of each platter.
Measurements used to evaluate a disk system’s performance are: (1) seek time (the time
required to move the R/W heads from one track to another); (2) rotation delay or latency time
(half the time required for the disk to make a complete rotation); (3) access time (the sum of seek
time and rotation delay); and (4) transfer rate (the rate at which data can be transferred to or from
the disk).
A factor limiting the access time and transfer rate is the speed at which a disk system rotates.
To facilitate fast rotation speeds, the read/write heads in these systems do not touch the disk but
instead “float” just off the surface. The spacing is so close that even a single particle of dust could
become jammed between the head and disk surface, destroying both. Thus, disk systems are
typically housed in cases that are sealed at the factory. With this construction, disk systems are
able to rotate at speeds of several hundred times per second, achieving transfer rates that are
measured in MB per second.
Optical Systems: Another class of mass storage systems applies optical technology. An example
is the compact disk (CD). These disks are 12 centimetres (approximately 5 inches) in diameter
and consist of reflective material covered with a clear protective coating. Information is recorded
on them by creating variations in their reflective surfaces. This information can then be retrieved
by means of a laser that detects irregularities on the reflective surface of the CD as it spins.
CD technology was originally applied to audio recordings using a recording format known
as CD-DA (compact disk-digital audio), Information on CDs is stored on a single track that
spirals around the CD & the track on a CD spirals from the inside out (Figure 1.10). This track
is divided into units called sectors, each with capacity of 2KB of data.
MOHAMMED SALEEM 7
8
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
To maximize the capacity of a CD, more information is stored in a loop around the outer
portion of the spiral than in a loop around the inner portion. More sectors will be read in a single
revolution of the disk when the laser is scanning the outer portion of the spiraled track than when
the laser is scanning the inner portion of the track. Thus, to obtain a uniform rate of data transfer,
CD-DA players are designed to vary the rotation speed depending on the location of the laser.
CD storage systems perform best when dealing with long, continuous strings of data, as when
reproducing music. When an application requires access to items of data in a random manner,
magnetic disk storage approach is preferred.
CDs have capacities in the range of 600 to 700MB. DVDs (Digital Versatile Disks), which
are constructed from multiple, semi-transparent layers, provide storage capacities of several GB.
They are capable of storing lengthy multimedia presentations, including entire motion pictures.
Finally, Blu-ray technology, which uses a laser in the blue-violet spectrum of light, is able to focus
its laser beam with very fine precision. As a result, BDs (Blu-ray Disks) provides over five times
the capacity of a DVD. This seemingly vast amount of storage is needed to meet the demands of
high definition video.
Flash Drives: In a flash memory system, bits are stored by sending electronic signals directly to
the storage medium where they cause electrons to be trapped in tiny chambers of silicon dioxide,
thus altering the characteristics of small electronic circuits. Since these chambers are able to hold
their captive electrons for many years without external power, this technology is excellent for
portable, non-volatile data storage.
Data stored in flash memory systems can be accessed in small byte size units as in RAM but
stored data be erased in large blocks. Repeated erasing slowly damages the silicon dioxide
chambers, making it not suitable for applications where its contents might be altered many times
a second. Flash memories are widely used in digital cameras and smartphones. Since flash
memory is not sensitive to physical shock (in contrast to magnetic and optic systems), it is now
replacing other mass storage technologies in portable applications such as laptop computers.
Flash memory devices called flash drives, with capacities of hundreds of GBs, are available
for general mass storage applications. These units are packaged in smaller plastic cases with a
removable cap on one end to protect the unit’s electrical connector when the drive is offline. The
high capacity of these portable units as well as the fact that they are easily connected to and
disconnected from a computer make them ideal for portable data storage.
Larger flash memory devices called SSDs (solid-state disks) are explicitly designed to replace
the magnetic hard disks. SSDs compare favorably to hard disks in their resilience to vibrations
MOHAMMED SALEEM 8
9
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
and physical shock, their quiet operation (due to no moving parts), and their lower access times.
SSDs are more expensive than hard disks of comparable size and are still considered a high-end
option when buying a computer. SSD sectors suffer from the more limited lifetime of all flash
memory technologies.
Another flash technology is SD (Secure Digital) memory cards (SD Cards). They provide up
to two GBs of storage and are packaged in a plastic rigged wafer about the size a postage stamp
(SD cards are also available in smaller mini and micro sizes). SDHC (High Capacity) memory
cards can provide up to 32 GBs. SDXC (Extended Capacity) memory cards may exceed a TB.
These cards conveniently slip into slots of small electronic devices due its compact size. Thus,
they are ideal for digital cameras, smartphones, music players, car navigation systems, and other
electronic appliances.
Representing Information as Bit Patterns
Representing Text: Information in the form of text is represented by means of a code in which
each of the different symbols in the text (alphabets & punctuation marks) is assigned a unique bit
pattern. The text is then represented as a long string of bits in which the successive patterns
represent the successive symbols in the original text.
The American National Standards Institute (ANSI) adopted the American Standard
Code for Information Interchange (ASCII). This code uses bit patterns of length seven to
represent the upper- and lowercase letters of the English alphabet, punctuation symbols, the digits
0 through 9, and certain control information such as line feeds, carriage returns, and tabs. ASCII
is extended to an eight-bit-per-symbol format by adding a 0 at the most significant end of each of
the seven-bit patterns. This technique provides 128 additional bit patterns that can be used to
represent symbols beyond the English alphabet and associated punctuation. In ASCII, “Hello.”
is demonstrated as shown in fig. 1.11.
The International Organization for Standardization (ISO) has developed a number of
extensions to ASCII, each of which was designed to accommodate a major language group.
The ISO-extended ASCII standards had two major obstacles: First, the number of extra
bit patterns available is insufficient to accommodate the alphabet of many Asian and European
languages. Second, since each document could use characters from only one selected standard, it
was not possible to support documents that included text from multiple language groups.
MOHAMMED SALEEM 9
10
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
To address this deficiency, Unicode was developed. This code uses a unique pattern of up
to 21 bits to represent each symbol. When the Unicode character set is combined with the
Unicode Transformation Format 8-bit (UTF-8) encoding standard, the original ASCII
characters can still be represented with 8 bits, while the thousands of additional characters from
such languages as Chinese, Japanese can be represented by 16 bits. UTF-8 uses 24- or 32-bit
patterns to represent more obscure Unicode symbols.
Representing Numeric Values: Binary notation (or variations of it) is used extensively for
encoded numeric data for computer storage. Binary notation is a way of representing numeric
values using only the digits 0 and 1 rather than the digits 0-to-9 as in the traditional decimal, or
base 10, system.
Two’s complement notation is common for storing whole numbers because it provides a
convenient method for representing negative numbers as well as positive. For representing
numbers as Bit Patterns with fractional parts such as 4-1/2 or 3/4, another technique, called
floating point notation is used.
Representing Images: Image is represented as a collection of dots, each of which is called a pixel
(picture element). The appearance of each pixel is then encoded and the entire image is
represented as a collection of these encoded pixels. Such a collection is called a bit map. This
approach is popular because many display devices, such as printers and display screens, operate
on the pixel concept.
Images can be represented in different ways depending on their type. In a simple black-
and-white image, each pixel is represented by a single bit. The bit indicates whether the pixel is
black or white. This method is commonly used in facsimile (fax) machines. For more detailed
black-and-white photographs, each pixel is usually represented using eight bits (one byte),
allowing 256 different shades of gray to be displayed.
Color images require more complex encoding. One common method is RGB encoding,
where each pixel is represented by three components: red, green, and blue. Each component
typically uses one byte (8 bits), so a total of three bytes (24 bits) are required to represent a single
pixel. By combining different intensities of red, green, and blue, a wide range of colors can be
produced.
Another method of encoding color images uses a brightness component and two color
components. The brightness component is called luminance & represents the amount of white
light in the pixel. The other two components are blue chrominance and red chrominance, which
are calculated based on the differences between luminance & blue or red color intensities. This
MOHAMMED SALEEM 10
11
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
method became popular in color television broadcasting because it allowed compatibility with
older black-and-white television sets. A gray-scale image can be produced by using only the
luminance component.
One disadvantage of representing images as bit maps is that resizing them is difficult.
Enlarging a bitmap image increases the size of its pixels, leading to a grainy or pixelated
appearance. This effect is seen in digital zoom in cameras.
An alternative method of representing images is to use geometric structures such as lines
and curves. This approach, known as vector or geometric representation, uses mathematical
descriptions to define shapes. It allows images to be resized without losing quality because the
display device redraws the shapes according to the required size. This method is used in scalable
fonts, CAD systems, and many drawing applications. Unlike bitmaps, vector images remain
sharp and clear at any size, making them ideal for logos, fonts, and technical drawings.
Representing Sound: Sound can be represented in computers by sampling the amplitude of a
sound wave at regular time intervals and storing the numeric values obtained. This method is
called sampling. For example, a sequence of numbers such as 0, 1.5, 2.0, 1.5, 2.0, 3.0, 4.0, 3.0, 0
represents changes in the amplitude of the sound wave over time (Figure 1.12). In traditional
telephone communication, the sound is sampled at a rate of 8000 samples per second, meaning
the amplitude is measured 8000 times every second. These numerical values are transmitted and
then reconstructed at the receiving end to reproduce the voice.
However, 8000 samples per second is not sufficient for high-quality music. For high-
fidelity audio (audio CDs), a sampling rate of 44,100 samples per second is used. Each sample is
typically stored using 16 bits for mono sound and 32 bits for stereo sound. As a result, one second
of stereo music requires more than one million bits of storage.
MOHAMMED SALEEM 11
12
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
An alternative method of encoding sound is Musical Instrument Digital Interface
(MIDI). Instead of recording the actual sound waves, MIDI stores instructions about which
instrument should play which note and for how long. Thus, it records the musical information
rather than the sound itself. For example, a clarinet playing a note for two seconds can be stored
in just a few bytes using MIDI, compared to millions of bits using sampling. MIDI requires much
less storage space but the sound produced may vary depending on the synthesizer used, since it
represents the musical instructions rather than the actual performance.
The Binary System
In base 10 (decimal) system, the number 375 represents (3 * hundred) + (7 * ten) + (5 * one),
which, in more technical notation, is (3 * 102) + (7 * 101) + (5 * 100). Similarly, in base 2 (binary)
system, the number 1011 represents (1 * eight) + (0 * four) + (1 * two) + (1 * one) i.e.
(1*23)+(0*22)+(1*21)+(1*20).
MOHAMMED SALEEM 12
13
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Binary Addition
Storing Integers
Two’s Complement Notation: The most popular system for representing integers within today’s
computers is two’s complement notation. Fig 1.19 shows complete two’s complement systems.
In a two’s complement system, the leftmost bit of a bit pattern indicates the sign of the
value represented. This bit is called as sign bit. In a two’s complement system, negative values
are represented by the patterns whose sign bits are 1; nonnegative values are represented by
patterns whose sign bits are 0.
MOHAMMED SALEEM 13
14
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
MOHAMMED SALEEM 14
15
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Excess notation: This is another method for representing integers using bit patterns of fixed
length. To create an excess system, first choose the number of bits. Then list all possible bit
patterns in normal binary counting order. The first pattern whose most significant bit (MSB) is 1
appears about halfway in the list. This pattern is chosen to represent zero. The patterns after it
represent positive numbers (1, 2, 3 …), and the patterns before it represent negative numbers (−1,
−2, −3 …). The resulting code, when using patterns of length four, is shown in Figure 1.22. The
system represented in Figure 1.22 is known as excess eight notation. A three-bit excess system is
known as excess four notation (Figure 1.23).
Storing Fractions
Storing numbers with fractional parts requires saving both the binary digits and the position of
the radix (binary) point. A common method used for this purpose is called floating-point
notation, which is based on scientific notation.
Floating-point notation: Consider an example of representing 8 bits. In this format, the leftmost
bit is reserved as the sign bit. If the sign bit is 0, the number is positive; if it is 1, the number is
negative. The remaining 7 bits are divided into two parts called fields: the exponent field and the
mantissa field. The exponent field represents the position of the radix point, while the mantissa
field represents the significant digits of the number. Thus, a floating-point number is stored using
three components: sign, exponent, and mantissa. Figure 1.24 illustrates how the byte is divided.
MOHAMMED SALEEM 15
16
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Example: 1) Suppose a byte consists of bit pattern 01101011. Here, the sign bit is 0, the exponent
is 110, and the mantissa is 1011. To decode the byte, extract the mantissa and place a radix point
on its left side, i.e., .1011 Next, extract the contents of the exponent field (110) and interpret it as
an integer stored using the 3-bit excess method. (i.e. 110 represents 2 in 3-bit excess). Hence move
the radix to the right by 2 bit. Thus, 10.11 is obtained, which is binary representation for 23⁄4.
2) Consider the byte 00111100. Extract the mantissa to obtain .1100 and move the radix 1 bit to
the left, since the exponent field (011) represents the value -1. Therefore we get .01100 which
represents 3/8. Since the sign bit in the original pattern is 0, the value stored is nonnegative. We
conclude that the pattern 00111100 represents 3⁄8.
To store a value using floating-point notation, reverse the preceding process. For example,
to encode 11⁄8, first express it in binary notation i.e. 1.001. Next, copy the bit pattern into the
mantissa field from left to right, starting with the leftmost 1 in the binary representation. Now the
byte looks like: 1 0 0 1
To extract the exponent field, we see that the radix in .1001 must be moved 1 bit to the
right to obtain 1.001. The exponent should therefore be a positive one, so we place 101 (which is
positive one in excess four notation-Figure 1.23) in the exponent field. Finally, we fill the sign bit
with 0 because the value being stored is nonnegative. The finished byte looks like: 0 1 0 1 1 0 0 1
Truncation Errors: In a one-byte floating-point system, storing some numbers may cause loss of
accuracy. For example, the value 25/8 in binary is 10.101. When this number is stored in the
mantissa field, there may not be enough bits to store all the digits. As a result, the last digit (1) is
dropped. After filling the exponent and sign bits, the stored pattern becomes 01101010, which
represents 2½ instead of 25/8 (3.125). The difference occurs because part of the number was
removed during storage. This is shown in figure 1.25.
MOHAMMED SALEEM 16
17
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
This loss of digits due to limited mantissa size is called truncation error (or round-off
error). It happens when a number cannot be stored exactly because there are not enough bits to
represent all its digits.
The effect of truncation error can be reduced by using more bits for the mantissa. Modern
computers usually use at least 32 bits (or more) for floating-point numbers, which increases
accuracy. However, even with larger formats, perfect accuracy is not always possible.
DATA MANIPULATION
Computer Architecture
The circuitry in a computer that controls the manipulation of data is called the central processing
unit, or CPU. The CPUs found in today’s computers are packaged as small flat squares whose
connecting pins plug into a socket mounted on the machine’s main circuit board called the
motherboard. In smartphones, other Mobile Internet Devices (MID), CPUs are around half the
size of a postage stamp. Due to their small size, these processors are called microprocessors.
CPU Basics: A CPU consists of three parts (Figure 2.1): the arithmetic/logic unit, which contains
the circuitry that performs operations on data (addition/subtraction); the control unit, which
contains the circuitry for coordinating the machine’s activities; and the register unit, which
contains data storage cells, called registers that are used for temporary storage of information
within the CPU. Some of the registers within the register unit are considered general- purpose
registers, whereas others are special-purpose registers.
General-purpose registers are small storage locations inside the CPU used to temporarily
hold data being processed. They store inputs for the Arithmetic Logic Unit (ALU) and also store
the results produced by the ALU. When the CPU needs to perform an operation on data from
MOHAMMED SALEEM 17
18
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
main memory, the control unit first transfers the data into the registers, instructs the ALU which
registers contain the data, performs the operation, and then stores the result back in a register.
The CPU and main memory are connected by a group of wires called a bus. Through the
bus, the CPU reads data from memory by sending the address of the required memory location
along with a read signal. To write data, the CPU sends the memory address, the data to be stored,
and a write signal to main memory.
For the task of adding two values stored in main memory, the data must be transferred
from main memory to registers within the CPU, the values must be added with the result being
placed in a register, and the result must then be stored in a memory cell. The entire process is
summarized by the five steps listed in Figure 2.2.
Stored Program Concept: Early computers were not flexible because their instructions were built
directly into the control unit. To change the program, the machine had to be physically rewired
using plug boards.
A major breakthrough came when designers realized that programs, like data, can be
stored in main memory. If the CPU is designed to fetch instructions from memory, decode them,
and execute them, then changing the program only requires changing the contents of memory—
not rewiring the hardware.
This idea is called the stored-program concept. It means that both data and instructions
are stored together in main memory. The CPU reads instructions from memory and executes
them step by step. This concept made computers much more flexible and is the standard design
used in modern computers today.
MOHAMMED SALEEM 18
19
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Machine Language
To use the stored-program concept, CPUs are designed to recognize instructions encoded as bit
patterns. This set of instructions and its encoding system is called machine language. An
instruction written in this form is called a machine instruction.
The Instruction Repertoire: The list of machine instructions a CPU can execute is usually small.
Once a machine can perform certain basic tasks, adding more instructions does not increase its
fundamental capabilities, though it may improve convenience.
RISC Architecture: One design approach is to use a minimal set of instructions. This is called
Reduced Instruction Set Computer (RISC). RISC machines are efficient, fast, and less expensive
to manufacture.
CISC Architecture: Another approach is to design CPUs with many complex instructions. This
is called Complex Instruction Set Computer (CISC). CISC allows programs to use powerful and
rich instructions, reducing the need for multiple instructions to perform a task.
CISC processors commonly used in desktops and laptops, but CISC processors require
more electrical power. ARM developed a RISC architecture for low power consumption. ARM-
based processors (Qualcomm/Texas Instruments) are widely used in consumer electronics such
as smartphones, game controllers, digital TVs, navigation systems, and cellular telephones.
A machine’s instructions can be categorized into three groupings: (1) the data transfer
group, (2) the arithmetic/logic group, and (3) the control group.
Data Transfer: The data transfer group includes instructions that request movement of data from
one location to another. However, the terms transfer or move are misleading because the original
data is usually not erased; the process is more like copying or duplicating the data.
When data is transferred between the CPU and main memory, special terms are used. A
request to place contents of a memory cell into a general-purpose register is called LOAD
instruction. A request to place the contents of a register into a memory cell is STORE instruction.
The data transfer group also includes instructions used for communication with devices
such as printers, keyboards, and disk drives. These are called input/output (I/O) instructions.
Arithmetic/Logic: The arithmetic/logic group includes instructions that tell the control unit to
request operations in the arithmetic/logic unit (ALU). These include basic arithmetic operations
as well as Boolean operations such as AND, OR, and XOR.
The ALU also performs SHIFT and ROTATE operations. In SHIFT operations, bits that
fall off the end of a register are discarded. In ROTATE operations, the bits that fall off are used
to fill the empty positions at the other end.
MOHAMMED SALEEM 19
20
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Control: The control group includes instructions that direct the execution of a program rather
than manipulate data. This group includes JUMP (or BRANCH) instructions, which tell the
CPU to execute an instruction other than the next one in sequence. There are two types:
unconditional jumps, which always change the execution sequence, and conditional jumps,
which change the sequence only if a specified condition is satisfied.
An Illustrative Machine Language: Consider the machine (Figure 2.4) which has 16 general-
purpose registers and 256 main memory cells, each 8 bits. Registers are labeled 0 through F, and
memory cells are addressed 00 through FF using hexadecimal notation.
Instruction Format: Each machine instruction has two parts: an opcode field and an operand
field. The opcode specifies the operation such as STORE, SHIFT, XOR, or JUMP. The operand
field provides details about the operation, such as which register or memory cell is involved.
Instruction Encoding: The machine language consists of twelve basic instructions. Each
instruction uses 16 bits, represented by four hexadecimal digits (Figure 2.5). The first hexadecimal
digit (4 bits) is the opcode, represented by digits 1 through C. For example, 3 indicates STORE
and A indicates ROTATE. The operand field consists of three hexadecimal digits (12 bits). Except
for HALT, it clarifies the instruction given by the opcode. For example, 35A7 means STORE the
contents of register 5 in memory cell whose address is A7.
Memory Size: Since 8 bits are used to specify memory addresses, exactly 2⁸ (256) memory cells
can be referenced. Therefore, memory is built with 256 cells addressed from 0 to 255.
MOHAMMED SALEEM 20
21
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Example: 1) OR Instruction: Opcode 7 requests an OR operation. The next hexadecimal digit
indicates the register where the result is stored, and the last two digits indicate the registers to be
ORed. 70C5 means OR the contents of register C with register 5 and store the result in register 0.
Program Execution
A computer executes a program by copying instructions from memory into the CPU. Each
instruction is decoded and executed. Instructions are fetched in order in which they are stored in
memory unless changed by a JUMP instruction.
The two special purpose registers within the CPU are: the instruction register and the
program counter. The instruction register holds the instruction being executed. The program
counter contains the address of the next instruction and keeps track of the program’s position.
The CPU performs its job by continually repeating an algorithm known as the machine
cycle. The three steps in machine cycle are fetch, decode, and execute (Figure 2.8). During the
fetch step, the CPU retrieves the instruction from the memory address indicated by the program
counter. Since each instruction is two bytes, two memory cells are fetched. The instruction is
placed in the instruction register, and the program counter is incremented by two so that the
counter contains the address of the next instruction stored in memory.
During decode, the CPU decodes the instruction, which involves breaking the operand
field into its proper components based on the instruction’s opcode.
During execute, CPU executes the instruction by activating the appropriate circuitry to
perform the requested task. Example: For a LOAD instruction, the CPU send signals to memory
and then places data into requested register. For an arithmetic instruction, the CPU activates the
circuitry in ALU, performs the operation and stores the result in appropriate register.
MOHAMMED SALEEM 21
22
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Arithmetic/Logic Instructions
The arithmetic/logic group includes instructions for arithmetic, logic, and shift operations. These
operations are performed by the arithmetic/logic unit.
Logic Operations: The basic logic operations are AND, OR, and XOR. These operations
combine two input bits to produce one output bit. They can also be applied bitwise to two bit
patterns by performing the operation column by column to produce a result pattern as below.
The AND operation is used to place 0s in selected positions without disturbing other bits.
This process is called masking. One operand, called the mask, determines which bits affect the
result. In an AND mask, positions marked with 1 allow bits to pass unchanged, while positions
marked with 0 force the result to 0. AND is used in applications such as filtering colors in digital
images and checking specific bits in a bit map. It can also be used to test whether a particular bit
is 0 or 1 and to change a specific bit to 0 without affecting other bits.
MOHAMMED SALEEM 22
23
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
A major use of the XOR operation is to form the complement of a bit string. XORing any
byte with a mask of all 1s inverts all its bits (1 becomes 0 and 0 becomes 1). XOR is also used to
invert all bits in an RGB bitmap image, producing a negative (inverted color) image where light
colors become dark and dark colors become light.
Rotation and Shift Operations
Rotation and shift operations move bits within a register and are used to solve alignment
problems. These operations are classified by the direction of motion (right or left) and whether
the process is circular.
Right Shift Concept: When a byte is shifted one bit to the right, the rightmost bit falls off and a
hole appears at the leftmost position. The treatment of the fallen bit and the hole distinguishes
different shift operations.
If the bit that falls off at one end is placed into the hole at the other end, the result is circular
shift or rotation. Thus, a right circular shift rotates bits within the register. Performing eight right
circular shifts on an 8-bit pattern restores the original pattern.
If the bit that falls off is discarded and the hole is filled with 0, then the result is logical
shift. A left logical shift corresponds to multiplication by 2, and a right logical shift corresponds
to division by 2.
In signed representations, the sign bit must be preserved. A right shift that fills the hole
with the original sign bit is called an arithmetic shift.
MOHAMMED SALEEM 23
24
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Role of Controllers: Communication between the computer and peripheral devices is handled
by an intermediary device called a controller. A controller may be permanently mounted on the
motherboard or provided as a separate circuit board plugged into a slot. It connects to internal
devices or to external devices through ports. Some controllers have their own memory and simple
CPU to manage device operations.
A controller translates data and messages between the internal format of the computer and
the format required by the peripheral device. Earlier, controllers were designed for specific
devices, so adding a new device often required a new controller.
To improve flexibility, standards such as Universal Serial Bus (USB) and FireWire were
developed. A single USB controller can interface with multiple USB-compatible devices such as
mice, printers, scanners, storage devices, digital cameras, and smartphones.
Each controller is connected to the same bus that connects the CPU and main memory
(Figure 2.13). From this position, the controller monitors signals exchanged between the CPU
and memory and can place its own signals on the bus when required.
With this arrangement, the CPU is able to communicate with the controllers attached to
the bus in the same manner that it communicates with main memory. To send data to a controller,
the CPU first constructs the bit pattern in a general-purpose register. Then an instruction similar
to STORE is executed to place the bit pattern in the controller. To receive data, an instruction
similar to LOAD is used to transfer the bit pattern from the controller to a register.
In some systems, the same LOAD and STORE instructions used for main memory are
also used for controllers. Each controller is assigned a unique set of memory addresses, and main
memory ignores these addresses. When the CPU accesses these addresses, the data is transferred
to or from the controller instead of memory. This technique is called memory-mapped I/O
because input/output devices appear as memory locations.
MOHAMMED SALEEM 24
25
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Direct Memory Access (DMA): Since a controller is connected to the system bus, it can
communicate directly with main memory during the time the CPU is not using the bus. This
ability is called Direct Memory Access (DMA) and improves system performance.
To read a disk sector, the CPU sends a request to the disk controller to read the data and
place it in a specified area of main memory. After issuing the request, the CPU continues
executing other tasks. Meanwhile, the controller transfers the data directly to main memory using
DMA. Thus, the CPU executes programs while the controller manages data transfer
simultaneously. DMA prevents the CPU from being idle during slow data transfers. The
controller handles the transfer between the device and main memory, allowing efficient use of
CPU resources.
DMA increases bus activity. Bit patterns move between CPU & main memory, CPU and
controllers, and controllers and main memory. Coordinating this activity on the bus is a major
design issue. The shared central bus may become a limitation when the CPU and controllers
compete for access. This limitation is called the von Neumann bottleneck, resulting from von
Neumann architecture where the CPU fetches instructions from memory over a single bus.
Handshaking: Data transfer between computer components is not one-way. Even output devices
such as printers send information back to the computer. Since a computer can send data faster
than a printer can print, uncontrolled transfer may cause data loss. Therefore, a two-way dialogue
called handshaking is used to coordinate activities.
In handshaking, the computer and the peripheral device continuously exchange
information about the device’s status. This ensures that data is sent only when the device is ready.
Handshaking uses a status word, which is a bit pattern generated by the peripheral device and
sent to the controller. It is a bit map in which each bit represents a specific condition of the device.
Example: In a printer, one bit may indicate out of paper, another bit may indicate ready for data,
and another bit may indicate a paper jam.
The controller may act on the status word or pass it to the CPU. The status word provides
the mechanism for coordinating communication between the computer and the peripheral device.
Popular Communication Media
Communication between computing devices is handled over two types of paths: parallel and
serial. These terms refer to the manner in which signals are transferred with respect to each other.
Parallel Communication: Parallel communication transfers multiple signals simultaneously,
each on a separate line. It provides high data transfer speed but requires a complex
communication path. A computer’s internal bus is an example, where multiple wires carry data
MOHAMMED SALEEM 25
26
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
and control signals at the same time.
Serial Communication: Serial communication transfers signals one after another over a single
line. It requires a simpler data path and is widely used. USB and FireWire provide high-speed
serial communication over short distances. Ethernet, through wired or wireless connections,
supports serial communication within homes and office buildings.
Telephone Lines and Modems: Traditional voice telephone lines are serial systems that transfer
tones over a single wire. Digital data is transmitted by converting bit patterns into audible tones
using a modem (modulator-demodulator), sending them over the telephone system, and
converting the tones back into bits at the destination.
DSL (Digital Subscriber Line): DSL uses higher frequencies above the audible range on existing
telephone lines to transfer digital data, while lower frequencies remain for voice communication.
Telephone companies are upgrading to fiber optic lines, which support digital communication
more efficiently.
Cable Modems: Cable modems transmit bit patterns over cable television systems by modulating
and demodulating signals. Many providers use fiber optic lines and coaxial cable to deliver
television signals and network access.
Satellite Communication: Satellite links use high-frequency radio broadcast to provide computer
network access, including in remote locations without high-speed telephone or cable networks.
Communication Rates
The rate of data transfer between computing components is measured in bits per second (bps).
Common units are Kbps (10³ bps), Mbps (10⁶ bps), and Gbps (10⁹ bps). A lowercase b denotes bit
and uppercase B denotes byte; 8 Kbps equals 1 KB per second.
For Short Distance Communication, USB 2.0 and FireWire provide transfer rates of
several hundred Mbps, sufficient for multimedia applications. Their high speed, low cost, and
convenience make them suitable for communication between computers and local peripherals
such as printers, external drives, and cameras.
Traditional voice telephone systems, using multiplexing and data compression, supported
up to 57.6 Kbps. This is insufficient for modern multimedia and Internet applications. MP3
playback requires about 64 Kbps, and even low-quality video requires Mbps range transfer rates.
Technologies such as DSL, cable, and satellite links provide transfer rates in the Mbps
range. For example, DSL offers rates around 54 Mbps, replacing traditional telephone-based
communication for high-speed needs.
MOHAMMED SALEEM 26
27
ESSENTIALS OF INFORMATION
TECHNOLOGY – BESC204E
Important Questions:
1. What is gate? Draw the symbol & input/output values of AND, OR, XOR & NOT gates.
2. What is a flip-flop? Explain the working of a simple flip-flop circuit.
3. Explain the organization of a main memory and memory capacity measurements.
4. Explain how different types of information like text, numeric values, images, and sound
are represented as bit patterns in a computer system.
5. Explain the three major categories of machine instructions with suitable examples.
6. What is a machine cycle? Explain the procedure for the execution of computer programs.
7. What is the role of controllers in communication between a computer and other devices?
8. Explain the computer architecture with a block diagram.
9. Explain Logical & Shift operations with examples.
10. Explain the organization of magnetic storage systems, optical storage systems, and flash
drives used for mass storage.
11. Summarize the features of memory-mapped I/O and Direct memory access (DMA).
12. Convert each of the following two’s complement representations to its equivalent base 10
form: a) 00011 b) 11010 c) 01111
13. Compare RISC and CISC architectures.
14. Describe how fractional numbers are stored in computer system.
15. Convert to binary number system: a) 50 b)39 c)81
16. Convert to base 10 number system: a)1101.01 b)110011.101 c)10101010.11
17. Add using 2’s complement notation: a) +2 + (-4) b) -5+(-2) c) -3 + (+6)
MOHAMMED SALEEM 27