d ata representation, binary system, b it, b yte, ascii c ode chapter 3 mr.mohammed rahmath
TRANSCRIPT
DATA REPRESENTATION, BINARY SYSTEM, BIT, BYTE, ASCII CODEChapter 3
Mr.M
oh
am
me
d R
ah
ma
th
DATA REPRESENTATION
• 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.M
oh
am
me
d R
ah
ma
th
MEMORY STRUCTURE IN COMPUTER
• 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 = 28 pieces of information
• words (=2,4, or 8 bytes) – a 2 byte word can represent 2562 pieces of
information (approximately 65 thousand). • Byte addressable - each byte has its own
address.
Mr.M
oh
am
me
d R
ah
ma
th
BINARY 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.M
oh
am
me
d R
ah
ma
th
ASCII CODE
Mr.M
oh
am
me
d R
ah
ma
th
Binary (2) Decimal (10) Octal (8)Hexadecimal
(16)0000' 0 000' 0000'0001' 1 001' 0001'0010' 2 010' 0010'0011' 3 011' 0011'0100' 4 100' 0100'0101' 5 101' 0101'0110' 6 110' 0110'0111' 7 111' 0111'1000' 8 1000'1001' 9 1001'1010' 10 A1011' 11 B1100' 12 C1101' 13 D1110' 14 E1111' 15 F
BINARY TO DECIMAL CONVERSION
Mr.M
oh
am
me
d R
ah
ma
th
1 1 1 0 1 0 1
26 25 24 23 22 21 20
2x2x2x2x2x2
2x2x2x2x2
2x2x2x2
2x2x2
2x2 (a)1= 2
(a)0= 1
64 32 16 8 4 2 1
64x1 32x1 16x1 8x0 4x1 2x0 1x1
64 + 32 +
16 +
0 +
4 +
0 + 1
Q1 ) Convert (1110101)2 =( )10
= (117)10
CLASS WORK
Convert Binary to Decimal1. (101101010)2 = ( )10
2. (100001001)2 = ( )10
3. (111000101)2 = ( )10
4. (101111000)2 = ( )10
5. (010100011)2 = ( )10
6. (101111111)2 = ( )10
Mr.M
oh
am
me
d R
ah
ma
th
DECIMAL TO BINARY CONVERSION
• Q ) (35)10 = ( )2
= (100011)2
Mr.M
oh
am
me
d R
ah
ma
th
CLASS WORK
Convert Decimal to Binary1. (421) 10 = ( ) 2
2. (1025)10 = ( ) 2
3. (368)10 = ( ) 2
4. (687)10 = ( ) 2
5. (625)10 = ( ) 2
6. (752)10 = ( ) 2
Mr.M
oh
am
me
d R
ah
ma
th
BINARY TO HEXADECIMAL
Q ) (101011101010)2 = ( )16
=( AEA)16
Mr.M
oh
am
me
d R
ah
ma
th
1010 1110 1010A E A
CLASS WORK
Convert Binary to Hexadecimal1. (10110101001011100010)2 = ( )16
2. (10000100110110000101)2 = ( )16
3. (11100010101010011010)2 = ( )16
4. (10111100011011101101)2 = ( )16
5. (0101000110110101010)2 = ( )16
6. (101111111010011010)2 = ( )16
Mr.M
oh
am
me
d R
ah
ma
th
HEXADECIMAL TO BINARY
• Q ) (A19)16 = ( )2
=(101000011001)2
Mr.M
oh
am
me
d R
ah
ma
th
A 1 9
1010 0001 1001
CLASS WORK
Convert Hexadecimal to Binary1. (AF1) 16 = ( ) 2
2. (924)16 = ( ) 2
3. (3569)16 = ( ) 2
4. (4526)16 = ( ) 2
5. (6548)16 = ( ) 2
6. (1334)16 = ( ) 2
Mr.M
oh
am
me
d R
ah
ma
th
CHAPTER 3 END
Mr.M
oh
am
me
d R
ah
ma
th