Module 1
Chapter1
Data Storage
• Bits and Their Storage
• Main Memory
• Mass Storage
• Representing Information as Bit Patterns
• The Binary System
• Storing Integers
• Storing Fractions
Bits and Their Storage
• Inside today’s computers information is encoded as patterns of 0s and
1s. These digits are called bits.
• patterns of bits are used to represent numeric values; sometimes they
represent characters in an alphabet and punctuation marks.
• Boolean Operations
• Operations that manipulate true/false values are called Boolean
operations.
• Three of the basic Boolean operations are AND, OR, and XOR
(exclusive or).
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.
• Gates can be constructed from a variety of technologies such
as gears, relays, and optic devices.
• Inside today’s computers, gates are usually implemented as
small electronic circuits in which the digits 0 and 1 are
represented as voltage levels.
• Gates provide the building blocks from which computers are
constructed.
• Collection of circuits is known as flip-flop.
• A flip-flop is a fundamental unit of computer memory.
• It is a circuit that 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.
• Many flip-flops constructed as very small electrical
circuits, can be used inside a computer as a means of
recording information that is encoded as patterns of 0s
and 1s. Indeed, technology known as very large-scale
integration (VLSI)
Hexadecimal Notation
• A long string of bits is often called a
stream.
• Streams are difficult for the human
mind to comprehend(remember).
• To simplify the representation of such
bit patterns, therefore, we usually use a
shorthand notation called hexadecimal
notation. (fact that bit patterns within a
machine tend to have lengths in
multiples of four)
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.)
• To identify individual cells in a computer’s main memory, each cell is assigned a
unique “name,” called its address.
• The ability to access cells in any order, a computer’s main memory is often called
random access memory (RAM).
Measuring Memory Capacity
• The total number of cells is a power of two.
• In early computers were often measured in 1024 (which is 210) cell units.
• Term kilobyte (abbreviated KB) was used to refer to 1024 bytes.
• Thus, a machine with 4096 memory cells was 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 a computer’s 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.
• Advantages: Less volatility, large storage capacities, low cost, and in many cases,
the ability to remove the storage medium from the machine for archival
purposes.
• Dis-advantages: Magnetic and optical mass storage systems is that they typically
require mechanical motion and therefore require significantly more time to store
and retrieve data.
Magnetic Systems
• Magnetic disk or hard disk drive (HDD), in which a thin spinning disk with
magnetic coating is used to hold data.
• 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.
• Each time the read/write heads are repositioned, a new set of tracks—which is
called a cylinder—becomes accessible.
• Since a track can contain more information than we would normally want
to manipulate at any one time, each track is divided into small arcs called
sectors on which information is recorded as a continuous string of bits.
• All sectors on a disk contain same number of bits(512 bytes), each track contains the same
number of sectors.
• 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,
• Several measurements are used to evaluate a disk system’s performance:
1. Seek Time: The time required to move the read/write heads from one track to another
2. Rotation delay or latency time : Half the time required for the disk to make a complete
rotation, which is the average amount of time required for the desired data to rotate around to
the read/write head once the head has been positioned over the desired track.
3. Access time :the sum of seek time and rotation delay
4. Transfer rate :The rate at which data can be transferred to or from the disk.
Optical Systems
• An example is the compact disk (CD).
• These disks are 12 centimeters (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 these CDs is stored on a single track that spirals around the CD like a groove in an
old-fashioned phonograph record.
• This track is divided into units called sectors, each with its own identifying markings and a
capacity of 2KB of data, which equates to 1/75 of a second of music in the case of audio
recordings.
• To maximize the capacity of a CD, information is stored at a
uniform linear density over the entire spiraled track, which
means that more information is stored in a loop around
the outer portion of the spiral than in a loop around the
inner portion.
• Traditional CDs have capacities in the range of 600 to
700MB.
• DVDs (Digital Versatile Disks), which are constructed from
multiple, semi-transparent layers that serve as distinct
surfaces when viewed by a precisely focused laser, provide
storage capacities of several GB.
• Blu-ray technology, which uses a laser in the blue-violet
spectrum of light (instead of red).
• BDs (Blu-ray Disks) provides over five times the capacity of
a DVD.
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.
• Current technology dictates that stored data be erased in large blocks.
• Moreover, repeated erasing slowly damages the silicon dioxide chambers, meaning that current flash memory
technology is not suit able for general main memory applications.
• However, in those applications in which alterations can be controlled to a reasonable level, such as in digital
cameras and smartphones it can be used.
• Larger flash memory devices called SSDs (solid-state disks) are explicitly designed to take the place of
magnetic hard disks.
• SSDs remain more expensive than hard disks of comparable size and thus are still considered a high-end
option when buying a computer.
• SD (Secure Digital) memory cards (or just SD Card):These provide up to two GBs of storage and are packaged in
a plastic rigged wafer about the size a postage stamp.
• SDHC (High Capacity) memory cards can provide up to 32 GBs and the next generation SDXC (Extended
Capacity) memory cards may exceed a TB.
Representing Information as Bit
Patterns
• Representing Text: American Standard Code for Information Interchange
• 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.
• Dis-advantages:
1. The number of extra bit patterns available in extended ASCII is simply insufficient to
accommodate the alphabet of many Asian and some Eastern European languages.
2. Documents containing text of languages from disparate language groups could not be
supported.
• Hence Unicode Transformation Format 8-bit (UTF-8) was developed.
• A file consisting of a long sequence of symbols encoded using ASCII or Uni-code is often
called a text file.
• Simple text files that are manipulated by utility programs called text editors.
Representing Numeric Values
• Any integer in the range from 0 to 65535 in these 16 bits using binary notation.
• Binary notation is a way of representing numeric values using only the digits 0 and 1 rather than
the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 as in the traditional decimal, or base 10, system.
• Consider an old-fashioned car odometer whose display wheels contain only the digits 0 and 1
rather than the traditional digits 0 through 9.
• 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 with fractional parts such as 4-1/2 or 3/4, another technique, called
floating-point notation.
Representing Images
• One means of representing an image is to interpret the image as a collection of dots, each of which
is called a pixel, short for “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.
• In the case of a simple black-and-white image, each pixel can be represented by a single bit whose
value depends on whether the corresponding pixel is black or white.
• In the case of color images, each pixel is encoded by more complex system. Two approaches are
common:
1. RGB encoding: Each pixel is represented as three color components—a red component, a green
component, and a blue component—corresponding to the three primary colors of light. One byte
is normally used to represent the intensity of each color component. In turn, three bytes of
storage are required to represent a single pixel in the original image.
2. “Brightness” component and Two color components: In this case the “brightness”
component, which is called the pixel’s luminance, is essentially the sum of the red, green,
and blue components.
• The other two components, called the blue chrominance and the red chrominance, are
determined by computing the difference between the pixel’s luminance and the amount
of blue or red light, respectively, in the pixel. Together these three components contain
the information required to reproduce the pixel.
• Disadvantage of representing images as bit maps is that an image cannot be rescaled
easily to any arbitrary size. Essentially, the only way to enlarge the image is to make the
pixels bigger, which leads to a grainy appearance.
• An alternate way of representing images that avoids this scaling problem is to describe
the image as a collection of geometric structures, such as lines and curves, that can be
encoded using techniques of analytic geometry.
Representing Sound
• The most generic method of encoding audio information for computer
storage and manipulation is to sample the amplitude of the sound
wave at regular intervals and record the series of values obtained.
• This technique, using a sample rate of 8000 samples per second, has
been used for years in long-distance voice telephone communication.
• The voice at one end of the communication is encoded as numeric
values representing the amplitude of the voice every eight-thousandth
of a second.
• These numeric values are then transmitted over the communication
line to the receiving end, where they are used to reproduce the sound
of the voice.
• Musical Instrument Digital Interface (MIDI, pronounced “MID–ee”) is
widely used in the music synthesizers found in electronic keyboards, for
video game sound, and for sound effects accompanying websites.
The Binary System
• It is a means of representing numeric values using only the digits 0
and 1 rather than the 10 digits 0 through 9.
Binary Addition
Fractions in Binary
• To extend binary notation to accommodate fractional values, we use a radix point in the same
role as the decimal point in decimal notation.
• To extend binary notation to accommodate fractional values, we use a radix point in the same
role as the decimal point in decimal notation.
• To extend binary notation to accommodate fractional values, we use a radix point in the same
role as the decimal point in decimal notation.
Storing Integers
• Two’s Complement Notation:
• Note that in a two’s complement system, the
leftmost bit of a bit pattern indicates the sign of the
value represented. Thus, the leftmost bit is often
called the 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.
Representation of negative number
• We merely copy the original pattern from right to left until a 1 has
been copied, then we complement the remaining bits as they are
transferred to the final bit pattern.
Addition in 2’s Compliment
• To add values represented in two’s complement notation, we apply the same algorithm that we
used for binary addition, except that all bit patterns, including the answer, are the same length.
This means that when adding in a two’s complement system, any extra bit generated on the left
of the answer by a final carry must be truncated.
Problem of Overflow
• One problem we have avoided in the preceding examples is that in any two’s complement system
there is a limit to the size of the values that can be represented.
• When using two’s complement with patterns of 4 bits, the larg est positive integer that can be
represented is 7, and the most negative integer is -8.
• In particular, the value 9 cannot be represented, which means that we cannot hope to obtain the
correct answer to the problem 5 + 4. In fact, the result would appear as -7. This phenomenon is
called overflow.
• That is, overflow is the problem that occurs when a computation produces a value that falls
outside the range of values that can be represented. When using two’s complement notation, this
might occur when adding two positive values or when adding two negative values.
• In either case, the condition can be detected by checking the sign bit of the answer. An overflow
is indicated if the addition of two positive values results in the pattern for a negative value or if
the sum of two negative values appears to be positive.