Lecture 3 ISE101: Computing Fundamentals Lecture Slides Courtesy of Samin Khaliq, DOC, SEECS
Today’s Lecture • Data representation - Decimal Number System - Binary Number System
Binary
Decimal Numbering System • Normally, we count things in base 10. • The only reason that people have traditionally used base 10 is that they have 10 fingers, which have made handy counting tools. • 0123456789(Total10)
Decimal Numbering System • The number 532 in decimal (base 10) is = (5 * 102) + (3 * 101) + (2 * 100) = 500 + 30 + 2 = 532
Units of measurement for digital information • We count in base 10 by powers of 10 - 101 = 10 - 102 = 10*10 = 100 - 103 = 10*10*10 = 1,000 - 106 = 1,000,000 • Computers count by base 2 - 21 = 2 - 22 = 2*2 = 4 - 23 = 2*2*2 = 8 - 210 = 1,024 - 220 = 1,048,576
Binary
Binary Numbering System • The number 101 in binary (base 2) is = (1 * 22) + (0 * 21) + (1 * 20) = 4 + + 1 = 5 • Binary to decimal
Bits and bytes Binary digits - Bits ( 0 or 1) A byte comprises of 8 bits and represents 1 character
Units of measurement for digital information Equivalent •1 kilobyte (KB) 1,024 bytes 1,048,576 bytes 1,073,741,824 bytes •1 megabyte (MB) •1 gigabyte (GB) •1 terabyte (TB) 1,099,511,627,776 bytes •1 petabyte (PB) 1,125,899,906,842,624 bytes
Data Representation • Standard text code • Letters, numbers, punctuation marks and special symbols are represented within a computer by binary coding schemes 1. EBCIDIC (Extended Binary Coded Decimal Interchange Code) 2. ASCII (American Standard Code for Information Interchange) 3. Unicode (Unicode Worldwide Character Standard) • By standardizing the values used for these characters, text codes enable computers and computer programs to exchange information.
1. EBCIDIC • 8-bit code that defines 256 symbols • Used in IBM mainframe and midrange systems • Rarely encountered in personal computers
2. ASCII • Most commonly used in computers of all types • 7 bit code that specifies characters for values from 0 to 127 • Extended ASCII - 8-bit code that specifies the characters for values from 128 to 255 - First 40 symbols represent characters from foreign languages and graphic symbols
3. Unicode • 32 bits to represent each letter, number or symbol • Can represent more than 4 billion different characters and symbols - Vast Chinese, Korean and Japanese - Classical and historical texts - Maths and scientific symbols • Compatibility with ASCII codes - First 256 codes are identical to the 256 codes of ASCII and Extended ASCII systems
ASCII Table
Printable ASCII characters • The 95 printable ASCII characters, numbered from 32 to 126 (decimal)
Summary • Computers represent data in bits • Data coding - EBCDIC - ASCII - Unicode