0% found this document useful (0 votes)
17 views9 pages

1 Information Representation

Uploaded by

Ebad Ahmed
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)
17 views9 pages

1 Information Representation

Uploaded by

Ebad Ahmed
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
You are on page 1/ 9

Chapter 1

Information Representation
Denary Number Systems:- Number Conversions:-
- Are the the natural number systems
27=128 26=64 25=32 24=16 23=8 22=4 21=2 20=1
- Base 10 means 10 symbols
- 0,1,2,3,4,5,6,7,8,9 0 1 1 0 1 1 0 1
- Least Significant Digit on the Right Hand Side Binary to Denary:-
- 346 is represented by Converting a binary byte (8 bits) 01101101 to Denary by adding the
corresponding values on the first row all the bits that are valued ‘1’.
Binary Number Systems:-
therefore 64+32+8+4+1 = 109
All hardware is manufactured to recognise only two
states i.e. 1 and 0. Denary to Binary:-
- for machine (HW) binary number system is used. converting denary
- it is base 2 means just represented by 1 or 0 246 to binary…results in
- each digit in binary number is referred to as bit. 11110110. à
- all data is represented using binary code. Largest value that a byte
Hexadecimal Number Systems:- can hold is 25510 which
- Documenting computer code (binary) in difficult therefor we means 11111111
can use Hexadecimal to make it more compact and more
understandable.
- Binary data can be converted to hexadecimal. Hex and Binary Conversion:-
- Base 16 means 16 Symbols Each hex digit is treated separately and equivalent to 4 bits
- 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F (nibble).
5 = 0101 6 = 0110 A = 10 = 1010, B = 11= 1011,…F = 15 = 1111
therefore,
4A will be 0100 1010
and 1110 1111 0101 will be E F 5
Negative Binary Numbers:- 0 1 1 0 0 1 1 0 Original Number
The compute can store numbers in either unsigned or
signed. They are both store in the form of bits. If we 1 0 0 1 1 0 0 1 One’s Complement
allocate two bytes 16bits (2bytes) then the range of values
can be 216 – 1 i.e. 0 to 65,535. 1 Two’s Complement

However in the case, of signed integers one bit is used for


1 0 0 1 1 0 1* 0 Resulting Binary Number
representing the + or – sign and the remaining are used to
represent the actual value. The method for achieving the *Bitwise addition 1+1 results in binary 10
signed binary number has the following two steps:- 0 will remain in sum and 1 will be carried.
- One’s complement:-
- Inverting each bit of the original number.
- Two’s complement:- -128 64 32 16 8 4 2 1
- Adding a single “1” at the end of the one’s
complement. 1 0 0 1 1 0 1* 0

*One of the advantages of using two’s complement representations is that it simplifies the process of subtracting one
number from another. The number being subtracted is converted to its two’s complement form, which is then added to
the other number.
Binary Arithmetic: For binary subtraction, starting at the least significant position still applies. The rules for
For binary addition, starting at the least significant the subtraction of binary digits are:
position still applies. The rules for the addition of binary • 0–0=0 10 10
digits are: • 0 – 1 = 1 after a borrow 1 10 10 0
• 0+0= 0 • 1–0=1
• 0+1= 1 • 1–1=0 - 1 0 1 1
• 1+1= 0 with a carry of 1 Consider the an example 0 0 1 1
• 1+1+ 0 = 0 with a carry of 1 When the values in a computer system are stored in two’s complement form
• 1+1+ 1 = 1 with a carry of 1 this problem has a characteristic behaviour.
The last two rules are used when a carried 1 is included in
the addition of two digits.
1 1
Clearly we need the
1 0 1 1 processor to detect
overflow and output an
+ 1 1 1 0
error message.
1 1 0 0 1 Unit 6 Covers the use of
Status Bits.
When binary addition is carried out by a computer
using internally stored numbers there is a major
difference.
This arises from the fact that the storage unit will always
have a defined number of bits.
For example, in the above addition, if binary values
were limited to being stored in a nibble the result of the
addition would be incorrectly stored as 1001.
This is an example of an overflow. The value produced
is too large to be stored.
Binary Coded Decimal (BCD):-
• If single denary digits need to be stored and displayed
then BCD can present an efficient solution.
• 4 bits (nibble) can be used to represent one digit
therefore allowing 16 different options.
For example the number 8503 can be represented by:-

The latter version is known as a Packed BCD


BCD are best used for when numbers are to displayed for
instance on a digital clock or a calculator.
However, Addition in BCD may result in errors for
example:-

The resulting number is 0. 10 and 11…and in denary that is


meaningless (it should result in 1.11)
as BCD only works for single denary numbers. The
solution is adding 0110 to all nibbles (starting from least
significant nibble) and carrying the “carry bit” to the next
nibble.
Internal coding of Text and the ASCII Code:-
• The Scheme which allows for text based
storage in a computer.
• There are other versions of ASCII but the
most common is of 7bits which allows for 27 =
128 different characters.
• Not all codes represent printed characters,
they can also be used for control or non
printing characters. such as NUL =
00000000= Null or SOH = 01 = Start of
Heading.
• This scheme is usually for storing or
displaying English language.
• Codes are in sequence…subsequent codes can
be found by adding 1.
• Extended ASCII uses 8-bit codes (0 to 255 in
denary or 0 to FF in hexadecimal). This gives
another 128 codes to allow for characters in
non-English alphabets and for some graphical
characters to be included:
Unicode:-
• Used for representing any possible text in Character Set:-
code (or Code Point) form i.e. all languages of • The symbols that a computer recognises/uses. A list of characters
the world. recognised by the Computer HW and SW.
• Are added to existing ASCII codes (therefore • Codes 0 to 31 (denary) are control codes.
the first 128 are ASCII)
• They use two to four bytes.
Images:-
Bitmaps:-
Images (either drawn using SW or captured using
Most images are scanned or captures, therefore they may contain geometrically defined shapes.
scanning or photography) can be stored on a
• They are made of pixels (picture elements) which are also the smallest identifiable
computer for displaying on screen or printing.
Vector Graphics:- component of a bitmap.
• An image consisting of components defined by • Pixels are stored as two dimensional matrix of pixels. Each pixel stores info of its location
and colour (colour dept)
geometric formulae and associated properties.
• if colour depth is 1bit then only black and white is allowed. With four bits a greyscale
• Contains a drawing list (set of commands for
colouring can be allowed. at least 8 bits are needed to code a coloured image.
all objects that are part of the image).
• Each command has a list of attributes • the number of pixels in an image i.e. the number of pixels in a row and the number of rows.
that define the properties of an object. this is known as image resolution. for displaying an image it has to be taken into account if
the screen can display the total pixels (screen resolution).
• for example a circle may include info
• the image can be scaled (enlarged) but the number of pixels does not change. therefore over
about centre and radius.
magnification will result in deterioration.
• for other shapes, line thickness, fill
colour…etc. • File size:-
• The most important aspect of vector graphics is • Vectors have smaller file size. Bitmaps have to store pixel data along with headers that
define image resolution and coding scheme for pixel colours.
the fact that the dimensions are not defined of
• file size can be calculated for a 1366 by 768 pixel image with colour depth of 24 by:-
an image in fact images are ”re drawn”
• 1366 * 768 * 24 = 25,178,112 bits (3,147,264 bytes)
according to the size of the canvas. therefore
there is no image distortion or “pixilation” • 3,147,264 / 1024 = 3073.5 kibibytes / 1024 = 3MiB

File Header Contents


• confirmation that the file is a bitmap
• file size
• color depth
• type of compression (if any)
• image resolution
Sound:- Making Use of a Sound Editing Software:-
• Natural sound has variations in pressure. It • Once digital versions of a file have been stored, they can be edited using a sound
contains a large number of waves with varying editing software. Typical features include:-
frequencies. • Combining sound from different sources.
• Sound therefore contains waves with irregular • fading (in or out) of sound.
but continuous pattern. • sound editing for removing noise and other imperfections.
• If sound file has to be stored or transmitted
electronically, it has to be converted into binary
code using the following two steps:-
• band limiting by removing high
frequencies that human ear cannot hear.
• analogue to digital conversion.
Sound Sampling (ADC Conversion):-
• The wave (red line) is to be sampled at regular intervals
(blue lines).
• amplitude (horizontal lines) is approximated.
• the approximation is accurate where it is touching the wave
(intervals 1, 4 and 7).
• whereas it is not so accurate at points 5 and 6 as it is
approximated according to closest defined values.
• Quality of sound depends on two factors
• sampling resolution (bits per sample) which should be
at least 16bits for reasonable accuracy.
• and sampling rate (samples per second)
• 32KHz to 44KHz for MP3, and 8KHz for human
voice
Original Sound High Sampling Rate ½ Sampling Rate

What is the effect of reducing Sampling


Rate:-
• Sound quality will decrease
• size of file will decrease
• sound accuracy will also decrease
• quantisation errors* will also increase
• there will be larger gaps between
samples

*the difference between the analogue signal


1/3 Sampling Rate ¼ Sampling Rate and the closest available digital value at each
sampling instant.

You might also like