Академический Документы
Профессиональный Документы
Культура Документы
Multiplication in Binary
• The basic table is × 0 1
very easy to write 0 0 0
down 1 0 1
• The usual method of ‘long multiplication’
for decimal nos applies also to binary nos
• Example: 101112 × 11012 = 1001010112
• Exercise: Calculate 10112 × 10102
Answer: 11011102
2
Division in Binary
• Again, the usual method for ‘long division’
applies to division of binary nos
• Example: 111012 ÷ 1102 = 100.110….2
• Note that at each step of the division, the
divisor 1102 ‘goes into’ the number either
once (if it is less than or equal to the number)
or zero times (if it is greater than the number)
3
1
Discrete Mathematics 2002 Lecture 4, 30-July-2002
CHAPTER 3
• Chapter 2 – we looked at the binary system
& its useful shorthands (octal, hex), and at
ways for manipulating these nos by hand
• Chapter 3 – we will look at how binary nos
are stored and manipulated in a computer
• In a computer, integers & real nos are
handled differently – we will concentrate on
integers, & later look only briefly at real nos
4
2
Discrete Mathematics 2002 Lecture 4, 30-July-2002
3
Discrete Mathematics 2002 Lecture 4, 30-July-2002
Computer Representations
• Examples: Find the 16-bit computer
representations of the following integers:
(a): 12723 (which is 110001101100112)
(b): –19464 (i.e. −1001100000010002)
(c): –32768 (i.e. –10000000000000002)
• Exercise: Find the 16-bit computer repn of
–5131 (i.e. –10100000010112)
Answer: 1110101111110101
10