Binary And Hexadecimal Numeration And Logical Operations Worksheet - Object Oriented Programming In Java, Marian Manyo Page 4

ADVERTISEMENT

J A V A
L A B
M A N U A L
The instructions that describe this process use this terminology from arithmetic:
quotient
6
2
13
dividend
divisor
12
remainder
1
The algorthim is written as English sentences and describes the process on the previous page. Instructions
1 and 2 are executed only once. Instructions a, b, c and d are executed repeatedly as long as the condition
in 3 is true.
We call this a loop.
The algorithm to convert a whole decimal numeral into a binary numeral
1. The
is the decimal numeral to be converted.
dividend
2. Initially,
is 0. (
is the exponent of 2, 2
gives the place value.)
n
n
n
3. Repeat instructions a – d while the
is not equal to 0
dividend
a. Divide the
by 2, finding a
and a
dividend
quotient
remainder
l
o
b. In the binary numeral, the digit at place value
n
is the
2
remainder
o
p
c. Increase the value of
by one.
n
d. The new value for the
is the
dividend
quotient
E x a m p l e : Convert 13
to a binary numeral.
10
n = 3
n = 2
n = 1
n = 0
START
0
1
3
6
STOP
2
1
2
3
2
6
2
13
0
2
6
12
1
1
0
1
1
1
0
1
3
2
1
0
2
2
2
2
E x e r c i s e 1 . 4 Follow the algorithm to convert the indicated decimal numerals to binary. Clearly show
your work.
A. Convert the decimal numeral 18 to binary
P A G E 1 . 4
M A R I A N M A N Y O , M A R Q U E T T E U N I V E R S I T Y

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education