Presentation is loading. Please wait.

Presentation is loading. Please wait.

©1999 Addison Wesley Longman2.1 A Bit About Bits A bit (binary digit) –is the smallest unit of information –can have two values - 1 and 0. Binary digits,

Similar presentations


Presentation on theme: "©1999 Addison Wesley Longman2.1 A Bit About Bits A bit (binary digit) –is the smallest unit of information –can have two values - 1 and 0. Binary digits,"— Presentation transcript:

1

2 ©1999 Addison Wesley Longman2.1 A Bit About Bits A bit (binary digit) –is the smallest unit of information –can have two values - 1 and 0. Binary digits, or bits, can represent numbers, codes, or instructions. OnOff

3 ©1999 Addison Wesley Longman2.2 Bits as Numbers Binary number system - a system that denotes all numbers and combinations of two digits. The binary system uses two digits to represent the numbers 0 and 1.

4 ©1999 Addison Wesley Longman2.3 Number System (I) decimal system ( base 10 ) octal system ( base 8 ) binary system ( base 2 )

5 ©1999 Addison Wesley Longman2.4 Number System (II) decimal octal binary 0 00000 1 10001 2 20010 3 30011 4 40100 5 50101 6 60110 7 70111 8101000 9111001 10121010

6 ©1999 Addison Wesley Longman2.5 To Represent Negative Numbers biased sign magnitude 1’s complement 2’s complement

7 ©1999 Addison Wesley Longman2.6 Biased Numbers decimalBCDbiased 0000-4 1001-3 2010-2 3011-1 41000 51011 61102 71113

8 ©1999 Addison Wesley Longman2.7 Sign Magnitude Numbers sign magnitude -3 1 11 -2 1 10 -1 1 01 -0 1 00 0 0 00 1 0 01 2 0 10 3 0 11

9 ©1999 Addison Wesley Longman2.8 1‘s Complement Numbers -3100 -2101 -1110 -0111 0000 1001 2010 3011

10 ©1999 Addison Wesley Longman2.9 2‘s Complement Numbers -4100 -3101 -2110 -1111 0000 1001 2010 3011

11 ©1999 Addison Wesley Longman2.10 1‘s Complement Addition BCD addition carry end around result always correct when two operands have different sign overflow when two positive operands add to a negative result underflow when two negative operands add to a positive result

12 ©1999 Addison Wesley Longman2.11 2‘s complement Addition BCD addition carry dropped result always correct when two operands have different sign overflow when two positive operands add to a negative result underflow when two negative operands add to a positive result

13 ©1999 Addison Wesley Longman2.12 Floating Point Representation = 12345 * 10 -2 = 1234.5 * 10 -1 = 123.45 = 12.345 * 10 1 = 1.2345 * 10 2 = 0.12345 * 10 3 — normalized form = 0.012345 * 10 4 … 21.75 = 10101.11 = 0.1010111 * 2 5

14 ©1999 Addison Wesley Longman2.13 PDP-11, VAX-11 Floating Point Representation precision 1/2 24 ~ 1/10 7 range 2 127 ~ 10 38 0 10000101 01011100…….0 8 bits 23 bits mantissa sign

15 ©1999 Addison Wesley Longman2.14 IBM360/370 Floating Point Representation 21.75 = 10101.11 B = 15.C H =.15C * 16 2 precision 1/2 21 ~ 1/10 6 range 16 63 = 2 252 ~ 10 78 0 1000010 0001 0101 1100 0000 0000 0000 4 2 1 5 C 0 0 0

16 ©1999 Addison Wesley Longman2.15 Bits as Codes ASCII - American Standard Code for Information Interchange - most widely used code, represents each character as a unique 8-bit code.

17 ©1999 Addison Wesley Longman2.16 Code & Character Sets ASCII ( American Standard Code for Information Interchange ) — 7 bit 0123456789ABCDEF 0 | 1 | 2 |!“#$%&`()*+-,./ 3 |0123456789 4 |@ABCDEFGHIJKLMNO 5 |PQRSTUVWXYZ 6 |abcdefghIjklmno 7 |pqrstuvwxyz

18 ©1999 Addison Wesley Longman2.17 Code & Character Sets (IV) EBCDIC ( extended BCD for information exchange code ) — 8 bit 0123456789ABCDEF 8|abcdefghi 9|jklmnopqr A|stuvwxyz B| C|ABCDEFGHI D|JKLMNOPQR E|STUVWXYZ F|0123456789

19 ©1999 Addison Wesley Longman2.18 Chinese Characters Big-52 byte( 16 bit )13461 字 CNS116433 byte( 24 bit )48222 字

20 ©1999 Addison Wesley Longman2.19 Bits as Instructions The computer stores programs as collections of bits. For instance, 01101010 might instruct the computer to add two numbers.(OP code) Other bit instructions might include where to find numbers stored in memory or where to store them.(operands)

21 ©1999 Addison Wesley Longman2.20 Bits, Bytes, and Buzzwords Common terms might describe file size or memory size: Bit: smallest unit of information Byte: a grouping of eight bits of information K: (kilobyte); about 1,000 bytes of information - technically 1024 bytes equals 1K of storage.

22 ©1999 Addison Wesley Longman2.21 Bits, Bytes, and Buzzwords MB: (megabyte); about 1 million bytes of information GB: (gigabyte); about 1 billion bytes of information TB: (terabyte); about 1 million megabytes of information


Download ppt "©1999 Addison Wesley Longman2.1 A Bit About Bits A bit (binary digit) –is the smallest unit of information –can have two values - 1 and 0. Binary digits,"

Similar presentations


Ads by Google