Friday 22 November 2013

Arithmetics for Computers (Number Systems and Operations)



Subtopic in this chapter:
Operation on integer
                 * Addition and subtraction
                    * Multiplication and division
# Floating-point real number
                        *  Representation and operations



OPERATION ON INTEGER


Example for Binary Addition




Example for Binary Substraction




Example for Binary Multiplication





Example for Binary Division



by Nor Izzati Binti Setopa



                                                 


 Example for Hexadecimal Addition









Example for Hexadecimal Substraction






Example for Hexadecimal Multiplication

  Step Hexadecimal Multiplication:

                                                - convert hexadecimal to decimal

                                                - convert decimal to hexadecimal back
              




Example for Hexadecimal Division

Step Hexadecimal Division:
- convert hexadecimal to decimal first
- convert decimal to hexadecimal back


by Siti Nazirah Binti Abu Hasan



FLOATING-POINT REAL NUMBERS

________________________________________________________________________________

Floating Point Addition
      
    
              Add the following two decimal numbers in scientific notation:

8.70 × 10-1 with 9.95 × 101


          1. Rewrite the smaller number such that its exponent matches with the                        exponent of the larger number.

8.70 × 10-1 = 0.087 × 101
2.  Add the mantissas

9.95 + 0.087 = 10.037 and write the sum 10.037 × 101

3. Put the result in Normalised Form

10.037 × 101 = 1.0037 × 102 (shift mantissa, adjust exponent)
check for overflow/underflow of the exponent after normalisation

4. Round the result
    If the mantissa does not fit in the space reserved for it, it has to be                 rounded off.
    For Example: If only 4 digits are allowed for mantissa

1.0037 × 102 ===> 1.004 × 102
   (only have a hidden bit with binary floating point numbers)
____________________________________________________________



Example addition in binary

                
           Perform 0.5 + (-0.4375)
0.5 = 0.1 × 20 = 1.000 × 2-1 (normalised)
-0.4375 = -0.0111 × 20 = -1.110 × 2-2 (normalised)

  1. Rewrite the smaller number such that its exponent matches with the exponent of the larger number.
    -1.110 × 2-2 = -0.1110 × 2-1


  2. Add the mantissas:
    1.000 × 2-1 + -0.1110 × 2-1 = 0.001 × 2-1


  3. Normalise the sum, checking for overflow/underflow:
    0.001 × 2-1 = 1.000 × 2-4
    -126 <= -4 <= 127 ===> No overflow or underflow


  4. Round the sum:
    The sum fits in 4 bits so rounding is not required
    Check: 1.000 × 2-4 = 0.0625 which is equal to 0.5 - 0.4375
Correct!
______________________________________________________________________



 Floating Point Multiplication

      
     Multiply the following two numbers in scientific notation by hand:
1.110 × 1010 × 9.200 × 10-5

  1. Add the exponents to find
    New Exponent = 10 + (-5) = 5
    If we add biased exponents, bias will be added twice. Therefore we need to subtract it once to compensate:
    (10 + 127) + (-5 + 127) = 259

    259 - 127 = 132 which is (5 + 127) = biased new exponent


  2. Multiply the mantissas
    1.110 × 9.200 = 10.212000
    Can only keep three digits to the right of the decimal point, so the result is
    10.212 × 105


  3. Normalise the result
    1.0212 × 106


  4. Round it
    1.021 × 106
___________________________________________________________________________________________




Example multiplication in binary:



1.000 × 2-1 × -1.110 × 2-2

  1. Add the biased exponents
    (-1 + 127) + (-2 + 127) - 127 = 124 ===> (-3 + 127)


  2. Multiply the mantissas

  3.               1.000
               ×  1.110
               -----------
                      0000
                     1000
                    1000
               +   1000
               -----------
                   1110000  ===> 1.110000
    
    The product is 1.110000 × 2-3
    Need to keep it to 4 bits 1.110 × 2-3


  4. Normalise (already normalised)
    At this step check for overflow/underflow by making sure that
    -126 <= Exponent <= 127
    1 <= Biased Exponent <= 254


  5. Round the result (no change)


  6. Adjust the sign.
    Since the original signs are different, the result will be negative
    -1.110 × 2-3
_____________________________________________________________________________________________

by Robael Adawiyah dan Wan Nur Ulaiya




Floating Point Standart IEEE 754



by Siti Hajar


source:



DIGITAL LOGIC

TRUTH TABLE

How to know the number of entries ?

Truth table with n input contain 2^ (n) entries
 >> For example : : input = 3 , so the number of entrries = 2^(3) = 8

INPUT
OUTPUT
A
B
C
D
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
0
0
1
1
1
1
          >> example of truth table with 3 input and [  (A . B .C) = D ]  


by : siti nazirah


BOOLEAN ALGEBRA

‘OR’ is written as ' + '
‘AND’ is written as ' . ' / / ' &'
‘OR’ is written as ' + '

BOOLEAN ALGEBRA LAWS

LAWS

IDENTITY LAW
A + 0 = A
A & 1 = A
ZERO AND ONE LAWS
A + 1 = 1
A & 0 = 0
INVERSE LAW
A + A’ = 1
A & A’ = 1
COMMUTATIVE LAWS
A + B = B + A
A & B = B & A
ASSOCIATIVE LAWS
A + (B + C) = (A + B) + C
A & (B & C) = (A & B) & C
DISTRIBUTIVE LAWS
A & (B + C) = (A & B) + (A & C)
A + (B & C) = (A + B) & (A + C)

by : nor izzati


GATES 



AND gate [A & B = Q]




OR gate [A + B = Q]




NOT gate [ A'  = Q]



NAND gate



NOR gate


by :  robael adawiyah


SUM OF PRODUCT

>> logical sum of products ( OR ) which terms using AND operator <<

example : E = (A & B & C) + ( A' & B & C) + ( A + B' + C')

From the truth table , we have to choose combination of input values that produce 1's only !

by : wan nur ulaiya


PRODUCT OF SUM

>> logical products of sum ( AND ) which terms using OR operator <<
    { opposite to sum of product }

example : E = (A + B + C) & (A' + B + C) & (A + B' + C')

From the truth table , we need to choose combination of input values that produce 0's only !

by : siti hajar




source : lecture note chapter 4_5 The Basic of Logic Design BITS 1123 FTMK UTeM

Wednesday 20 November 2013

INTRODUCTION




Assalamualaikum and Hi all ! :) 

As accomplished our computer organisation & architecture assigment , we have to perform a group of five members from BITD semester 1 UTeM student

For this assigment we choose four main topics
                 
1) Arithmetics for Computers (Number Systems and Operations)

2) Digital Logic

3) Language of the Computers

4) Input/Output

 Group members :

1) SITI NAZIRAH BINTI ABU HASAN  B031310471
2) ROBAEL ADAWIYAH BINTI SAIFUL ANUAR  B031310381
3) NOR IZZATI BINTI SETOPA  B031310403
4) WAN NUR ULAIYA BINTI WAN NIZAR  B031310122
5) SITI HAJAR BINTI DEROL  B031310388

Lecturer's name :
Mr Mohd Fairuz Iskandar Othman

HAPPY READING !