data representation

16
Binary Number System Bit Byte Character ASCII DATA REPRESENTATION

Upload: rozanadiana

Post on 15-Nov-2014

2.050 views

Category:

Technology


5 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Data representation

Binary Number SystemBit

ByteCharacter

ASCII

DATA REPRESENTATION

Page 2: Data representation

BINARY DIGIT

• Bit is smallest unit of data

Page 3: Data representation

3

Binary Number System

Page 4: Data representation

4

Binary Communication Between Hardware and Software

Page 5: Data representation

How is a letter converted to binary form and back?

Step 1.The user presses the capital letter D (shift+D key) on the keyboard.

Step 2.An electronic signal for the capital letter D is sent to the system unit.

Step 3.The signal for the capital letter D is converted to its ASCII binary code (01000100) and is stored in memory for processing.

Step 4.After processing, the binary code for the capital letter D is converted to an image, and displayed on the output device.

Page 6: Data representation

BIT

• BIT stands for Binary Digit• It is the smallest size of computer data storage• It can either store a binary “0” or a “1”

Therefore a BIT can have 2 different values or combinations.

0 1OR

Page 7: Data representation

Byte• – a group of 8 bits. – Therefore, a byte can represent up to 28=256

values.– The values can range from 0 to 255 or from -

128 to 127.– The fundamental data unit of a computer.

? ? ? ? ? ? ? ?

Page 8: Data representation

Data Representation 2 Presentation Unit 2

Slide 8

BYTE

The 256 possible combinations are shown below:00000000000000010000001000000011

…1111111011111111

Page 9: Data representation

Data Representation 9

Bytes as unsigned integers

• Base 2 number using positional notation

128 64 32 16 8 4 2 1

0 0 1 0 0 0 1 1

Value is 32 + 2 + 1 = 3310

leastsignificantbit

mostsignificantbit

Page 10: Data representation

CHARACTER• 8 bits = 1 byte = 1 character (like ‘A’)• One byte represent one character such as A, 7,

9 and @• For example the 01000110 represented a

letter “F”

0 1 0 0 0 1 1 0 = F

Page 11: Data representation

ASCII

Page 12: Data representation

000 001 010 011 100 101 110 1110000 NULL DLE 0 @ P ` p0001 SOH DC1 ! 1 A Q a q0010 STX DC2 " 2 B R b r0011 ETX DC3 # 3 C S c s0100 EDT DC4 $ 4 D T d t0101 ENQ NAK % 5 E U e u0110 ACK SYN & 6 F V f v0111 BEL ETB ' 7 G W g w1000 BS CAN ( 8 H X h x1001 HT EM ) 9 I Y i y1010 LF SUB * : J Z j z1011 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

Example ‘a’ = 11000012

Page 13: Data representation

“Hello, world” Example

============

Binary010010000110010101101100011011000110111100101100001000000111011101100111011100100110110001100100

Decimal72

1011081081114432

119103114108100

Hello,

world

============

Note: 12 characters – requires 12 bytesEach character requires 1 byte

Page 14: Data representation

DATA MEASUREMENT

• 1 KB = 210 bytes = 1024 • 1 MB = 220 bytes = 1048576 byte• 1 GB = 230 bytes = 1073741824• 1 TB = 240 bytes =1099511627776

Page 15: Data representation

CLOCK SPEED MEASUREMENT

• “SPEED” means how fast it can process data• Every processor contains a system clock. The

system clock control the speed of all operations within a computer.

• The clock speed unit is measured in Hertz.• A Hertz is one cycle per second.

Page 16: Data representation

UNIT OF SPEED