0% found this document useful (0 votes)
49 views25 pages

Understanding Data Storage Basics

Uploaded by

naikarbhimu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views25 pages

Understanding Data Storage Basics

Uploaded by

naikarbhimu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Data Storage [EIT]

Chapter 1
DATA STORAGE

1.1 BITS AND THEIR STORAGE


• Computer always understand Binary language & the information is encoded in terms
of 0’s & 1’s pattern.
• These are called as “Bits”.
• The patterns of bits are used to represent numeric values, characters, punctuation
marks, images & also sounds.

BOOLEAN OPERATIONS

• Individual bits are stored as 0's & 1's.


• Bit 0 represents False & Bit 1 represents True.
• The operations that manipulate true or false values are called as “Boolean operations”.
• Basic Boolean Operations
1) AND
2) OR
3) XOR
4) NOT
• These operations are similar to combine arithmetic operations bcz they combine the
pair of values.
• Boolean operations combine true or false values rather than numeric values.

1) AND OPERATION
• The AND operation is used to combine two statements (P&Q) using conjunction
AND.
Ex: Kermit is a frog AND Miss Piggy is an actress.

• The AND operation returns TRUE if and only if all its operands are True.
General form: P AND Q
Symbol: ^
P& Q are inputs.

Conditions:

• The o/p of P AND Q is true only if both P & Q are true.


• In all other cases the o/p is false.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 1


Data Storage [EIT]

Truth Table:

P Q P^Q

0 0 0

0 1 0
1 0 0

1 1 1

2) OR OPERATION
• The OR operation takes two logical inputs and produces an o/p of 1 if at least one of
the i/ps is 1.
• The o/p is 0 only when both i/ps are 0.
General form: P OR Q
Symbol: v
P & Q are inputs.

Condition:

• The OR operation returns TRUE if at least one of its operands is TRUE.

Truth Table:

P Q P^Q

0 0 0

0 1 1
1 0 1

1 1 1

3) XOR OPERATION
• XOR operation gives the o/p 1 if exactly one of its inputs is true (1) & the other is
false (0).
• It outputs 0 if both the i/ps are same i.e 0/1.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 2


Data Storage [EIT]

General form: P XOR Q

Symbol: +

Condition: XOR returns true if exactly one operand is true.

Truth Table:

P Q P XOR Q

0 0 0

0 1 1
1 0 1

1 1 0

4) NOT OPERATION
• NOT operation gives the o/p ie opposite of that i/p.
• If the i/p is true the o/p will be false.
• If the i/p is false the o/p will be true.
• This operation only has one input.
Truth Table:

P Q

0 1

1 0

GATES AND FLIP FLOPS

Gate: A device which produces the o/p of the Boolean operation when we give i/p
values of Boolean operation is called as a Gate.

• Inside computers the gates are implemented as small electronic circuits where the
digits 0 & 1 are represented as voltage levels.
• Here the i/ps are entered on one side & the o/p will be excited on the other side.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 3


Data Storage [EIT]

1) AND GATE
i/ps o/p
i/ps o/p 00 0
01 0
10 0
11 1

2) OR GATE

i/ps o/p i/ps o/p


00 0
01 1
10 1
11 1

3) XOR GATE

i/ps o/p i/ps o/p


00 0
01 1
10 1
11 0

4) NOT GATE

i/ps o/p
– i/ps o/p
0 1
1 0

FLIP FLOPS
• Flip Flop is a fundamental unit of computer memory.
• Flip flops act as building blocks for constructing complex circuits.
• Flip flop is a bistable multivibrator which means it has a stable states (0/1).
• It is a sequential logic circuit that can store 1 bit of information (0/1).
• The o/p of flipflop depends on the current i/p & the previous state because it has
memory.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 4


Data Storage [EIT]

• Multiple flip flops together form the memory & information storage system in
computers.
• I/ps can set or reset the stored value & o/ps are used by other circuits.
• VLSI technology (Very Large Scale Integration) enables millions of flip flops &
circuits on a single chip.
• This chip can even contain an entire computer system.

i/ps o/p
00 0/1
01 0
10 1
11 1

• When we change the upper i/p to 1 & lower i/p to 0. This causes the o/p of the OR
gate to 1 regardless of other i/p to this gate.
• In turn both the i/ps to AND Gate will now be 1. Since the other i/p to this gate is
already 1.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 5


Data Storage [EIT]

Hexadecimal Notation
• Inside a computer, data is handled as patterns of bits (0’s & 1’s).
• The long sequences of bits are called s a Bit stream.
• Bit streams are difficult for humans to read, write & understand.
• To make it easy, we use hexadecimal notation (hex) as shorthand.
• The hexadecimal represents 4 bits with the symbols (0-9 and A-F).
• Note: Every 4 digit= 1 hex digit

Bits Hexadecimal
Representation
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F

Ex:
1) 1011= B
2) 0101= 5
3) 10110101= B5
4) 1010010011001000= A4C8

MAIN MEMORY
Memory:
• Memory is the storage space in a computer where data, instructions & results are
stored either temporarily or permanently.
• It acts as the link between CPU & Storage devices.
• It allows the computer to perform tasks efficiently by providing fast access to
information.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 6


Data Storage [EIT]

Basic types of memory

1) Primary Memory
2) Secondary Memory

Primary Memory Secondary Memory


(Main Memory)

1) Directly accessible memory used by 1) External storage used for permanent


CPU to store data temporarily. data storage

2) Ex: RAM, ROM, Cache, Registers. 2) Ex: SSD, CD, Pendrive etc.

3) RAM- volatile (loses data when power 3) Non volatile, data is retained even
is off) ROM- non volatile after power off.

4) The speed is faster. 4) The speed is slower.

5) Cost per bit is expensive. 5) Cost per bit is cheap.

6) Holds data & instructions currently in 6) Stores data, files, programs


use for processing. permanently for future use.

Main Memory:
Main memory is the working memory of a computer. It stores data & instructions that the
CPU is currently using.

Memory Organisation
• A computer’s main memory is organised in manageable units called “Cells”.
• The typical size of the cell is 8 bits.
• A string of 8 bits is called a Byte.
• Also, the typical memory cells capacity is 1 byte.
• 1 Byte= 8 Bits

Prepared by Anusha.A.N AIML dept, GMIT, DVG 7


Data Storage [EIT]

The Organisation Of Byte Size Memory Cell:

• In the memory the left end of the row is called the high- order end.
• The right end is called the low- order end.
• The left most bit is called as the higher order bit or the most significant bit.
• The right most bit is called as the low order bit or the least significant bit.
How we identify cells:

• To identify the individual cells in a computers main memory, every cell will be
assigned by a unique name called as its “Address”.

EX:

➢ In city how we recognize our houses or the other houses. (Obviously


by the home addresses similarly we do it in memory)

• In case of memory cells, the addresses we use are entirely numeric.


• We place all the cells in a single row and are numbered in the order starting with
value 0.

11101101
Cell n
-
-
-
- Address
10011001
Cell 3
11100011
Cell 2
10001101
Cell 1
10110101 Cell 0
Cells

Memory Cells arranged by Address

Prepared by Anusha.A.N AIML dept, GMIT, DVG 8


Data Storage [EIT]

• Main memory cells & bits inside them are ordered in a sequence like 1 long row of
bits.
• This will allow storage of larger bits pattern by using multiple consecutive cells
[ Ex, 16 bits stored in 2 cells]
• The memory includes circuits for storing & retrieving data.

The memory operations


1) Read: Retrieving contents from a specific memory address.
2) Write: Storing a bit pattern in a cell at a specific address.

RAM

• Memory cells are individually addressable & accessed in any order.


• This random-access feature makes this memory called as RAM.
• RAM differs from mass storage systems (Hard disks) where bits are handled in large
blocks.
• Flipflops can store bits, but modern RAM uses advanced methods for minimizing size
& increasing speed.
• RAM store the bits as tiny electric charges because they dissipate quickly.
DRAM (Dynamic RAM)

• It requires a refresh circuit to repeatedly recharge the stored charges.


• Because of its volatile nature it is called Dynamic RAM (DRAM).
• A special type of RAM called, SDRAM (Synchronous DRAM) is designed for faster
access by synchronizing with system clock.

Measuring Memory Capacity


• In main memory system the total number of cells is measured as power of
2.
• Size of memory = 1024 cell units (210)
1024 ~ 1000 so the prefix kilo is given.

1024 bytes = 1 KB

• A computer with 4096 memory cells was called as 4 KB machine.

4096 = 4 * 1096

Prepared by Anusha.A.N AIML dept, GMIT, DVG 9


Data Storage [EIT]

• As memory became larger, the terminologies grew it includes


1 MB (megabytes) = 1024 KB
1 GB (gigabytes) = 1024 MB
1 TB (terabytes) = 1024 GB

MASS STORAGE
• Due to volatility & limited size of the main memory, most of the computers have
additional memory devices called mass storage.
• Mass storage is also called as Secondary Storage.
• It includes devices like magnetic disks, CDs, DVDs, magnetic tapes, flash drives etc.
• The advantages of mass storage include less volatility, large storage capacity, low
cost etc.
• The main disadvantage of magnetic & optical mass storage system is, they typically
require mechanical motion, so they require more time to store & retrieve data than a
machines main memory.

1) Magnetic Systems

• It is the dominant technology in mass storage from many years.


• The most common example includes magnetic disks or hard disk drives (HDD).
• Magnetic disk (HDDs) uses spinning platters with a magnetic coating to store data.
• Read/ Write heads are positioned above/ below the disk to access information.
• As the disk spins, heads move across circular paths called “Tracks”.
• A set of tracks at the same position on all patterns is called a cylinder.
• Each track is divided into small arcs called sectors, & it stores a fixed amount of
data ie 512 bytes to few KB.
• In basic systems, all the tracks have the same no. of sectors, making the outer tracks
less compact than the inner tracks.
• High-capacity systems use zoned bit recording where outer tracks have more
sectors than inner tracks which are grouped into zones.
• The disk capacity depends on the no. of platters & the density of tracks & sectors.
• The data can be stored on both the upper & lower surfaces of each platter.
• Low-capacity disks may use 1 platter, while high-capacity disks use 3-6 platters &
also hold gigabytes/ terabytes.
• The disk performance is measured using
1) Seek Time: time to move head to track
2) Rotation delay/ Latency time: time for data to rotate under head
3) Access time: Seek+ Delay
4) Transfer rate: speed of reading/ writing data

Prepared by Anusha.A.N AIML dept, GMIT, DVG 10


Data Storage [EIT]

• Transfer rate is higher in outer zones because more data passes under the head per
rotation.
• Disks rotate at high speeds & read/ write heads float above the surface without
touching.
• A head crash occurs if the dust gets between head & disk so the disks are sealed to
prevent contamination.
• Access times are in milliseconds (ms).
• Magnetic Tapes: it stores data on reels of plastic tape with magnetic coating, have
very long seek times, but are cheap & useful for backups.
• Floppy Disks: these are portable single platters with magnetic coating, offers low
density & speed but they are popular before flash drives.

2) Optical Systems:
• Example for optical systems is CD (Compact Disk).
• Optical storage uses laser technology to read/ write data.
• Ex: Compact Disk (CD): These are 12 cm in diameter & consist of reflective
surface with a protective coating.
• Data is stored as irregularities in reflectivity & read by a laser.
• The CD data is stored on a single spiral track from inside to outside.
• The track is divided into sectors, each storing 2 KB of data.
• The data is stored at uniform linear density, so more sectors exist in the outer loops
than inner loops.
• To maintain constant data rate, CD audio players vary rotation speed, but most
computer CDs use constant speed causing variations in transfer rate.
• CDs perform best for continuous data (music) where magnetic disks are better for
random access.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 11


Data Storage [EIT]

• Capacity of CDs: 600- 700 MB


• DVDs use multiple semi-transparent layers, storing several GB (suitable for
movies).
• Blu-ray disks (BDs) use a blue-violet laser, allow finer precision, it stores 5*DVD
capacity (necessary for HD videos).

3) Flash Drives:
• Magnetic & Optical storage require mechanical motion (spinning disks, moving
heads, laser beams) which makes them slower than electronic circuitry.
• Flash memory stores data electronically by trapping electrons in silicon dioxide
chambers which makes it fast, portable & non-volatile.
• Flash Memory retains data for many years without power.
• Data can be read in small-byte sized units but erasing happens in large blocks.
• Repeated erasing damages Silicon Dioxide chambers; limits flash memory’s use as
general main memory.
• Suitable for applications where data rewriting is less frequent, like digital cameras,
smart phones, laptops etc.
• They are resistant to shocks and thus widely used in portable devices.

Flash Drives (USB drives)

• Portable devices with 100’s of GBs capacity.


• Have small plastic cases with a protective cap.
• It is easy to connect/disconnect from computers.
• Not as reliable as optical disks.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 12


Data Storage [EIT]

SSDs (Solid State Drives)

• Designed as replacements for Magnetic Hard disks.


• Advantage: Shock-resistant, Quiet, faster access time.
• More expensive than HDDs.
SD cards (Secure Digital)

• Small wafer like cards for portable devices.


• Storage up to 2GB.
• SDHL (High Capacity): Up to 32GB.
• SDXC (Extended Capacity): Can exceed 1TB.
• Widely used in Cameras, Smartphones, Music players, GPS and other electronics.

Representing Information as Bit Patterns


1) Representing Text
• Text is stored by assigning each symbol (letters, digits, punctuation, etc) a unique
bit pattern and writing those patterns in sequence as a long string of bits.
• Early computers used many different codes (1940s-1950s), causing compatibility
problems.
• ASCII (American Standard Code for Information Interchange) was adopted by
ANSI to standardize text coding.
• ASCII uses 7-bit patterns (0-127) to represent uppercase and lowercase letters,
digits 0-9, punctuation and control characters (Example: tab, linefeed)
• To fit into an 8-bit byte, ASCII is stored as 8 bits by padding a 0 in the MSB.
• We will get the 128 patterns with MSB=1 (values 128-255) which are available for
extended characters in ASCII.
• The 7-bit ASCII set covers values 0-127, the 8-bit representation gives full 0-255
range.
• Example:
1) 01001000= 23+ 26= 8+ 64= 72
2) 01101100= 22+ 23+ 25+ 26= 4+ 8+ 32+ 64= 108

01001000 01100101 01101100 01101100 01101111 00101110

 HELLO

• The ISO family produced extended 8-bit standards to cover major language groups.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 13


Data Storage [EIT]

• Limitations of extended ASCII/ISO


1) Only 128 extra 8-bit patterns are available, which is insufficient for large
alphabets.
2) Different ISO variants target different language groups, so a single 8-bit
standard can’t easily represent text mixing multiple language groups.
• Unicode was developed as a universal solution; Unicode assigns every symbol a
unique code point using up to 21 bits so it can cover most writing systems in the
world.
• UTF-8 is a common way to encode Unicode on disk or in files; it keeps original
ASCII characters as 8 bits and uses longer bit patterns for other characters, allows
many more symbols.
• A file made of symbols encoded with ASCII or Unicode is called a text file.
• Text files contain only characters (one after another) and can be edited with
simple text editors.
• Word processor files (MS Word) also contain text but include extra codes for font,
alignment styles and other formatting.
• Because of these standards, text can be reliably shared and read across different
computers and languages.

2) Representing Numeric values


• Storing numbers as characters (like ASCII codes) is inefficient.
• Example: The number 25 is stored as ASCII takes 16 bits (2 digits = 2 bytes).
• But with 16 bits in binary, we can store numbers from 0-65535.
• So, computers use binary notation for numeric data instead of character codes.
• Binary notation uses only digits 0 and 1 unlike decimals which uses (0-9).

0000
0001
0010
0011
0100
0101
0110
0111
1000

• The largest 16-bit value is 1111111111111111 which is equal to 6553.


• This proves that binary can store much bigger numbers in the same space
compared to ASCII.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 14


Data Storage [EIT]

• Therefore, numeric data is usually stored in binary form for efficiency.


• Computers use variations of binary for different needs:

1) Two’s complement notation => for storing positive and negative whole
numbers.
2) Floating-point notation => for storing numbers with fractions/decimals.

3) Representing images
• An image can be represented as a collection of dots (pixels).
• The collection of pixels forms a bit map.
• Display Devices (Monitors, Printers) operate on pixel concept.
• Bit maps are easy to display but hard to resize.
• Black and White Images:
Each pixel can be represented by 1 Bit (Black or White); Used in fax machines.
• Gray Scale Images:
Each pixel usually uses 8 bits => can represent multiple shades of gray.
• Colour Images:

1) RGB
- Each pixel = 3 components (Red, Green, Blue)
- Each component uses 1 byte => 3 bytes per pixel.

• Bit maps are hard to resize.


• Enlarging pixels makes images blurry.
• Geometric Representation

1) Image can be stored as shapes (lines, curves, text).


2) They are easy to resize without losing clarity.
3) Used in fonts, CAD software for 3D design.

4) Representing Sound Waves.


• Sampling Technique (Basic method of Audio Encoding)

• Sampling means it records the sound wave.


• The most common method to store and process audio in computers is
sampling.
• The usual way is done by taking tiny measurements (samples) of sound wave
at regular time gaps.
• These numbers are saved to represent sound.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 15


Data Storage [EIT]

• Example: 0, 1.5, 2, 1.5 shows how the sound goes up and down.

Telephone Voice Storage


• It takes 8000 samples per second.
• This is enough for normal human speech.
• The samples are sent to the other side then only the voice is rebuilt.
Music Storage (CD)

• Music needs much better quality. So, 44100 samples per second are taken.
• Each sample is stored in 16 bits or 32 bits.
• This means 1 second of music takes more than million bits of storage.
MIDI (Musical Instrument Digital Interface)

• MIDI does not record the sound itself.


• It also records instructions like which instrument to play and which note to play.
• Sampling needs millions of bits for same sound whereas MIDI needs only few
bytes. It saves a lot of space.

Prepared by Anusha.A.N AIML dept, GMIT, DVG 16


Data Storage [EIT]

THE BINARY SYSTEM


Binary Notation
• Decimal (Base 10)
1) It uses digits 0-9
2) Each position is worth 10 times the one to its right.
3) Example: 375
(3*100) + (7*10) + (5*1) = 375
• Binary (Base 2)
• It uses digits 0 and 1 only.
• Each position is worth 2 times the one to its right.
• Positions:
(20) = 1
(21) = 2
(22) = 4
(23) = 8
(24) = 16 etc,
• Example:
1. Binary = 1011
1*1 + 1*2 + 0*4 + 1*8 = 11
i.e 1011 = 11
2. 100101 = 1+4+32 = 37

Algorithm to convert decimal to binary

• Divide the decimal number by 2 & write down the remainder (0 or 1).
• As long as the quotient obtained is not zero, continue to divide the newest quotient by 2
& record the remainder.
• Now that a quotient of 0 has been obtained, the binary representation of the original
value consists of the remainders listed from right to left in the order they were recorded.

Ex: 1) 13 2 13 2) 37 2 37
2 6 -1 2 18 -1
2 3 -0 2 9 -0
1 –1 2 4 -1
2 2 -0
13 = 1101 1 -0

37 = 100101

Prepared by Anusha.A.N AIML dept, GMIT, DVG 17


Data Storage [EIT]

Binary Addition
Rules for binary addition

1) 0 + 0 = 0
2) 0 + 1 = 1
3) 1 + 0 = 1
4) 1 + 1 = 0 (carry 1) = 1 0
5) If three 1’s are added (1 + 1 + 1)
• 1 + 1 + 1 = 1 (carry 1) = 1 1
Ex: 1) 111010 + 11011 = 1010101 3) 111 + 1010 = 10001

1 1 1 1 1

111010 0111

+ 11011 + 1010

1010101 10001

[58 + 27 = 85] [7 + 10 = 17]

2) 1011 + 1101 = 11000

1 1 1

1011
+ 1101
11000

[11 + 13 = 24]

Fractions in Binary
Binary Fraction:

• In decimal we use decimal point, but in binary we use a radix point.


• Left side of radix point = whole number [integer part]
• Right side of radix point = fractionl part

Place values in binary fractions


• On left side (integer part) = powers of 2:---- 23, 22, 21, 20
• On right side (fraction part) = negative powers of 2: 2-1 = 1/2, 2-2 = 1/4, 2-3 = 1/8 -----

Prepared by Anusha.A.N AIML dept, GMIT, DVG 18


Data Storage [EIT]

Ex: 1) 101.101

➢ Integer part = 101


(1*4) + (0*2) + (1*1) = 5
➢ Fraction part = 101
(1*1/2) + (0*1/4) + (1*1/8) = 1/2+1/8 = 5/8
➢ Total= 5 5/8
Addition: 10.011 + 100.110

1 1

10.011

+ 100.110

111.001

Storing Integers
1) Two’s complement notation (most common system for representing positive & negative
integers)
2) Excess (Bias) Notation

1) Two’s Complement Notation


• It is the most popular system for representing integers in computers.
• Every number is represented using a fixed number of bits (Generally 32 bits).
Two’s Complement

1) Bit patterns of length 3


2) Bit patterns of length 4
• Min value = -2(n-1)
• Max value = 2(n-1)-1

Rules for positive integers

• Write the number in binary as usual.


• The bit pattern should fit into the fixed bit length (or else pad the left side bits with
0).
• The left most bit (MSB) must be 0.
Ex: +5 = 0101

Prepared by Anusha.A.N AIML dept, GMIT, DVG 19


Data Storage [EIT]

Rules for negative integers

• Write the positive number in binary.


• Invert all the bits.
• Add 1 to the result.
• Shortcut: Copy from right most bit until first 1 is copied then flip the remaining bits
Ex: 1) -5 2) -3 3) -6

+5 = 0 1 0 1 +3 = 0 0 1 1 +6 = 0 1 1 0

Invert = 1 0 1 0 1100 1001

Add 1 + 1 + 1 + 1
1011 1101 1010

Prepared by Anusha.A.N AIML dept, GMIT, DVG 20


Data Storage [EIT]

Addition in 2’s complement


• Addition works the same way as normal binary notation.
• Numbers must have same fixed number of bits (4 bit, 8 bit, 16 bit, 32 bit
etc).
• If there is a carry beyond the left most bit, it is discarded (truncated).
Ex: Adding 2 positive numbers

1) 3 + 2 = 0 0 1 1
+0010
0 1 0 1 => 5
Adding 2 negative numbers

2) -3 + -2 = 1 1 0 1
+ 1110
1 0 1 1 => -5

Adding positive & negative numbers


1 1 1
3) 7 + (-5) = 0111
+1011
0 0 1 0 => 2
• Here no separate substraction circuit is needed
Ex: Sub 7-5 is treated as 7+(-5)

-5 = 1011 so 0111 + 1011 = 0010

Prepared by Anusha.A.N AIML dept, GMIT, DVG 21


Data Storage [EIT]

Why computers like this


• Humans learn addition & substraction seperately.
• Computers only need
1) An adder circuit
2) A negation circuit (To convert positive to negative)
• Together, these can perform both addition and substraction.

The Problem of Overflow

• Overflow happens when the result of a calculation is too large (or too
small) to fit in the available number of bits.
• In 2’s complement, the range of numbers is fixed
For n bits: from -2(n-1) to 2(n-1)-1
• Example for 4 bit system range is -8 to +7
• If we try 5+4=9, 9 can’t be represented in 4bits. The result appears as
1001, which is 7 (wrong), it is called a overflow error.

How does overflow occur?

• When adding two positive numbers and result looks negative.


• When adding two negative numbers and result looks positive.
• Small systems (4bit, 8bit, 16bit) overflow easily.
• Modern computers usually use 32bits for integers.
• Much larger values can be represented before overflow happens.
• We can handle larger values by using more bits like 64bit integers.
• We can change units of measurements to reduce number size.

2) Excess notation

• It is a another method for representing signed integers in binary.


• Like 2’s complement, all numbers are stored in fixed length bit patterns.
• Here we pick a mid-point i.e. 0, then assign positive numbers above it and
negative numbers below it.

Steps:
1) Choose a bit length (Ex 4bits)
2) List all binary patterns in order (0000 to 1111)
3) Find the mid point (i.e. mid point is the first pattern starting with 1)
4) Assign that pattern to 0.
5) Numbers above it represent positive integers (+1, +2, +3………..)
6) Numbers below it represent negative integers (-1, -2, -3……………)

Prepared by Anusha.A.N AIML dept, GMIT, DVG 22


Data Storage [EIT]

Why we call excess notation?


• Here the stored binary value is always larger than the actual value by a
fixed amount.
• Ex in 4bit system: Bias=8
1) 1100 in binary = 12
But in excess 8 it represents 12-8=4
2) 0000 in binary = 0
But in excess 8 it represents 0-8=-8

Ex: 3bit → Bias = 4, Excess-4 notation


4bit →Bias = 8, Excess-8 notation

5bit → Bias =16, Excess-16 notation

• The difference from 2’s complement is sign-bit, meaning is reversed.


• If MSB is
➢ In 2’s complement → 0= +ve, 1= -ve
➢ In excess notation → 1= +ve, 0= -ve
• This method is common in floating point representation (for exponents).

Prepared by Anusha.A.N AIML dept, GMIT, DVG 23


Data Storage [EIT]

Storing Fractions
Floating point notation:
• Integers are easy to store because they don’t have fractions.
• Fractions like 2.75, 3/8 etc need both the binary digits and the position of the radix point.
• Floating point notation solves this by using a format similar to scientific notation.
• Let us take an ex of 1 byte storage (8bits).
• First designate the MSB (high order bit) of the byte as sign bit.
• Zero in the sign bit means non-negative. One in the sign bit means negative.
• Next we divide the remaining 7bits of byte into 2 groups
➢ Exponent field
➢ Mantissa field
• Then assign the 3 bits following sign bit as exponent field and remaining 4 bits as the
mantissa field.

Ex: 1) 01101011

Consider bit pattern 01101011

➢ By following above steps


Sign bit = 0
Exponent = 110
Mantissa = 1011
➢ First extract the mantissa & place a radix point on its left side i.e

.1011

➢ Extract the contents of exponent field (110) think that it is an integer stored using 3bit
excess method.
110 = 2 (in 3bit excess method)
So we should move the radix point to right by 2 bits.
10.11

Note: In case of negative exponent we move the radix point to left

10.11 = 23/4

Here sign bit is 0, so it is a non negative number & the value stored is
01101011 = 23/4

Prepared by Anusha.A.N AIML dept, GMIT, DVG 24


Data Storage [EIT]

Ex: 2) 00111100

Sign bit = 0

Exponent = 011
Mantissa = 1100

.1100
011 = -1 (3bit excess method)

Move the radix 1bit to the left

.01100
.01100 = 3/8

Here sign bit is 0. So it is a non negative number & the value stored is

00111100 = 3/8

Floating point notation components

➢ To store the values using floating point notation we reverse the above process.

Ex: 1) 1 1/8
➢ Binary notation 1.001
➢ Copy the bit pattern into mantissa field from left to right.
____1001
➢ Here we must move the 1 bit to right from radix to obtain
1.001
➢ The exponent should be +ve so place 101 (in excess 4 notation) in exponent field.
➢ Finally fill the sign-bit by 0 because value stored is non negative.
The value is
01011001

Prepared by Anusha.A.N AIML dept, GMIT, DVG 25

You might also like