Multiplication and Division Instructions - PowerPoint PPT Presentation

About This Presentation
Title:

Multiplication and Division Instructions

Description:

Multiplication and Division Instructions Module M16.4 Section 10.4 Binary Multiplication Binary Multiplication Unsigned MUL Instruction Unsigned Multiplication Signed ... – PowerPoint PPT presentation

Number of Views:264
Avg rating:3.0/5.0
Slides: 25
Provided by: edie
Category:

less

Transcript and Presenter's Notes

Title: Multiplication and Division Instructions


1
Multiplication and DivisionInstructions
  • Module M16.4
  • Section 10.4

2
Binary Multiplication
3
Binary Multiplication
13 x 12 26 13 156
1101 1100 0000 0000 1101
1101 10011100
4
Hex Multiplication
5
Hex Multiplication
Dec
Hex
61 x 90 5490
3D x 5A 262 A x D 82, A x 3 1E 8
26 131 5 x D 41, 5 x 3 F 4 13
157216 549010
6
Hex Multiplication
0000 B0 3D MOV AL,3DH AL3DH 0002 B3 5A MOV
BL,5AH BL5AH 0004 F6 E3 MUL BL
AXALxBL product 1572H is in AX
7
100
11
011
E3
MUL BL
F6
E3
8
16-Bit Hex Multiplication
31A4 x1B2C 253B0
4 x C 30 A x C 78 3 7B 1 x C C 7
13 3 x C 24 1 25
9
16-Bit Hex Multiplication
31A4 x1B2C 253B0 6348
2 x 4 8 2 x A 14 1 x 2 2 1 3 2 x 3 6
10
16-Bit Hex Multiplication
31A4 x1B2C 253B0 6348
2220C
4 x B 2C A x B 6E 2 70 1 x B B 7
12 3 x B 21 1 22
11
16-Bit Hex Multiplication
31A4 x1B2C 253B0 6348
2220C 31A4
0544D430
0000 B8 A4 31 MOV AX,31A4H AX31A4H 0003 BB
2C 1B MOV BX,1B2CH BX1B2CH 0006 F7 E3
MUL BX DXAX AX x BX
12
Unsigned MUL Instruction
13
Unsigned Multiplication
Hex
Dec
A5 x 24 294 14A 1734
165 x 36 990 495 5940
594010 173416
But A5 10100101 can be a signed number 2s
comp 01011011 5BH 9110 Therefore, A5 can
represent -91
14
Signed Multiplication
Dec
327610 0CCC16 0000 1100
1100 1100 2s comp 1111 0011 0011 0100
F334H
-91 x 36 546 273 -3276
Therefore, for signed multiplication A5H x 24H
F334H and not 1734H
The 8086 IMUL instruction performs SIGNED
multiplciation
15
Signed Multiplication
0000 B0 A5 MOV AL,A5H ALA5H 0002 B3 24 MOV
BL,24H BL24H 0004 F6 EB IMUL BL
AXALxBL product F334H is in AX
16
Signed IMUL Instruction
17
Binary Division
1
1
0
1
10011100
1100
1100
1
0111
1100
0
0011
0000
0110
0
1100
0000
18
Hex Division
C
A
EE BC2F
B28
9A
F
C x E A8 C x E A8 A B2
19
Hex Division
C
A
EE BC2F
B28
9A
F
94C
63
Dividend BC2F Divisor EE Quotient
CA Remainder 63
A x E 8C A x E 8C 8 94
20
Hex Division
C
A
EE BC2F
B28
9A
F
94C
63
0000 B8 2F BC MOV AX,0BC2FH AXBC2FH 0003 B3
EE MOV BL,0EEH BLEEH 0006 F6 F3 DIV
BL ALAX/BL quotient AL
CAH remainder AH 63H
21
8086 Division Instructions
22
Divisor may be too small
D71 rem 1
E BC2F
Quotient does not fit in AL Causes a divide by
zero interrupt
23
Interrupt Vector Table
24
Interrupt Vector Table
Offset address
Type number
000 004 008 00C 010 014
IP
0 1 2 3 4 5
Division by zero Single Stepping NMI
Interrupt 1-Byte INT (opcode CC) Signed
overflow (INTO) Print screen
CS
IP
CS
IP
CS
IP
CS
IP
CS
IP
CS
Write a Comment
User Comments (0)
About PowerShow.com