Total Pageviews

Tuesday, 10 December 2013

ARITHMETIC FOR COMPUTERS

The numeral system and arithmetic operations

Unlike the Egyptians, the mathematicians of the Old Babylonian period went far beyond the immediate challenges of their official accounting duties. For example, they introduced a versatile numeral system, which, like the modern system, exploited the notion of place value, and they developed computational methods that took advantage of this means of expressing numbers; they solved linear and quadratic problems by methods much like those now used in algebra; their success with the study of what are now called Pythagorean number triples was a remarkable feat in number theory. The scribes who made such discoveries must have believed mathematics to be worthy of study in its own right, not just as a practical tool.



So , here we are going to explain to you about number system.

NUMBER SYSTEM…
Introduction to number system
Number system is a basic symbol to represent a set of quantities .There are many types of number system but in this topic we are going to focus only on three number system, which are:
binary,
decimal and
hexadecimal;                            



1.1  NUMBER  SYSTEM BASE…
1.1.a) What is a base for number system types ??
- Most of the numbering system will have a base.
- Base ~ maximum number that can be represented on the
               single digit or number.

TABLE 1-1: Types of Number system
SYSTEM
BASE
POSSIBLE DIGITS
Binary
2
0 1
Octal
8
0 1 2 3 4 5 6 7
Decimal
10
0 1 2 3 4 5 6 7 8 9
Hexadecimal
16
0 1 2 3 4 5 6 7 8 9 A B C D E F




Binary number

  • ·        Base 2.
  • ·        The number consist only two digit 0 and 1 only.
  • ·        The weight structure of binary number is :



Binary Points



2 n – 1  …   23     22     21     20      .     2-1     2 -2   …  2 - n

·        The least significance bit (LSB) and most significance bits (MSB) can be identified based on the size of binary number itself.



                                                            MSB              LSB                                      
     1000001110 
                                                                          



Decimal number

  • ·        Base of 10.
  • ·        Value of the assigned weight composed by 10 digits (0 – 9).
  • ·        Position weight structure  will determined the positive values and negative values.


 . . .   105     10 4     10 3      102      101     10 0                                             (positive value)
102    101     100     10-1     10-2     10-3    . . .                                     (negative value)




Hexadecimal number

  • ·        Base of 16.
  • ·        Value of the assigned weight composed by 16 digits (0 until F)
  • ·        The digits is suitable to present in fours bit number.






1.1  NUMBER  SYSTEM CONVERSION…


In this section, you will learn how number system (binary, decimal, hexadecimal) will be  convert. For your information, there are many ways or method that can be used to convert those number system. But in this blog, we will show what method that we used which exactly the systematic method to convert the number system. We are going to show how number system  is converted using repeated – division  by base 2, base 10, and base 16.



TABLE 1-2 : Number System Conversion
BINARY
DECIMAL
HEXADECIMAL
0000
0
0
0001
1
1
0010
2
2
0011
3
3
0100
4
4
0101
5
5
0110
6
6
0111
7
7
1000
8
8
1001
9
9
1010
10
A
1011
11
B
1100
12
C
1101
13
D
1110
14
E
1111
15
F




Example 1-1
Convert decimal number  51.3125  to binary number.
Weight
26
25
24
23
22
21
20
2-1
2-2
2-3
2-4
Value Represented
64
32
16
8
4
2
1
0.5
0.25
0.125
0.0625
Binary (*)
0
1
1
0
0
1
1
0
1
0
1

51 – 32 = 19

19 – 16 = 3

3 – 2 = 1

1 - 1 = 0

0.3125 – 0.25 = 0.0625
0.0625 – 0.0625 = 0

     Therefore, the conversion of   51.312510 = 110011.01012


or, you may try this method too.


    A systematic method for number conversion

Example 1-2


         
           


2
51

2
25
1

2
12
1

2
6
0

2
3
0

2
1
1


1
                                                                                                                                                                                             0.3125 x 2 = 0.625   0
                       0.625 x 2 = 1.25       1
                       0.25 x 2 = 0.5           0
                       0.5 x 2 = 1.0             1
                                                         
                       0.312510  = 0.01012                                                                                                                                                                                                (the answer should be read from top to bottom)                                                                                                                                                                  5110  = 1100112

(the answer should be read from bottom to top)    

                Therefore, the conversion of   51.312510 = 110011.01012          

prepared by: nurul izzati nor rusham (B031310238)

No comments:

Post a Comment