Multiplication and Division - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Multiplication and Division

Description:

Multiplication and Division Lab 9 Multiplication Multiplication Multiplication Division Division 8-bit/4-bit = 4:4 Division 8-bit/4-bit = 4:4 Division 8-bit/4-bit = 4 ... – PowerPoint PPT presentation

Number of Views:188
Avg rating:3.0/5.0
Slides: 22
Provided by: haskell
Category:

less

Transcript and Presenter's Notes

Title: Multiplication and Division


1
Multiplication and Division
  • Lab 9

2
Multiplication
1101 x1011 1101 1101 100111
0000 100111 1101 10001111
13 x11 13 13 143 8Fh
3
Multiplication
1101 x1011 1101 1101 100111
0000 100111 1101 10001111
1101 00001011 01101101 adsh 1101 10011110 adsh
1001111 sh 1101 10001111 adsh
4
Multiplication
UM ( u1 u2 -- upL upH )
T
N
N2
mpp (multiply partial product) if N(0) 1
then adsh else sh end if
UM ( u1 u2 -- ud) LIT 0 mpp mpp
mpp mpp ROT DROP
All other signed and unsigned multiplication can
be derived from UM
5
Modifications for Multiplication and Division
y1
6
variable AVector STD_LOGIC_VECTOR (width
downto 0) variable BVector STD_LOGIC_VECTOR
(width downto 0) variable CVector
STD_LOGIC_VECTOR (width downto 0) variable
yVector STD_LOGIC_VECTOR (width downto 0)
variable y1_tmp STD_LOGIC_VECTOR (width-1 downto
0)
begin
AVector '0' a BVector '0'
b CVector '0' c y1_tmp false
yVector '0' false
7
mpp (multiply partial product) if N(0) 1
then adsh else sh end if
when "011101" gt -- mpp if b(0) '1' then
yVector AVector CVector else yVector
AVector end if y lt yVector(width downto
1) y1 lt yVector(0) b(width-1 downto 1)
T
N
N2
8
16 x 16 32 Multiplication
UM ( u1 u2 - upL upH ) 0 mpp mpp mpp mpp
mpp mpp mpp mpp mpp mpp mpp mpp mpp mpp mpp
mpp ROT_DROP
9
Division
10
1010
13 135 13 05
1101 10000111
1101 00111 0000 01111 1101 00101 0000
0101
10
Division 8-bit/4-bit 44
1010
_10000111 1101
numer80 denom30
1101 10000111
1101 00111 0000 01111 1101 00101 0000
0101
If denom lt numer74 then overflow (quotient
wont fit in 4 bits)
Let T numer84 N numer30 N2
denom30
11
Division 8-bit/4-bit 44
T
N
1010
sll
100001110 1101
1101 10000111
1101 00111 0000 01111 1101 00101 0000
0101
N2
for I in 0 to 3 loop sll T N if T84 gt
N2 then T T - (0 N2) N(0)
1 end if end loop
12
Division 8-bit/4-bit 44
T
N
1010
sll
100001110 1101
1101 10000111
N2
1101 00111 0000 01111 1101 00101 0000
0101
13
Division
N2
T
N
UM/MOD ( unumL unumH udenom -- urem uquot )
N2
T
N
-ROT \ udenom unumL unumH SHLDC SHLDC SHLDC SHLD
C \ denom quot rem ROT_DROP_SWAP
All other signed and unsigned division operations
can be derived as WHYP words from UM/MOD
14
when "011110" gt -- shldc yVector a
b(width-1) y1_tmp b(width-2 downto 0)
'0' if yVector gt CVector then yVector
yVector - CVector y1_tmp(0) '1' end
if
y lt yVector(width-1 downto 0) y1 lt y1_tmp
for I in 0 to 3 loop sll T N if T84 gt
N2 then T T - (0 N2) N(0)
1 end if end loop
T
N
sll
100001110 1101
N2
15
32 / 16 1616 Division
UM/MOD ( unL unH ud -- ur uq ) -ROT shldc
shldc shldc shldc shldc shldc shldc shldc shldc
shldc shldc shldc shldc shldc shldc shldc
ROT_DROP_SWAP
16
Hex Division
C
A
EE BC2F
B28
9A
F
C x E A8 C x E A8 A B2
17
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
18
(No Transcript)
19
(No Transcript)
20
(No Transcript)
21
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com