Computer Organization and Assembly Language.. Lecture 03: Data Representation 02..[r]
Trang 1CSC 221
Computer Organization and
Assembly Language
Lecture 03: Data Representation 02
Trang 2Lecture 02: Review
• Data Representation
• Decimal Representation
• Binary Representation
• Two’s Complement
• Hexadecimal Representation
Trang 3Lecture Outline
• Data Representation
• Binary Multiplication
• Binary Division
• Floating Point Representation
Trang 4Binary Multiplication
• Multiplication follows the general principal of shift and add.
• The rules include:
Trang 5Binary Multiplication
EXAMPLE 1
Complete 15 * 5 in binary.
1. Convert to binary
15 = 000011112
5 = 000001012
3. Ignore any insignificant zeros.
000011112
000001012
x
Trang 6Binary Multiplication
EXAMPLE 1
1 1 1 12
1 0 1 2
1 1 1 1
x
1111 x 1 = 1111
Trang 7Binary Multiplication
EXAMPLE 1
second digit
1 1 1 12
1 0 1 2
1 1 1 1
0 0 0 0 0
Shift One Place
Trang 8Binary Multiplication
EXAMPLE 1
digit
1 1 1 12
1 0 1 2
1 1 1 1
0 0 0 0 0
1 1 1 1 0 0
Shift One Place
Trang 9Binary Multiplication
EXAMPLE :
1 1 1 1
0 0 0 0 0
1 1 1 1 0 0
1 0 0 1 0 1 1
+
Trang 10Binary Division
• Division in binary is similar to long division in decimal.
• It uses what is called a shift and subtract method.