D ATA REPRESENTATION, BINARY SYSTEM, B IT, B YTE, ASCII C ODE Chapter 3 Mr.Mohammed Rahmath
D ATA R EPRESENTATION Data Representation refers to the methods used internally to represent information stored in a computer. Computers store lots of different types of information: numbers text graphics of many varieties (stills, video, animation) sound Mr.Mohammed Rahmath
M EMORY S TRUCTURE IN C OMPUTER Memory consists of bits (0 or 1) – a single bit can represent two pieces of information bytes (=8 bits) – a single byte can represent 256 = 2x2x2x2x2x2x2x2 = 2 8 pieces of information words (=2,4, or 8 bytes) – a 2 byte word can represent pieces of information (approximately 65 thousand). Byte addressable - each byte has its own address. Mr.Mohammed Rahmath
B INARY SYSTEM binary numeral system, or base-2 numeral system, represents numeric values using two symbols: 0 and 1. More specifically, the usual base -2 system is a positional notation with a radix of 2. Numbers represented in this system are commonly called binary numbers. Bits: A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single binary value, either 0 or 1. Byte: a byte is a unit of data that is eight binary digits long. A byte is the unit most computers use to represent a character such as a letter, number, or typographic symbol (for example, "g", "5", or "?"). Mr.Mohammed Rahmath
ASCII CODE Mr.Mohammed Rahmath Binary (2)Decimal (10)Octal (8) Hexadecimal (16) 0000'0000'0000' 0001'1001'0001' 0010'2010'0010' 0011'3011'0011' 0100'4100'0100' 0101'5101'0101' 0110'6110'0110' 0111'7111'0111' 1000'8 1001'9 1010'10 A 1011'11 B 1100'12 C 1101'13 D 1110'14 E 1111'15 F
B INARY TO DECIMAL CONVERSION Mr.Mohammed Rahmath x2x2x2x2 x2 2x2x2x2x 2 2x2x2x22x2x22x2 (a) 1 = 2(a) 0 = x132x116x18x04x12x01x Q1 ) Convert ( ) 2 =( )10 = (117) 10
C LASS WORK Convert Binary to Decimal 1. ( ) 2 = ( ) ( ) 2 = ( ) ( ) 2 = ( ) ( ) 2 = ( ) ( ) 2 = ( ) ( ) 2 = ( ) 10 Mr.Mohammed Rahmath
D ECIMAL TO B INARY C ONVERSION Q ) (35) 10 = ( ) 2 = (100011)2 Mr.Mohammed Rahmath
C LASS WORK Convert Decimal to Binary 1. (421) 10 = ( ) 2 2. (1025) 10 = ( ) 2 3. (368) 10 = ( ) 2 4. (687) 10 = ( ) 2 5. (625) 10 = ( ) 2 6. (752) 10 = ( ) 2 Mr.Mohammed Rahmath
B INARY TO HEXADECIMAL Q ) ( ) 2 = ( ) 16 =( AEA) 16 Mr.Mohammed Rahmath AEA
C LASS WORK Convert Binary to Hexadecimal 1. ( ) 2 = ( ) ( ) 2 = ( ) ( ) 2 = ( ) ( ) 2 = ( ) ( ) 2 = ( ) ( ) 2 = ( ) 16 Mr.Mohammed Rahmath
H EXADECIMAL TO BINARY Q ) (A19) 16 = ( ) 2 =( ) 2 Mr.Mohammed Rahmath A
C LASS WORK Convert Hexadecimal to Binary 1. (AF1) 16 = ( ) 2 2. (924) 16 = ( ) 2 3. (3569) 16 = ( ) 2 4. (4526) 16 = ( ) 2 5. (6548) 16 = ( ) 2 6. (1334) 16 = ( ) 2 Mr.Mohammed Rahmath
C HAPTER 3 E ND Mr.Mohammed Rahmath