Escolar Documentos
Profissional Documentos
Cultura Documentos
Lecture #5
Overview
This lecture will cover:
Bits vs. Bytes
form
Bits vs. Bytes
Kbps)
browser
Note! The Multipliers for Bits and
Bytes are Slightly Different.
“Kilo” or “Mega” have slightly different values when used with bits per second
or with bytes.
140.00º F 100011001010000
139.99º F 100011001001111
139.98º F 100011001001110
139.97º F 100011001001101
0.00º F 000111110100000
-39.98º F 000000000000010
-39.99º F 000000000000001
-40.00º F 000000000000000
Thermometer Coding (Another
solution)
0.04º F 000000000000100
0.03º F 000000000000011
0.02º F 000000000000010
0.01º F 000000000000001
0.00º F 000000000000000
-0.01º F 111111111111111
-0.02º F 111111111111110
-0.03º F 111111111111101
Representing Negative
Numbers in Binary Form
Negative numbers may also be represented in binary
This may be accomplished a number of ways:
The leftmost bit i.e.: MSB may be used to represent the
sign. i.e.: 0 if positive, 1 if negative. ex: 1110 is a negative
number because MSB is “1”. In decimal, this will correspond
to -6. Positive 6 (+6) may then be represented by: 0110
There is a problem with this scheme in computer logic,
The addition of the original number (+6) and it’s 2’s complemented
value (-6) should give zero:
0110 Positive number
+1010
1 0000 Negative number
overflow
Finally, add 1:
11011
To convert from octal to hex (or hex to octal), first convert octal (or
hex) to binary, and then convert binary to hex (or octal).
Representing Alphanumeric
Characters in Binary form (ASCII)
It is important to be able to represent text in
binary form as information is entered into a
computer via a keyboard
Text may be encoded using ASCII
ASCII can represent:
Numerals
Letters in both upper and lower cases
Special “printing” symbols such as @, $, %, etc.
Commands that are used by computers to
represent carriage returns, line feeds, etc
ASCII is an acronym for American Standard Code for Information
Interchange
Its structure is a 7 bit code (plus a parity bit or an “extended” bit
in some implementations
–ASCII can represent 128 symbols (27 symbols)
Extended ASCII Chart
This ASCII chart illustrates
Decimal and Hex
representation of numbers,
text and special characters
Hex can be easily converted
to binary
Upper case D is 4416
416 is 01002
Upper case D is then 0100
0100 in binary
Extended ASCII (Cont…)
Another example:
You want to represent
the Yen sign (¥)
From the table: 9D
916 = 910 = 10012
D16 = 1310 = 11012
The ¥ sign in binary is:
1001 1101
ASCII conversion example
Let us convert You & I, to decimal, hex and
binary using the ASCII code table :
Y: 8910 5916 10110012
o: 11110 6F16 11011112
u: 11710 7516 11101012
Space: 3210 2016 01000002
&: 3810 2616 01001102
Space: 3210 2016 01000002
I: 7310 4916 10010012
,: 4410 2C16 01011002
You & I, in Hex:
59 6F 75 20 26 20 49 2C
You & I, in decimal:
89 111 117 32 38 32 73 44
You & I, in binary:
1011001 1101111 1110101 0100000
0100110 0100000 1001001 0101100
Other Text Codes
Extended Binary Coded
Decimal Interchange
Code (EBCDIC) used by
IBM-- 8 bit (28 bits) 256
symbols
Unicode is 16 bit (216)
65,536 symbols
World Wide Web
supports many languages
Unicode supports Latin,
Russian, Cherokee and
other alphabet
representations
www.unicode.org