ü Most widely used by modern civilizations.
ü The prefix “deci-” stands for 10
ü Base of 10 because:
· There are 10 symbols that
represent quantities (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
· Each place value in a
decimal number is a
power of 10
ü The value of assigned weight is composed
by 10digits starting from 0 until 9.
ü The positive and negative values are
determined by their position weight structure(power of a number):
ü most basic number system that most machines (and
electricaldevices) use to communicate.
ü The hexadecimal number system is used as an intermediary
system in computers, such as arepresentation of memory addresses or a
representation of colors
Converting Binary Numbers to Decimal
•Step1
– Starting with the 1s place,
write the binary place value over each digit in the binary number being converted
:
•Step2
– Add up all of
the place values that have a “1” in the binary number
*EXAMPLE
Convert the following binary number to decimal number :
Converting decimal Numbers to binary
• There are two
methods that can be used to convert decimal numbers to binary:
• Starting with the 1s place, write down all of the binary place
values in order until you get to the first binary place value that is GREATER
THAN the decimal number you are trying to convert.
v Repeated
subtraction method
v Repeated division
method
• Both methods produce the same result and you should use whichever
one you are most comfortable with .
Repeated
subtraction method
As an explanation of the repeated subtraction method, let’s
convert the decimal number 204 to binary.
Step 1:
Step 3:
Step 4:
Step 5:
* EXAMPLE
Convert the following decimal number
to binary using repeated subtraction method :
a) 18910
Repeated
division method
Step1:
• Divide the decimal number you’re
trying to convert by 2 in regular long division until you have a final
remainder.
Step2:
• Use the first remainder as the LEAST
SIGNIFICANT DIGIT of the binary number.
Step3:
•Divide the quotient you got from the
first division operation until you have a final remainder.
Step4:
•Use the remainder as the next digit
of the binary number.
Step5:
• Repeat Steps 3 & 4
as many times as necessary until you get a quotient that can’t be divided by 2.
Step6:
•Use the last remainder (the one that
can’t be divided by 2) as the MOST SIGNIFICANT digit.
* EXAMPLE
Convert the following decimal number to binary using repeated
division method
a) 33910
b) 59.62510
Converting Binary Numbers
to Hexadecimal
•Step1:
– Starting
with the LEAST SIGNIFICANT digit, mark off the digits in groups of
4.
– For example, to convert 110101001011 to hexadecimal, mark off the digits in
groups of
four.
• 1101 | 0100 | 1011
•Step2:
– Convert each
group of four digits to its hexadecimal character.
•HelpfulHint
– The last
group on the left can have anywhere from 1 to 4 binary digits group.
– If it will
help you see the pattern, you can fill in enough leading zeroes to make the
last group on the left have four digits.
– For example,
1 1 0 | 0 1 1 1 | 1 0 0 1 could be written
as
0 1 1 0 | 0 1 1 1 | 1 0 0 1
0 1 1 0 | 0 1 1 1 | 1 0 0 1
* EXAMPLE
Convert the following binary number to hexadecimal:
a) 11111012= 011111012
b) 10011111001.1012=010011111001.01002
Converting Hexadecimal to Binary Numbers
• Converting hexadecimal numbers to binary is just the reverse operation of converting binary to hexadecimal.
• Just convert
each hexadecimal digit to its four-bit binary pattern. The resulting set of 1s
and 0s is the binary equivalent of the hexadecimal number.:
* EXAMPLE
Convert the following hexadecimal to binary number:
a) AF025E16
b) 3B5D2A716
Converting Hexadecimal to Decimal
• Step 1
– Starting with the 1s place,
write the hexadecimal place value over each digit in the hexadecimal being converted
• Step 2
– Add up all of
the place values that have a value in the hexadecimal
* EXAMPLE
Convert the following hexadecimal to decimal:
a) 3DA416
b) 123D.216
Converting Decimal to Hexadecimal
• There are two methods to
choose from: –
Do a decimal-to-binary conversion and then a binary-to-hexadecimal
conversion.
– Do a direct
conversion using the repeated division method. • Since
this is a conversion to hexadecimal, 16 is the divisor each time.
decimal-to-binary conversion and
then a binary-to-hexadecimal conversion
* EXAMPLE
Convert 13610 to
hexadecimal
Step 1:
convert it to binary number
Step 2:
convert the binary number to hexadecimal
direct conversion
using the repeated division method
* EXAMPLE
Convert 83610 to
hexadecimal
Two's complement is a mathematical operation on binary numbers AND allows the use of binary arithmetic
operations on signed integers, yielding the correct 2's complement results.
1st and 2nd Complement of Binary Numbers
ü They are important because they permit the
representation of negative numbers
ü The method of 2nd complement
arithmetic is commonly used in computers handle negative numbers.
ü Assume that a microprocessor have 8 register bits,
figure below show the sign bit or the most significant bit ( MSB ) if the MSB
bit is 0 , then the number is positive (+) . Conversely, if the MSB is 1 , then
the number is negative (-). The others remaining 7 bits are represent as the
magnitude numbers.
1st Complement of Binary Numbers
v The 1st complement of a binary number is found by changing
all 1s to 0s and all 0s to 1s by using parallel inverters (NOT circuits).
v Example :
2nd Complement of Binary Numbers
v
The 2nd complement of a binary number is found by adding 1 to
LSB of the 1s complement.
v Example :




































No comments:
Post a Comment