RepeatedMultiply

RepeatedMultiply - = m downto 0 ) do N = N * B + D i ; N...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
The Repeated Multiplication Algorithm To interpret an integer given in base B, to obtain its decimal value Let the digits of the based-integer be D 0 , D 1 , D 2 , etc. So the given based-integer is D m D m-1 .. D 2 D 1 D o (in base B) N = 0; for ( i
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: = m downto 0 ) do N = N * B + D i ; N 101101 2 0 x 2 + 1 = 1 1 01101 2 1 1 x 2 + 0 = 2 10 1101 2 2 2 x 2 + 1 = 5 101 101 2 5 5 x 2 + 1 = 11 1011 01 2 11 11 x 2 + 0 = 22 10110 1 2 22 22 x 2 + 1 = 45...
View Full Document

Ask a homework question - tutors are online