Professional Documents
Culture Documents
N. B. Dodge 09/15
N. B. Dodge 09/15
N. B. Dodge 09/15
N. B. Dodge 09/15
N. B. Dodge 09/15
N. B. Dodge 09/15
N. B. Dodge 09/15
Convert
Decimal #
To Binary
Is the
# > 0?
Complete
No
Take Absolute
Value of # and
Convert to Binary
8
Take 2s
Complement
N. B. Dodge 09/15
No
Is the Binary
# Sign Bit 1?
Complete
Yes
Take 2s
Complement of
Binary Number
9
Convert Binary
# to Decimal
& Add Minus Sign
N. B. Dodge 09/15
Exercise 1
Convert the following:
78
106
11101011
11000010
01010101
10
------------------------------------
N. B. Dodge 09/15
N. B. Dodge 09/15
N. B. Dodge 09/15
0101 1100
+ 0010 0011
0111 1111
Check:
92
( 35)
92
+ 35
+ 127
0111 0010
Check:
114
+1000 0001
+ ( 127)
Check!
1111 0011
13
Check: 2s C of 1111 0011 = 0000 1101 = 13, so the number = 13.
13
N. B. Dodge 09/15
Examples:
0111 0011
+ 0011 1111
1011 0010
115
+ 63
178
= 78!!!
1001 0000
1110 0000
0111 0000
112
32
144
= + 112!!!
N. B. Dodge 09/15
N. B. Dodge 09/15
Exercise 2
Two 2s comp. problems:
0101 0101
+ 1011 0110
1111 1100
0101 0001
16
N. B. Dodge 09/15
Binary Codes
Computers also use binary numbers to represent nonnumeric information, such as text or graphics.
Binary representations of text, (letters, textual numbers,
punctuation symbols, etc.) are called codes.
In a binary code, the binary number is a symbol and does
not represent an actual number.
A code normally cannot be operated on in the usual
fashion mathematical, logical, etc. That is, one cannot
usually add up, for example, two binary codes. It would
be like attempting to add A and G!
17
N. B. Dodge 09/15
Super ASCII codes can use all 8 bits (or more) for even
more elaborate codes, such as other alphabets and
character sets (Greek, Katakana, etc.).
18
N. B. Dodge 09/15
N. B. Dodge 09/15
N. B. Dodge 09/15
21
EBCDIC
C1
C2
81
82
F1
F7
4B
6B
7F
ASCII
41
42
61
62
31
37
2E
2C
22
N. B. Dodge 09/15
Summary
Binary numbers are the numbers of computing. In EE 2310,
students must master binary numbers.
Since we live in a decimal world, it is also crucial to understand
binary/decimal conversions.
Hexadecimal numbers are also important, since many computer
systems use hex readouts to ease the problem of interpreting 32- and
64- bit binary numbers.
Binary codes are numbers that have a different meaning than their
simple numerical value.
ASCII is the default text code in most computer systems.
The basic ASCII code set is shown at the end of these notes.
Remember: There are only 10 types of people in the world those
that understand binary and those that dont!
22
N. B. Dodge 09/15
Exercise 3
Decode the following ASCII message:
47-6f-2c-20-55-54-44-20-43-6f-6d-65-74-73-21
All numbers are ASCII characters in hex. Hint: We
might say this if we had a football team.
23
N. B. Dodge 09/15
Homework
As was discussed last lecture, a good idea is to write
down the two or three important things you learned
today. Add these to the list you made last time (you did
make a list last time, right?).
Write down two or three things you did not clearly
understand, as was mentioned before also.
After finishing the assigned reading, if you still have
questions, see me during office hours.
24
N. B. Dodge 09/15
ASCII Codes
25
N. B. Dodge 09/15