0% found this document useful (0 votes)
104 views

APU CSLLT - 2 - Number System Data Presentation

The document discusses how computers represent different types of data internally using binary format. It covers number systems like decimal, binary, octal and hexadecimal and how to convert between them. It also explains the difference between analog and digital data representation and why computers use digital format. Finally, it provides examples of binary conversions between decimal, binary, octal and hexadecimal number systems.

Uploaded by

Ali Atif
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

APU CSLLT - 2 - Number System Data Presentation

The document discusses how computers represent different types of data internally using binary format. It covers number systems like decimal, binary, octal and hexadecimal and how to convert between them. It also explains the difference between analog and digital data representation and why computers use digital format. Finally, it provides examples of binary conversions between decimal, binary, octal and hexadecimal number systems.

Uploaded by

Ali Atif
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Computer System Low- Level Techniques

CT073-3-2

Data Format
Topic & Structure of The Lesson

• General Considerations
• Number systems and Inter-conversion
• Representation of
– Text
– Images
– Sounds
• Data compression techniques
• Internal Computer Data format

CT073-2-3 and CSLLT Data Presentation Slide ‹2› of 39


Learning Outcomes

At the end of this topic, You should be able to


• Understand how data is represented, stored, and
manipulated inside a computer.

• Understand how we represent that data externally for


easier understanding and manipulation by humans

• Understand the similarities and differences in the way


computers represent numerical, character, and image
data

CT073-2-3 and CSLLT Data Presentation Slide ‹3› of 39


Key Terms You Must Be Able To
Use
• If you have mastered this topic, you should be able to use the following
terms correctly in your assignments and exams:

• Decimal
• Binary
• Octal
• Hexadecimal
• ASCII (American Standard Code for Information Interchange)
• EBCDIC (Extended Binary Coded Decimal Interchange Code)
• Unicode

CT073-2-3 and CSLLT Data Presentation Slide ‹4› of 39


Data Formats

• Computers
– Process and store all forms of data in binary format
• Human communication
– Includes language, images and sounds
• Data formats
– Specifications for converting data into computer-usable
form
– Define the different ways human data may be
represented, stored and processed by a computer

CT073-2-3 and CSLLT Data Presentation Slide ‹5› of 39


Computing Systems Data
• Usually the computing systems are
complex devices, dealing with a vast array
of information categories
• The computing systems store, present,
and help us modify:
– Text
– Audio
– Images and graphics
– Video
CT073-2-3 and CSLLT Data Presentation Slide ‹6› of 39
Digital Vs Analog
• Computing systems are finite machines. They store an limited amount
of information, even if the limit is very big.
– The goal, is to represent enough of the world to satisfy our
computational needs and our senses of sight and sound.
– The information can be represented in one or two ways: analog or
digital.
• Analog data is a continuous representation, analogous to the actual
information it represents.
– In example, a mercury thermometer is an analog device. The
mercury rises in a continuous flow in the tube in direct proportion to
the temperature.
• Digital data is a discrete representation, breaking the information up
into separate (discrete) elements.
– Computers can’t work with analog information, so a need do
digitize the analog information arise. This is done by breaking the
analog information into pieces and representing those pieces using
binary digits
CT073-2-3 and CSLLT Data Presentation Slide ‹7› of 39
Digital vs. Analog (cnt.)
• Why digital signal?
– Both electronic signals (analog and digital) degrade as
they move down a line. The voltage of the signal
fluctuates due to environmental effects.
– As soon as an analog signal degrades, information is lost.
Since any voltage level within the range is valid, it is
impossible to know that the original signal was even
changed
– Digital signals jump sharply between two extremes (high
and low state). A digital signal can degrade quite a bit
until the information is lost, because any value over a
certain threshold is considered high value and bellow the
threshold is considered low value
CT073-2-3 and CSLLT Data Presentation Slide 8› of 39
Digital vs. Analog (cnt.)
• You can still retrieve the information from a reasonably
degraded digital signal
• Periodically a digital signal is reclocked to regain its
original shape. As long as it is reclocked before too much
degradation, no info is lost.

1 1 Threshold
1 1 1 1 1 1
0 0 0 0 0 0 0 0
Digital Signal
Digital Signal Degradation

Analog Signal Analog Signal Degradation


CT073-2-3 and CSLLT Data Presentation Slide ‹9› of 39
Binary Representation

Why binary representation (as suppose to decimal


or octal, etc..)?
Because the devices that store and manage the
digital data are far less expensive and complex
for binary representation.
They are also far more reliable when they have
to represent one out of two possible values.
Because the electronic signals are easier to
maintain if they carry only binary data.

CT073-2-3 and CSLLT Data Presentation Slide ‹10› of 39


Binary Representation (cnt.)

• One bit can be either 0 or 1. Therefore, one bit can


represent only two outputs.
• To represent more than two outputs, we need
multiple bits. Two bits can represent four outputs
because there are four combinations of 0 and 1 that
can be made from two bits: 00, 01, 10,11.
• In general, n bits can represent 2n outputs
because there are 2n combinations of 0 and 1 that
can be made from n bits. Note that every time we
increase the number of bits by 1, we double the
number of things we can represent.

CT073-2-3 and CSLLT Data Presentation Slide ‹11› of 39


Binary Conversion

• Decimal to Binary
2510 = 1 10012

4510 = 1001 00012

210 = 102

• Binary to Decimal
1111 00002 = 24010

11112 = 1510
CT073-2-3 and CSLLT Data Presentation Slide ‹12› of 39
Binary Conversion (cnt.)

• Octal to Binary
258 = 010 1012

1458 = 001 100 1012

28 = 0102

• Binary to Octal
1111 00002 = 3608

11112 = 178
CT073-2-3 and CSLLT Data Presentation Slide ‹13› of 39
Binary Conversion (cnt.)

• Hexadecimal to Binary
2516 = 0010 01012

14516 = 0001 0100 01012

216 = 00102

• Binary to Hexadecimal
1111 00002 = F016

11112 = F16
CT073-2-3 and CSLLT Data Presentation Slide ‹14› of 39
Binary Conversion (cnt.)

• 2’s Complement
+2510 = 1 10012

-2510 = ?

1 10012 (+25)
0 01102 (flip the digits)
+ 1 (add 1)
0 0111

CT073-2-3 and CSLLT


-2510 = 0 01112 Data Presentation Slide ‹15› of 39
Binary Conversion (cnt.)

Binary Decimal Octal Hexadecimal


0000 0000 0 0 0
0000 0001 1 1 1
0000 0010 2 2 2
0000 0011 3 3 3
0000 0100 4 4 4
0000 0101 5 5 5
0000 0110 6 6 6
0000 0111 7 7 7
CT073-2-3 and CSLLT Data Presentation Slide ‹16› of 39
Binary Conversion (cnt.)

Binary Decimal Octal Hexadecimal


0000 1000 8 - 8
0000 1001 9 - 9
0000 1010 10 - A
0000 1011 11 - B
0000 1100 12 - C
0000 1101 13 - D
0000 1110 14 - E
0000 1111 15 - F
CT073-2-3 and CSLLT Data Presentation Slide ‹17› of 39
Quick Review Questions
1. How many bits will it take to represent the
decimal number 3,875,216? How many bytes will
it take to store the number?

2. Convert to Binary Base


(a) 3578 =
(b) EACB16 =
(c) 17210 =

3. Convert to Hexadecimal Base


(a) 53110 =
(b) 3138 =
(c) 1101111001102 =

4. Find the solution for the problems below (apply 2’s if


necessary)
(a) 3110 + 1110 =
(b) 4510 - 1110 =
(c) 2510 - 1510 =

CT073-2-3 and CSLLT Data Presentation Slide ‹18› of 39


TEXT: Alphanumeric Data

• Three standards for representing letters


(alpha) and numbers
– ASCII – American Standard Code for
Information Interchange
– EBCDIC – Extended Binary-Coded Decimal
Interchange Code (not used anymore, used to
be used in IBM mainframes)
– Unicode

CT073-2-3 and CSLLT Data Presentation Slide ‹19› of 39


Text: Codes and Characters

• The problem:
– Representing text strings, such as
“Hello, world”, in a computer
• Each character is coded as a byte ( = 8
bits)
• Most common coding system is ASCII
• ASCII = American National Standard Code
for Information Interchange
• Defined in ANSI document X3.4-1977

CT073-2-3 and CSLLT Data Presentation Slide ‹20› of 39


ASCII Features

• 7-bit code
• 8th bit is unused (or used for a parity bit)
• 27 = 128 codes
• Two general types of codes:
– 95 are “Graphic” codes (displayable on a
console)
– 33 are “Control” codes (control features of the
console or communications channel)

CT073-2-3 and CSLLT Data Presentation Slide ‹21› of 39


ASCII Reference Table
Most significant bit
000 001 010 011 100 101 110 111
0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL

Least significant bit


CT073-2-3 and CSLLT Data Presentation Slide ‹22› of 39
ASCII Reference Table
000 001 010 011 100 101 110 111
0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL

i.e. ‘a’ = 11000012 = 9710 = 6116


CT073-2-3 and CSLLT Data Presentation Slide ‹23› of 39
ASCII Reference Table
000 001 010 011 100 101 110 111
0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL

95 Graphic codes
CT073-2-3 and CSLLT Data Presentation Slide 24› of 39
ASCII Reference Table

000 001 010 011 100 101 110 111


0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL

33 Control
CT073-2-3 and CSLLT
codes
Data Presentation Slide ‹25› of 39
ASCII Reference Table

000 001 010 011 100 101 110 111


0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL

Alphabetic
codes
CT073-2-3 and CSLLT Data Presentation Slide ‹26› of 39
“Hello, world Example
Binary Hexadecimal Decimal
H = 01001000 = 48 = 72
e = 01100101 = 65 = 101
l = 01101100 = 6C = 108
l = 01101100 = 6C = 108
o = 01101111 = 6F = 111
, = 00101100 = 2C = 44
= 00100000 = 20 = 32
w = 01110111 = 77 = 119
o = 01100111 = 67 = 103
r = 01110010 = 72 = 114
l = 01101100 = 6C = 108
d = 01100100 = 64 = 100
Note: 12 characters – requires 12 bytes
Each character requires 1 byte
CT073-2-3 and CSLLT Data Presentation Slide ‹27› of 39
ASCII Reference Table
000 001 010 011 100 101 110 111
0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL

Numeric
CT073-2-3 and CSLLT
codes
Data Presentation Slide ‹28› of 39
“4+15” Example

Binary Hexadecimal Decimal


4 = 00110100 = 34 = 52
+ = 00101011 = 2B = 43
l = 00110001 = 31 = 49
5 = 00110101 = 35 = 53

“4+15” is “00110100 00101011 00110001 00110101”


or “34162B1631163516”

CT073-2-3 and CSLLT Data Presentation Slide ‹29› of 39


ASCII Reference Table
000 001 010 011 100 101 110 111
0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL

Punctuation, etc.
CT073-2-3 and CSLLT Data Presentation Slide ‹30› of 39
Common Control Codes

• CR 0D carriage return
• LF 0A line feed
• HT 09horizontal tab
• DEL 7F delete
• NULL 00null

CT073-2-3 and CSLLT Data Presentation Slide ‹31› of 39


ASCII Reference Table

000 001 010 011 100 101 110 111


0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL

CT073-2-3 and CSLLT Data Presentation Slide ‹32› of 39


Escape Sequences

• Extend the capability of the ASCII code set


• For controlling terminals and formatting output
• Defined by ANSI in documents X3.41-1974 and X3.64-
1977
• The escape code is ESC = 1B
16

ESC

1B16

CT073-2-3 and CSLLT Data Presentation Slide ‹33› of 39


Unicode

• The extended version of the ASCII character set


is not enough for international use.
• The Unicode character set uses 16 bits per
character. Therefore, the Unicode character set
can represent 216, or over 65 thousand,
characters.
• Unicode was designed to be a superset of ASCII.
That is, the first 256 characters in the Unicode
character set correspond exactly to the extended
ASCII character set.

CT073-2-3 and CSLLT Data Presentation Slide ‹34› of 39


Unicode (cnt.)

• Version 2.1
– 1998
– Improves on version 2.0
– Includes the Euro sign (20AC16 = )
– From the standard:
• …contains 38,887 different coded characters derived from
the supported scripts. These characters cover the principal
written languages of the Americas, Europe, the Middle East,
Africa, India, Asia, and Pacifica.
• Latest version of Unicode is 4.0
http://www.unicode.org

CT073-2-3 and CSLLT Data Presentation Slide ‹35› of 39


Quick Review Question

1.What is the difference between ASCII and


EBCDIC ?
2.What is UNICODE?
3.Why Binary number system is used in
computers?

CT073-2-3 and CSLLT Data Presentation Slide ‹36› of 39


Follow Up Assignment
• Group discussion about data format

CT073-2-3 and CSLLT Data Presentation Slide ‹37› of 39


Summary of Main Teaching Points

• Data must be converted from its native format into form


understood by processing device in order to be
processed by the CPU
• All data represented within a modern computer system
as strings of binary digits, or bits
• Each bit string has a specific data format & coding
method
• Numeric data stored using integer, real number, floating
point formats.
• Characters converted to numbers via coding table.

CT073-2-3 and CSLLT Data Presentation Slide ‹38› of 39


Question and Answer Session

Q&A

CT073-2-3 and CSLLT Data Presentation Slide ‹39› of 39


What we will cover next

Logic Gates

CT073-2-3 and CSLLT Data Presentation

You might also like