APU CSLLT - 2 - Number System Data Presentation
APU CSLLT - 2 - Number System Data Presentation
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
• Decimal
• Binary
• Octal
• Hexadecimal
• ASCII (American Standard Code for Information Interchange)
• EBCDIC (Extended Binary Coded Decimal Interchange Code)
• Unicode
• 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
1 1 Threshold
1 1 1 1 1 1
0 0 0 0 0 0 0 0
Digital Signal
Digital Signal Degradation
• Decimal to Binary
2510 = 1 10012
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
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
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
• 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
• 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)
95 Graphic codes
CT073-2-3 and CSLLT Data Presentation Slide 24› of 39
ASCII Reference Table
33 Control
CT073-2-3 and CSLLT
codes
Data Presentation Slide ‹25› of 39
ASCII Reference Table
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
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
ESC
1B16
• 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
Q&A
Logic Gates