Friday, 22 November 2013

Arithmetic for Computers (Number Systems and Operations) by Chong Kit Shing B031310164



Two’s Complement (2’s complement)
Two’s complement  solve  the problem of alternate representation of zeros. The 2’s complement representation used for sign and magnitude number can be determined. Assume a microprocessor has 8 register bits. Figure 1.1 shows the sign bits or the most significant bit(MSB). If the 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. The first bit from right is a least significant bit (LSB).  Creating the two’s complement of a number begins by flipping all the bits, as with one’s complement, but then 1 is added to the result.


IEEE Floating Point
The Institute of Electronic and Electrical Engineers (IEEE) has proposed a standard for floating point arithmetic on small computers. A single-precision floating point number that follows the IEEE standard has 1 sign bit, and 8 bit exponent, and 23 bits for the mantissa. A double-precision floating point number that follows the IEEE standard has 1 sign bit, and 11 bit exponent, and 52 bits for the mantissa.







Arithmetic for Computers (Number Systems and Operations) by Lee Xue Wen B031310149



Hexadecimal Number ( Base 16 )
The octal number system, in which each digit represents 3 bits, is one common solution to the problems with binary numbers. Another solution involves using 4 bits at a time. This solution requires a digit for each of the 2x2x2x2, or 16, possible bit pattern. The radix is 16, and the system is known as hexadecimal, or hex. The composed number starts from 0 until F. The number is suitable to present in 4 bits number.



 

Thursday, 21 November 2013

Arithmetic for Computers (Number Systems and Operations)Binary Number ( Base 2 )by Cheok Li Li B031310127



Arithmetic for Computers (Number Systems and Operations)
A number system is a basic symbol to represent a set of quantities. There are many types of number systems. The following are examples for decimal, hexadecimal and binary number.
Most of the numbering system will have a base. The maximum number that can be represented on the single digit or number is called a base. Table 1.1 shows the different type of number system and its possible digits.
Table 1.1:The types of Number System
System
Base
Possible Digits
Binary
2
    0  1
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 )
Computer use the binary or base two , number system .  This system has two digits : 0 and 1 ;
The weight of each position is a power of two .



11) Binary Addition
Table 1.1 : The Binary Number Operation Rules
Binary Rules
Sum
Carry
0 + 0 = 0
0
0
0 + 1 = 1
1
0
1 + 0 = 1
1
0
1 + 1 = 10
0
1

*NOTE : 1 + 1 in decimal is two , and two in binary is 10 in base two . The ‘1’ digit carries over into the next higher position .

22)  Binary Subtraction

Table 1.2 : The Binary Number Operation Rules

Binary Rules
Sum
Borrow
0 – 0 = 0
0
0
0 – 1 = 1
1
10
1 – 0 = 1
1
0
1 – 1 = 0
0
1


*NOTE : From the second rule , ( 0 – 1 = 1) , 10 is borrow from the next more significant bit ,
                 then 10 minus 1 is equal to 1 .