انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

numbering systems

Share |
الكلية كلية العلوم للبنات     القسم قسم الحاسبات     المرحلة 1
أستاذ المادة نور كاظم ايوب مهدي المهدي       14/11/2015 22:26:15
1.2 Number system
A number system defines how a number can be represented using distinct symbols. A number can be represented differently in different systems. For example, the two numbers (2A)16 and (52)8 both refer to the same quantity, (42)10, but their representations are different. There are 4 basic number systems:






1.3 Important terms
Here are important terms in this lecture:
1-Symbols: it is the set of digits that used in the number system In the lecture, we will use the character (S) to express this set.
2-Base (or radix): is the number of symbols used in the number system. we will use the character (b) to express this number.
To distinguish among numbers of different bases, we enclose the coefficient in parenthesis an write a subscript equal to the base used.
For example
(13)10 --> decimal.
(13)16 --> hexadecimal
(13)8 --> octal.
3-Weighs : There is a weight of each coefficient (مرتبة) ,it is the base (b) of the system powered by i where i = 0 ,1,2,…,k-1 where k is the number of the digits in the integral part and i=-1,-2,…,L where L is the number of the digits in the fractional part .The greater the value of the weight the more importance of his coefficient .

1.4 Decimal Systems
The word decimal is derived from the Latin root decem (ten). In this system we use ten symbols so this system is said to be of base 10 (b = 10 ).
S={0,1,2,3,4,5,6,7,8,9}
Now,how can we represent the numbers in the decimal system?
We can represent decimal numbers using the following general formula:

Which is a series of coefficient .the weights in this system have the form 10i (based on the definition of weights previously explained).
Note that , each weight in the integral part of its value equal to value of the previous weight multiplied by 10. For fractional part, every weight value equal to the value of the previous weight divided by 10.
The value of any number could be written as the summation of the coefficients Multiplied by the corresponding weights :

For example: 24.13= 2×10+4 . 1×10-1+3×10-2
1.5 Binary system
The coefficients in this system have two possible values: 0 or 1, i.e.:
S={0,1}
The binary number consist of coefficients, each coefficient is called bit. The leftmost bit of a binary number is called the Most Significant Bit (MSB) because it is

The owner of the highest weight, while the bit which is located in the right most number is called the Least Significant Bit (LSB) because it has less weight. Weights in this system is 2 raised to the power of i(based on the definition of weights previously explained).

2k-1 … 4 2 1 + 0.5 0.25 … 2-L

Note that each weight in the integral part of its value equal to double value of the previous weight(1 ,2,4,8,16,32,…). For fractional part, every weight value equal to the value of the previous weight divided by 2 (0.5,0.25,0.125,0.0625,…).
If No.of coefficient (length of binary number) in the binary number =8 ,we call it byte. So byte is the binary number that has 8 bit.
Generally, If we have n bit, we can form 2n binary combinations.
For example :
If n=1---> No. of binary combinations = 21 =2
And these two values either 1 or 0 because we have 1 bit in this case.
Another example:
Suppose you have 2 bit
No. of binary combinations = 22 =4
So, you have 2 bit and 2 values to use (0 and 1)
The first possibility is : both bit have the value of zero.
The second possibility is : both bit have the value of one.
The third possibility is : one of them has the value of zero and the other one has the value of one.in this case:
Either we get 0 1 or 1 0.
To summarized the results :



First bit Second bit
0 0
0 1
1 0
1 1





1.6 Octal number systems
The word octal is derived from the Latin root octo (eight). In this system the base b = 8 and we use eight symbols to represent a number. The set of symbols is:
S={0,1,2,3,4,5,6,7}
The octal numbers are used in machine language programming for microcomputers.
1.7 Hexadecimal system:
The hexadecimal number system is said to be of base 16 because it uses 16 symbols:
S={ 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
Where A to F correspond 10 to 15


1.8 Conversion between decimal and other systems
In this section we learn how to convert from decimal to (binary,octal,hexa) and vise versa by solving some examples:

a- To convert number from any system to decimal we use Weights :
?_(i=0)^(k-1)??s_i b^i ? . ?_(j=1)^l?s_(-j b^(-j) )
From right to left from left to right
<---------------------- ---------------------->
Where : s--> coeffecients, b-->the base.
I--> the order number in the integral part, j --> the order number in the fraction part.
k--> No. of orders in the integral part , L--> No. of orders in the fraction part.

































b- To convert number from decimal to any system ,use division for integer part and multiplication for fractional part:



















1.9 Conversion between binary and other systems
In this section we learn how to convert from binary to octal and hexa by expalining some examples, conversion between binary and dicimal is already shown in the previous section.
Conversion from any system to binary :
The idea here is how many bits are needed to represent the number in the other system, for example,in the octal system each number is represented by 3 bits as seen in the following table, because the largest symbol (7) needs 3 bit (or b=8 -?8 = 23? No.of required bits is 3):
Table 1.1 : binary octal conversion
octal 0 1 2 3 4 5 6 7
binary 000 001 010 011 100 101 110 111

The same thing applies to the hexa system, the largest number (F i.e. 15) is represented by 4 bits (or b=16 ?16 = 24? No.of required bits is 4)., so each number is converted to the equivalent 4-bits in the binary system, as if we were dealing with a decimal number, Let s see the following example:

Table 1.2 binary-hexa conversion
Hexa 0 1 2 3 4 5 6 7
binary 0000 0001 0010 0011 0100 0101 0110 0111

Hexa 8 9 A B C D E F
binary 1000 1001 1010 1011 1100 1101 1110 1111



1.10 Conversion from binary to other systems
This process is opposite to the process described in the previous section. For octal system, this conversion can be done in two steps:

binary number is divided into groups consisting of 3 bits.For the integer part,the groups configure begins from right to left but for the fractional part ,we start from left to right.
Each group is converted to its equivalent of the decimal system using table 1.1

Another example:

1.11 Summary
The table below shows the numbers from 1 to 15 represented by the of the four numbering systems :

Note that the digits 0 to 7 have the same representation in the decimal, octal and hexadecimal.


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
الرجوع الى لوحة التحكم