160 likes | 361 Views
Chapter 3 Representing Numbers and Text in Binary. Information Technology in Theory By Pelin Aksoy and Laura DeNardis. Binary Coded Decimal. Binary coded decimal (BCD) is a different approach Encodes each digit in the decimal number individually rather than converting the entire number
E N D
Chapter 3Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis
Binary Coded Decimal • Binary coded decimal(BCD) is a different approach • Encodes each digit in the decimal number individually rather than converting the entire number • To convert 30 to BCD, the 3 would first be converted into binary, and then 0 would be converted into binary • Then the two binary strings would be concatenated (i.e. brought together) to represent the number 30 Information Technology in Theory
Binary Coded Decimal (continued) Information Technology in Theory
BCD Example Convert the decimal number 7244(10) into binary coded decimal 7 = 0111 2 = 0010 4 = 0100 4 = 0100 7244(10) = 0111001001000100(2) (BCD) Information Technology in Theory
BCD Example (continued) • Convert the sequence 0001100001111001 into decimal • First break the sequence into groups of four starting from right to left: 0001 1000 0111 1001 • Then convert each group into decimal: • 0001(2) = 1(10) • 1000(2) = 8(10) • 0111(2) = 7(10) • 1001(2) = 9(10) • The answer is 1879(10) Information Technology in Theory
Representing Text and Other Characters in Binary • Binary code can represent text and alphanumeric characters • Two standards: • ASCII • Unicode Information Technology in Theory
ASCII • Extended ASCII assigns an 8-bit code for each alphanumeric character • Recall that an 8-bit code can represent 28, or 256, unique items Information Technology in Theory
Segment of ASCII Chart Information Technology in Theory
ASCII Example H = 01001000 e = 01100101 l =01101100 l =01101100 o = 01101111 ! = 100100001 Therefore, “Hello!” = 0100100001100101011011000110110001101111. The hexadecimal shorthand for this binary sequence is 48 65 6C 6C 6F 21 Information Technology in Theory
Unicode • Unicode is an important standard that uses 16 bits • Allows for a representation of 216 (more than 65,000) unique characters • Provides sufficient characters to encode many different major languages (such as English, Arabic, and Chinese) • Unicode charts may be found by visiting http://unicode.org Information Technology in Theory
EBCDIC • Extended Binary Coded Decimal Interchange Code • Standard associated with IBM computers • Assigns 8 bits per character • An extension of binary coded decimal Information Technology in Theory
Summary • Bits can encode any type of information, including the decimal numbers we use in everyday life and alphanumeric text • A real-world example of binary to decimal conversion is the unique Internet address • Encoded in dotted decimal format • Makes a long binary string easier for people to read • You can also convert between binary and positive integers and represent negative integer and positive noninteger numbers in binary Information Technology in Theory
Summary (continued) • Alternative numbering systems are octal, which uses eight numbers, and hexadecimal, which uses 16 numbers • Not used by digital devices, but by people as a shorthand convention • Network identification in local area networks is usually represented in hexadecimal • Binary code also represents alphanumeric characters • ASCII • Unicode • EBCDIC Information Technology in Theory