0% found this document useful (0 votes)
29 views22 pages

Lec 16 Computer Codes - Updated - Arsalan

Computers represent all data digitally as strings of 1s and 0s at the bit level. Letters, numbers, images and sounds are converted to binary code. Bytes (strings of 8 bits) are used to represent individual characters. Common encoding schemes include ASCII, Unicode, and EBCDIC. Quantities of bits and bytes are measured in kilobytes, megabytes and gigabytes to describe data and storage sizes.

Uploaded by

Jam Hassan
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)
29 views22 pages

Lec 16 Computer Codes - Updated - Arsalan

Computers represent all data digitally as strings of 1s and 0s at the bit level. Letters, numbers, images and sounds are converted to binary code. Bytes (strings of 8 bits) are used to represent individual characters. Common encoding schemes include ASCII, Unicode, and EBCDIC. Quantities of bits and bytes are measured in kilobytes, megabytes and gigabytes to describe data and storage sizes.

Uploaded by

Jam Hassan
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/ 22

‫هللا الرَّ ْح ٰم ِن الرَّ ِح ْي ِم‬

‫ِب ْس ِم ِ‬
INTRODUCTION TO INFORMATION AND
COMUNICATION TECHNOLOGY
Data Representation (Computer Codes)
Lecture # 17
Data Types
• Numeric Data consists of only numbers 0, 1, 2, …, 9

• Alphabetic Data consists of only the letters A, B, C,


…, Z in both uppercase and lower case, and blank
character.

• Alphanumeric Data is a string of symbols where a


symbol may be one of the letters A, B, C, …, Z in
either uppercase or lowercase, or one of the digits 0,
1, 2, …, 9 or a special character, such as + - * / , . ( = )
# etc…
Data Representation: How do computers
represent data digitally?
• Computers store data in digital format as a series of
1s and 0s (known as binary code)
– Each 1 and 0 is called a bit
– Eight bits is called a byte

• The term bit comes from “binary digit”

• Bytes are used to represent one character – a letter,


number, or punctuation mark
– For example, the letter H is represented in binary code as
01001000
– An exclamation point (!) is 01000001
Data Representation: How do computers
represent data digitally?
• Digital data is made up of discrete numbers, with
each bit being either a 1 or a 0 – it’s either on or off,
nowhere in between

• Analog data is made up of a continuous wave of


information, with varying degrees in between
• For example:
– A digital clock changes it’s digital display
once every minute to show the time
– An analog clock is continually moving it’s
second, minute and hour hands to show
the time
How Computers Represent Data
• Computer processing is performed by transistors,
which are switches with only two possible states: on
and off.

• All computer data is converted to a series of binary


numbers– 1 and 0. For example, you see a
sentence as a collection of letters, but the computer
sees each letter as a collection of 1s and 0s.

• If a transistor is assigned a value of 1, it is on. If it


has a value of 0, it is off. A computer's transistors
can be switched on and off millions of times each
second.
Ten different
symbols in
the decimal
system

Numbers above 9
use more than 1 digit
1 01 10 1 01 01 1 01
Data Representation: How do computers
represent data digitally?
• Data representation makes it possible to convert
letters, sounds, and images into electrical signals.

• Digital electronics makes it possible for computer to


manipulate simple “on” and “off” signals to perform
complex tasks.
How can a computer represent numbers?
• Unlike the decimal system (base 10), the binary number
system (base 2) uses only two digits: 0 and 1

• The following table lists some


decimal numbers and their
binary equivalent:
How can a computer represent words
and letters using bits?
• Character data is composed of letters, symbols, and
numbers that will not be used in arithmetic
operations
– Numeric data is used in arithmetic calculations, and is
encoded differently
• ASCII (American Standard Code for Information
Interchange) requires only 7 bits for each character
• Extended ASCII uses 8 bits for each character. Used in
most personal computers
– See the code on the next slide
How can a computer represent words
and letters using bits?
How can a computer represent words
and letters using bits?
• EBCDIC (Extended Binary-Coded Decimal
Interchange Code) is an alternative 8-bit used
by older IBM systems.

• Unicode uses 16 bits and provides codes for


65,000 characters – a bonus for representing
alphabets of multiple languages
– Used for foreign language support
BCD
• BCD stands for Binary Coded Decimal.
• It is one of the early computer codes.
• It uses 6 bits to represent a symbol.
• It can represent 64(2⁶) different characters.
• Example:
A = 110001
7= 000111
EBCDIC
• EBCDIC stands for Extended Binary Coded
Decimal Interchange Code.
• It uses 8 bits to represent a symbol.
• It can represent 256(2⁸) different characters.
• Example
A = 11000001
7 = 11110111
ASCII
• ASCII stands for American Standard Code for
Information Interchange.
• ASCII is of two types – ASCII-7 and ASCII-8
• ASCII-7 uses 7 bits to represent a symbol and It can
represent 128(2⁷) different characters.
• ASCII-8 uses 8 bits to represent a symbol and It can
represent 256(2⁸) different characters.
• First 128 characters in ASCII-7 and ASCII-8 are same.
• Example
In both ASCII-7 and ASCII-8, coding scheme for 128
characters is same.
A = 01000001
7 = 00110111
Unicode
• It uses 16 bits to represent a symbol.
• It can represent 65000(2ⁱ⁶) different
characters.
• Represent alphabet of different multiple
languages.
How does a computer convert sounds
and pictures into codes?
• Sounds and pictures must be transformed into
a format the computer can understand.

• A computer must digitize colors, notes, and


instrument sounds into 1s and 0s.

• For example, a red dot on your screen might


be represented by 1100, a green dot by 1101.
Quantifying Bits and bytes: How can I tell
the difference between bits and bytes?
• A bit is one binary digit (b)
– Eg. 0, 1

• A byte is 8 bits (B)


– Eg. 0010 0100

• A nibble is 4 bits
– Eg. 0011
Quantifying Bits and bytes: How can I tell
the difference between bits and bytes?
• Prefixes
– Kilo- means a 1000
– Mega- means million
– Giga- means billion

• Kilobyte (KB) is approx. 1,000 bytes (1,024)


• Megabyte (MB) is approx. 1,048,576 bytes (1,024 KB)
• Gigabyte (GB) is approx. 1,073,741,824 bytes (1,024 MB)
Example
In the lab…
1. Double click on My Computer
2. Right click on C:
3. Click on Properties

/ 230 =
Exercise – Free Space
• Determine the “free space” on all drives on
your machine

Free space
Drive Bytes GB
A:
C:
D:
E:
etc.

You might also like